зеркало из https://github.com/mozilla/gecko-dev.git
Bug 735741: Factor out UI in about:home [r=mfinkle]
--HG-- rename : mobile/android/base/resources/layout/abouthome_content.xml => mobile/android/base/resources/layout/abouthome_content.xml.in
This commit is contained in:
Родитель
3f47c98434
Коммит
b3d3200781
|
@ -85,7 +85,6 @@ import android.widget.ArrayAdapter;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.GridView;
|
import android.widget.GridView;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
|
@ -124,9 +123,9 @@ public class AboutHomeContent extends ScrollView
|
||||||
protected SimpleCursorAdapter mTopSitesAdapter;
|
protected SimpleCursorAdapter mTopSitesAdapter;
|
||||||
protected GridView mTopSitesGrid;
|
protected GridView mTopSitesGrid;
|
||||||
|
|
||||||
protected LinearLayout mAddonsLayout;
|
protected AboutHomeSection mAddons;
|
||||||
protected LinearLayout mLastTabsLayout;
|
protected AboutHomeSection mLastTabs;
|
||||||
protected LinearLayout mRemoteTabsLayout;
|
protected AboutHomeSection mRemoteTabs;
|
||||||
|
|
||||||
private View.OnClickListener mRemoteTabClickListener;
|
private View.OnClickListener mRemoteTabClickListener;
|
||||||
|
|
||||||
|
@ -180,9 +179,9 @@ public class AboutHomeContent extends ScrollView
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mAddonsLayout = (LinearLayout) findViewById(R.id.recommended_addons);
|
mAddons = (AboutHomeSection) findViewById(R.id.recommended_addons);
|
||||||
mLastTabsLayout = (LinearLayout) findViewById(R.id.last_tabs);
|
mLastTabs = (AboutHomeSection) findViewById(R.id.last_tabs);
|
||||||
mRemoteTabsLayout = (LinearLayout) findViewById(R.id.remote_tabs);
|
mRemoteTabs = (AboutHomeSection) findViewById(R.id.remote_tabs);
|
||||||
|
|
||||||
TextView allTopSitesText = (TextView) findViewById(R.id.all_top_sites_text);
|
TextView allTopSitesText = (TextView) findViewById(R.id.all_top_sites_text);
|
||||||
allTopSitesText.setOnClickListener(new View.OnClickListener() {
|
allTopSitesText.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@ -191,16 +190,14 @@ public class AboutHomeContent extends ScrollView
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
TextView allAddonsText = (TextView) findViewById(R.id.all_addons_text);
|
mAddons.setOnMoreTextClickListener(new View.OnClickListener() {
|
||||||
allAddonsText.setOnClickListener(new View.OnClickListener() {
|
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (mUriLoadCallback != null)
|
if (mUriLoadCallback != null)
|
||||||
mUriLoadCallback.callback("https://addons.mozilla.org/android");
|
mUriLoadCallback.callback("https://addons.mozilla.org/android");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
TextView allRemoteTabsText = (TextView) findViewById(R.id.all_remote_tabs_text);
|
mRemoteTabs.setOnMoreTextClickListener(new View.OnClickListener() {
|
||||||
allRemoteTabsText.setOnClickListener(new View.OnClickListener() {
|
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Context context = v.getContext();
|
Context context = v.getContext();
|
||||||
context.startActivity(new Intent(context, RemoteTabs.class));
|
context.startActivity(new Intent(context, RemoteTabs.class));
|
||||||
|
@ -256,17 +253,10 @@ public class AboutHomeContent extends ScrollView
|
||||||
}
|
}
|
||||||
|
|
||||||
void setLastTabsVisibility(boolean visible) {
|
void setLastTabsVisibility(boolean visible) {
|
||||||
int visibility = visible ? View.VISIBLE : View.GONE;
|
if (visible)
|
||||||
findViewById(R.id.last_tabs_title).setVisibility(visibility);
|
mLastTabs.show();
|
||||||
findViewById(R.id.last_tabs).setVisibility(visibility);
|
else
|
||||||
findViewById(R.id.last_tabs_open_all).setVisibility(visibility);
|
mLastTabs.hide();
|
||||||
}
|
|
||||||
|
|
||||||
private void setAddonsVisibility(boolean visible) {
|
|
||||||
int visibility = visible ? View.VISIBLE : View.GONE;
|
|
||||||
findViewById(R.id.recommended_addons_title).setVisibility(visibility);
|
|
||||||
findViewById(R.id.recommended_addons).setVisibility(visibility);
|
|
||||||
findViewById(R.id.all_addons_text).setVisibility(visibility);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setTopSitesVisibility(boolean visible, boolean hasTopSites) {
|
private void setTopSitesVisibility(boolean visible, boolean hasTopSites) {
|
||||||
|
@ -280,14 +270,6 @@ public class AboutHomeContent extends ScrollView
|
||||||
findViewById(R.id.no_top_sites_text).setVisibility(visibilityWithoutTopSites);
|
findViewById(R.id.no_top_sites_text).setVisibility(visibilityWithoutTopSites);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setRemoteTabsVisibility(boolean visible) {
|
|
||||||
int visibility = visible ? View.VISIBLE : View.GONE;
|
|
||||||
findViewById(R.id.remote_tabs_title).setVisibility(visibility);
|
|
||||||
findViewById(R.id.remote_tabs_client).setVisibility(visibility);
|
|
||||||
findViewById(R.id.remote_tabs).setVisibility(visibility);
|
|
||||||
findViewById(R.id.all_remote_tabs_text).setVisibility(visibility);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setSyncVisibility(boolean visible) {
|
private void setSyncVisibility(boolean visible) {
|
||||||
int visibility = visible ? View.VISIBLE : View.GONE;
|
int visibility = visible ? View.VISIBLE : View.GONE;
|
||||||
findViewById(R.id.sync_box_container).setVisibility(visibility);
|
findViewById(R.id.sync_box_container).setVisibility(visibility);
|
||||||
|
@ -518,14 +500,14 @@ public class AboutHomeContent extends ScrollView
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
if (array == null || array.length() == 0) {
|
if (array == null || array.length() == 0) {
|
||||||
setAddonsVisibility(false);
|
mAddons.hide();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < array.length(); i++) {
|
for (int i = 0; i < array.length(); i++) {
|
||||||
JSONObject jsonobj = array.getJSONObject(i);
|
JSONObject jsonobj = array.getJSONObject(i);
|
||||||
|
|
||||||
final View row = mInflater.inflate(R.layout.abouthome_addon_row, mAddonsLayout, false);
|
final View row = mInflater.inflate(R.layout.abouthome_addon_row, mAddons.getItemsContainer(), false);
|
||||||
((TextView) row.findViewById(R.id.addon_title)).setText(jsonobj.getString("name"));
|
((TextView) row.findViewById(R.id.addon_title)).setText(jsonobj.getString("name"));
|
||||||
((TextView) row.findViewById(R.id.addon_version)).setText(jsonobj.getString("version"));
|
((TextView) row.findViewById(R.id.addon_version)).setText(jsonobj.getString("version"));
|
||||||
|
|
||||||
|
@ -551,10 +533,10 @@ public class AboutHomeContent extends ScrollView
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mAddonsLayout.addView(row);
|
mAddons.addItem(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
setAddonsVisibility(true);
|
mAddons.show();
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
Log.i(LOGTAG, "error reading json file", e);
|
Log.i(LOGTAG, "error reading json file", e);
|
||||||
}
|
}
|
||||||
|
@ -611,7 +593,7 @@ public class AboutHomeContent extends ScrollView
|
||||||
|
|
||||||
GeckoApp.mAppContext.mMainHandler.post(new Runnable() {
|
GeckoApp.mAppContext.mMainHandler.post(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
View container = mInflater.inflate(R.layout.abouthome_last_tabs_row, mLastTabsLayout, false);
|
View container = mInflater.inflate(R.layout.abouthome_last_tabs_row, mLastTabs.getItemsContainer(), false);
|
||||||
((TextView) container.findViewById(R.id.last_tab_title)).setText(title);
|
((TextView) container.findViewById(R.id.last_tab_title)).setText(title);
|
||||||
((TextView) container.findViewById(R.id.last_tab_url)).setText(url);
|
((TextView) container.findViewById(R.id.last_tab_url)).setText(url);
|
||||||
if (favicon != null)
|
if (favicon != null)
|
||||||
|
@ -623,39 +605,38 @@ public class AboutHomeContent extends ScrollView
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mLastTabsLayout.addView(container);
|
mLastTabs.addItem(container);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
int numLastTabs = lastTabUrlsList.size();
|
final int numLastTabs = lastTabUrlsList.size();
|
||||||
if (numLastTabs > 0) {
|
GeckoApp.mAppContext.mMainHandler.post(new Runnable() {
|
||||||
GeckoApp.mAppContext.mMainHandler.post(new Runnable() {
|
public void run() {
|
||||||
public void run() {
|
if (numLastTabs > 1) {
|
||||||
findViewById(R.id.last_tabs_title).setVisibility(View.VISIBLE);
|
mLastTabs.showMoreText();
|
||||||
|
mLastTabs.setOnMoreTextClickListener(new View.OnClickListener() {
|
||||||
|
public void onClick(View v) {
|
||||||
|
for (String url : lastTabUrlsList)
|
||||||
|
GeckoApp.mAppContext.loadUrlInTab(url);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mLastTabs.show();
|
||||||
|
} else if (numLastTabs == 1) {
|
||||||
|
mLastTabs.hideMoreText();
|
||||||
|
mLastTabs.show();
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
if (numLastTabs > 1) {
|
|
||||||
GeckoApp.mAppContext.mMainHandler.post(new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
LinkTextView openAll = (LinkTextView) findViewById(R.id.last_tabs_open_all);
|
|
||||||
openAll.setVisibility(View.VISIBLE);
|
|
||||||
openAll.setOnClickListener(new LinkTextView.OnClickListener() {
|
|
||||||
public void onClick(View v) {
|
|
||||||
for (String url : lastTabUrlsList)
|
|
||||||
GeckoApp.mAppContext.loadUrlInTab(url);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadRemoteTabs(final Activity activity) {
|
private void loadRemoteTabs(final Activity activity) {
|
||||||
if (!isSyncSetup()) {
|
if (!isSyncSetup()) {
|
||||||
setRemoteTabsVisibility(false);
|
GeckoApp.mAppContext.mMainHandler.post(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
mRemoteTabs.hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -666,11 +647,11 @@ public class AboutHomeContent extends ScrollView
|
||||||
public void onQueryTabsComplete(List<TabsAccessor.RemoteTab> tabsList) {
|
public void onQueryTabsComplete(List<TabsAccessor.RemoteTab> tabsList) {
|
||||||
ArrayList<TabsAccessor.RemoteTab> tabs = new ArrayList<TabsAccessor.RemoteTab> (tabsList);
|
ArrayList<TabsAccessor.RemoteTab> tabs = new ArrayList<TabsAccessor.RemoteTab> (tabsList);
|
||||||
if (tabs == null || tabs.size() == 0) {
|
if (tabs == null || tabs.size() == 0) {
|
||||||
setRemoteTabsVisibility(false);
|
mRemoteTabs.hide();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mRemoteTabsLayout.removeAllViews();
|
mRemoteTabs.clear();
|
||||||
|
|
||||||
String client = null;
|
String client = null;
|
||||||
|
|
||||||
|
@ -680,15 +661,15 @@ public class AboutHomeContent extends ScrollView
|
||||||
else if (!TextUtils.equals(client, tab.name))
|
else if (!TextUtils.equals(client, tab.name))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
final TextView row = (TextView) mInflater.inflate(R.layout.abouthome_remote_tab_row, mRemoteTabsLayout, false);
|
final TextView row = (TextView) mInflater.inflate(R.layout.abouthome_remote_tab_row, mRemoteTabs.getItemsContainer(), false);
|
||||||
row.setText(TextUtils.isEmpty(tab.title) ? tab.url : tab.title);
|
row.setText(TextUtils.isEmpty(tab.title) ? tab.url : tab.title);
|
||||||
row.setTag(tab.url);
|
row.setTag(tab.url);
|
||||||
mRemoteTabsLayout.addView(row);
|
mRemoteTabs.addItem(row);
|
||||||
row.setOnClickListener(mRemoteTabClickListener);
|
row.setOnClickListener(mRemoteTabClickListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
((TextView) findViewById(R.id.remote_tabs_client)).setText(client);
|
mRemoteTabs.setSubtitle(client);
|
||||||
setRemoteTabsVisibility(true);
|
mRemoteTabs.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class TopSitesGridView extends GridView {
|
public static class TopSitesGridView extends GridView {
|
||||||
|
|
|
@ -0,0 +1,103 @@
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
package org.mozilla.gecko;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.LinearLayout.LayoutParams;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
public class AboutHomeSection extends LinearLayout {
|
||||||
|
private static final String LOGTAG = "GeckoAboutHomeSection";
|
||||||
|
|
||||||
|
private TextView mTitle;
|
||||||
|
private TextView mSubtitle;
|
||||||
|
private LinearLayout mItemsContainer;
|
||||||
|
private LinkTextView mMoreText;
|
||||||
|
|
||||||
|
public AboutHomeSection(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
|
||||||
|
setOrientation(VERTICAL);
|
||||||
|
|
||||||
|
LayoutInflater.from(context).inflate(R.layout.abouthome_section, this);
|
||||||
|
|
||||||
|
mTitle = (TextView) this.findViewById(R.id.title);
|
||||||
|
mSubtitle = (TextView) this.findViewById(R.id.subtitle);
|
||||||
|
mItemsContainer = (LinearLayout) this.findViewById(R.id.items_container);
|
||||||
|
mMoreText = (LinkTextView) this.findViewById(R.id.more_text);
|
||||||
|
|
||||||
|
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AboutHomeSection);
|
||||||
|
setTitle(a.getText(R.styleable.AboutHomeSection_title));
|
||||||
|
setSubtitle(a.getText(R.styleable.AboutHomeSection_subtitle));
|
||||||
|
setMoreText(a.getText(R.styleable.AboutHomeSection_more_text));
|
||||||
|
a.recycle();
|
||||||
|
}
|
||||||
|
|
||||||
|
public LinearLayout getItemsContainer() {
|
||||||
|
return mItemsContainer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(CharSequence title) {
|
||||||
|
if (!TextUtils.isEmpty(title)) {
|
||||||
|
mTitle.setText(title);
|
||||||
|
mTitle.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
mTitle.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubtitle(CharSequence subtitle) {
|
||||||
|
if (!TextUtils.isEmpty(subtitle)) {
|
||||||
|
mSubtitle.setText(subtitle);
|
||||||
|
mSubtitle.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
mSubtitle.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMoreText(CharSequence moreText) {
|
||||||
|
if (!TextUtils.isEmpty(moreText)) {
|
||||||
|
mMoreText.setText(moreText);
|
||||||
|
mMoreText.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
mMoreText.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnMoreTextClickListener(View.OnClickListener listener) {
|
||||||
|
mMoreText.setOnClickListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addItem(View item) {
|
||||||
|
mItemsContainer.addView(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clear() {
|
||||||
|
mItemsContainer.removeAllViews();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void show() {
|
||||||
|
setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void hide() {
|
||||||
|
setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showMoreText() {
|
||||||
|
mMoreText.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void hideMoreText() {
|
||||||
|
mMoreText.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
|
@ -62,6 +62,7 @@ SYNC_PP_RES_XML=res/xml/sync_syncadapter.xml res/xml/sync_options.xml
|
||||||
|
|
||||||
FENNEC_JAVA_FILES = \
|
FENNEC_JAVA_FILES = \
|
||||||
AboutHomeContent.java \
|
AboutHomeContent.java \
|
||||||
|
AboutHomeSection.java \
|
||||||
AlertNotification.java \
|
AlertNotification.java \
|
||||||
AwesomeBar.java \
|
AwesomeBar.java \
|
||||||
AwesomeBarTabs.java \
|
AwesomeBarTabs.java \
|
||||||
|
@ -169,6 +170,10 @@ FENNEC_PP_JAVA_FILES = \
|
||||||
SmsManager.java \
|
SmsManager.java \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
FENNEC_PP_XML_FILES = \
|
||||||
|
res/layout/abouthome_content.xml \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
|
||||||
ifneq (,$(findstring -march=armv7,$(OS_CFLAGS)))
|
ifneq (,$(findstring -march=armv7,$(OS_CFLAGS)))
|
||||||
MIN_CPU_VERSION=7
|
MIN_CPU_VERSION=7
|
||||||
|
@ -203,6 +208,7 @@ GARBAGE += \
|
||||||
gecko.ap_ \
|
gecko.ap_ \
|
||||||
res/values/strings.xml \
|
res/values/strings.xml \
|
||||||
R.java \
|
R.java \
|
||||||
|
$(FENNEC_PP_XML_FILES) \
|
||||||
$(SYNC_PP_RES_XML) \
|
$(SYNC_PP_RES_XML) \
|
||||||
package-name.txt \
|
package-name.txt \
|
||||||
Manifest.java \
|
Manifest.java \
|
||||||
|
@ -263,11 +269,11 @@ RES_LAYOUT = \
|
||||||
res/layout/tabs_tray.xml \
|
res/layout/tabs_tray.xml \
|
||||||
res/layout/list_item_header.xml \
|
res/layout/list_item_header.xml \
|
||||||
res/layout/select_dialog_list.xml \
|
res/layout/select_dialog_list.xml \
|
||||||
res/layout/abouthome_content.xml \
|
|
||||||
res/layout/abouthome_topsite_item.xml \
|
|
||||||
res/layout/abouthome_addon_row.xml \
|
res/layout/abouthome_addon_row.xml \
|
||||||
res/layout/abouthome_last_tabs_row.xml \
|
res/layout/abouthome_last_tabs_row.xml \
|
||||||
|
res/layout/abouthome_section.xml \
|
||||||
res/layout/abouthome_remote_tab_row.xml \
|
res/layout/abouthome_remote_tab_row.xml \
|
||||||
|
res/layout/abouthome_topsite_item.xml \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
RES_LAYOUT_V11 = \
|
RES_LAYOUT_V11 = \
|
||||||
|
@ -280,6 +286,7 @@ RES_LAYOUT_LAND_V14 = \
|
||||||
|
|
||||||
RES_VALUES = \
|
RES_VALUES = \
|
||||||
$(SYNC_RES_VALUES) \
|
$(SYNC_RES_VALUES) \
|
||||||
|
res/values/attrs.xml \
|
||||||
res/values/arrays.xml \
|
res/values/arrays.xml \
|
||||||
res/values/colors.xml \
|
res/values/colors.xml \
|
||||||
res/values/styles.xml \
|
res/values/styles.xml \
|
||||||
|
@ -624,7 +631,10 @@ classes.dex: $(FENNEC_JAVA_FILES) $(FENNEC_PP_JAVA_FILES) $(SYNC_JAVA_FILES) $(S
|
||||||
$(JAVAC) $(JAVAC_FLAGS) -Xlint:all,-deprecation,-fallthrough -d classes -classpath classes $(addprefix $(srcdir)/,$(FENNEC_JAVA_FILES)) $(FENNEC_PP_JAVA_FILES) $(addprefix $(srcdir)/,$(SYNC_JAVA_FILES)) $(SYNC_PP_JAVA_FILES) R.java
|
$(JAVAC) $(JAVAC_FLAGS) -Xlint:all,-deprecation,-fallthrough -d classes -classpath classes $(addprefix $(srcdir)/,$(FENNEC_JAVA_FILES)) $(FENNEC_PP_JAVA_FILES) $(addprefix $(srcdir)/,$(SYNC_JAVA_FILES)) $(SYNC_PP_JAVA_FILES) R.java
|
||||||
$(DX) --dex --output=$@ classes
|
$(DX) --dex --output=$@ classes
|
||||||
|
|
||||||
PP_RES_XML=$(SYNC_PP_RES_XML)
|
PP_RES_XML= \
|
||||||
|
$(SYNC_PP_RES_XML) \
|
||||||
|
$(FENNEC_PP_XML_FILES) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
# This is kinda awful; if any of the source files change, we remake them all.
|
# This is kinda awful; if any of the source files change, we remake them all.
|
||||||
$(PP_RES_XML): $(patsubst res/%,$(srcdir)/resources/%.in,$(PP_RES_XML))
|
$(PP_RES_XML): $(patsubst res/%,$(srcdir)/resources/%.in,$(PP_RES_XML))
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
|
#filter substitution
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:gecko="http://schemas.android.com/apk/res/@ANDROID_PACKAGE_NAME@">
|
||||||
|
|
||||||
<LinearLayout android:layout_width="fill_parent"
|
<LinearLayout android:layout_width="fill_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
|
@ -121,100 +123,26 @@
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<TextView android:id="@+id/last_tabs_title"
|
<org.mozilla.gecko.AboutHomeSection android:id="@+id/last_tabs"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="26dip"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="12dip"
|
android:visibility="gone"
|
||||||
android:background="@drawable/abouthome_separator"
|
gecko:title="@string/abouthome_last_tabs_title"
|
||||||
android:textSize="12sp"
|
gecko:more_text="@string/abouthome_last_tabs_open"/>
|
||||||
android:textColor="#000000"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:gravity="left|center_vertical"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:text="@string/abouthome_last_tabs_title"/>
|
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/last_tabs"
|
<org.mozilla.gecko.AboutHomeSection android:id="@+id/recommended_addons"
|
||||||
android:orientation="vertical"
|
android:layout_width="fill_parent"
|
||||||
android:layout_width="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"/>
|
android:visibility="gone"
|
||||||
|
gecko:title="@string/abouthome_addons_title"
|
||||||
|
gecko:more_text="@string/abouthome_addons_browse"/>
|
||||||
|
|
||||||
<org.mozilla.gecko.LinkTextView android:id="@+id/last_tabs_open_all"
|
<org.mozilla.gecko.AboutHomeSection android:id="@+id/remote_tabs"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="47dip"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/abouthome_separator"
|
android:visibility="gone"
|
||||||
android:textColor="#22629e"
|
gecko:title="@string/remote_tabs"
|
||||||
android:textSize="12sp"
|
gecko:more_text="@string/remote_tabs_show_all"/>
|
||||||
android:gravity="center"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:text="@string/abouthome_last_tabs_open"/>
|
|
||||||
|
|
||||||
<TextView android:id="@+id/recommended_addons_title"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="26dip"
|
|
||||||
android:paddingLeft="12dip"
|
|
||||||
android:background="@drawable/abouthome_separator"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:textColor="#000000"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:gravity="left|center_vertical"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:text="@string/abouthome_addons_title"/>
|
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/recommended_addons"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:isScrollContainer="false"/>
|
|
||||||
|
|
||||||
<org.mozilla.gecko.LinkTextView android:id="@+id/all_addons_text"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="47dip"
|
|
||||||
android:background="@drawable/abouthome_separator"
|
|
||||||
android:textColor="#22629e"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:text="@string/abouthome_addons_browse"/>
|
|
||||||
|
|
||||||
<TextView android:id="@+id/remote_tabs_title"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="26dip"
|
|
||||||
android:paddingLeft="12dip"
|
|
||||||
android:background="@drawable/abouthome_separator"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:textColor="#000000"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:gravity="left|center_vertical"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:text="@string/remote_tabs"/>
|
|
||||||
|
|
||||||
<TextView android:id="@+id/remote_tabs_client"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="26dip"
|
|
||||||
android:paddingLeft="12dip"
|
|
||||||
android:background="@drawable/abouthome_separator"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:textColor="#666666"
|
|
||||||
android:gravity="left|center_vertical"
|
|
||||||
android:visibility="gone"/>
|
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/remote_tabs"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:isScrollContainer="false"/>
|
|
||||||
|
|
||||||
<org.mozilla.gecko.LinkTextView android:id="@+id/all_remote_tabs_text"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="47dip"
|
|
||||||
android:background="@drawable/abouthome_separator"
|
|
||||||
android:textColor="#22629e"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:text="@string/remote_tabs_show_all"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<TextView android:id="@+id/title"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="26dip"
|
||||||
|
android:paddingLeft="12dip"
|
||||||
|
android:background="@drawable/abouthome_separator"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:gravity="left|center_vertical"/>
|
||||||
|
|
||||||
|
<TextView android:id="@+id/subtitle"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="26dip"
|
||||||
|
android:paddingLeft="12dip"
|
||||||
|
android:background="@drawable/abouthome_separator"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textColor="#666666"
|
||||||
|
android:gravity="left|center_vertical"/>
|
||||||
|
|
||||||
|
<LinearLayout android:id="@+id/items_container"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:isScrollContainer="false"/>
|
||||||
|
|
||||||
|
<org.mozilla.gecko.LinkTextView android:id="@+id/more_text"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="47dip"
|
||||||
|
android:background="@drawable/abouthome_separator"
|
||||||
|
android:textColor="#22629e"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:gravity="center"/>
|
||||||
|
|
||||||
|
</merge>
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<declare-styleable name="AboutHomeSection">
|
||||||
|
<attr name="title" format="string"/>
|
||||||
|
<attr name="subtitle" format="string"/>
|
||||||
|
<attr name="more_text" format="string"/>
|
||||||
|
</declare-styleable>
|
||||||
|
|
||||||
|
</resources>
|
Загрузка…
Ссылка в новой задаче