Bug 880047: So long, old about:home. RIP. [r=margaret]
--HG-- extra : rebase_source : e0bfebb52799babc6807471fe91d138c6c6da015
@ -24,7 +24,6 @@ import org.mozilla.gecko.util.GamepadUtils;
|
||||
import org.mozilla.gecko.util.HardwareUtils;
|
||||
import org.mozilla.gecko.util.ThreadUtils;
|
||||
import org.mozilla.gecko.util.UiAsyncTask;
|
||||
import org.mozilla.gecko.widget.AboutHome;
|
||||
import org.mozilla.gecko.widget.GeckoActionProvider;
|
||||
import org.mozilla.gecko.widget.ButtonToast;
|
||||
|
||||
@ -381,18 +380,6 @@ abstract public class BrowserApp extends GeckoApp
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
void onStatePurged() {
|
||||
ThreadUtils.postToUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mHomePager.setAboutHomeLastTabsVisibility(false);
|
||||
}
|
||||
});
|
||||
|
||||
super.onStatePurged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
mAboutHomeStartupTimer = new Telemetry.Timer("FENNEC_STARTUP_TIME_ABOUTHOME");
|
||||
@ -1392,8 +1379,6 @@ abstract public class BrowserApp extends GeckoApp
|
||||
|
||||
// FIXME: do animation if animate is true
|
||||
mHomePager.show(getSupportFragmentManager());
|
||||
|
||||
mBrowserToolbar.setNextFocusDownId(R.id.abouthome_content);
|
||||
}
|
||||
|
||||
private void animateHideHomePager() {
|
||||
|
@ -250,9 +250,6 @@ FENNEC_JAVA_FILES = \
|
||||
menu/MenuPanel.java \
|
||||
menu/MenuPopup.java \
|
||||
preferences/SearchPreferenceCategory.java \
|
||||
widget/AboutHome.java \
|
||||
widget/AboutHomeView.java \
|
||||
widget/AboutHomeSection.java \
|
||||
widget/ActivityChooserModel.java \
|
||||
widget/ButtonToast.java \
|
||||
widget/ArrowPopup.java \
|
||||
@ -262,7 +259,6 @@ FENNEC_JAVA_FILES = \
|
||||
widget/GeckoPopupMenu.java \
|
||||
widget/GeckoActionProvider.java \
|
||||
widget/IconTabWidget.java \
|
||||
widget/PromoBox.java \
|
||||
widget/TabRow.java \
|
||||
widget/ThumbnailView.java \
|
||||
widget/TwoWayView.java \
|
||||
@ -451,7 +447,6 @@ endif
|
||||
|
||||
RES_LAYOUT = \
|
||||
$(SYNC_RES_LAYOUT) \
|
||||
res/layout/abouthome_content.xml \
|
||||
res/layout/arrow_popup.xml \
|
||||
res/layout/autocomplete_list.xml \
|
||||
res/layout/autocomplete_list_item.xml \
|
||||
@ -505,7 +500,6 @@ RES_LAYOUT = \
|
||||
res/layout/select_dialog_singlechoice.xml \
|
||||
res/layout/simple_dropdown_item_1line.xml \
|
||||
res/layout/suggestion_item.xml \
|
||||
res/layout/abouthome_section.xml \
|
||||
res/layout/validation_message.xml \
|
||||
res/layout/videoplayer.xml \
|
||||
$(NULL)
|
||||
@ -526,10 +520,6 @@ RES_LAYOUT_XLARGE_V11 = \
|
||||
res/layout-xlarge-v11/remote_tabs_group.xml \
|
||||
$(NULL)
|
||||
|
||||
RES_LAYOUT_XLARGE_LAND_V11 = \
|
||||
res/layout-xlarge-land-v11/abouthome_content.xml \
|
||||
$(NULL)
|
||||
|
||||
RES_VALUES = \
|
||||
$(SYNC_RES_VALUES) \
|
||||
res/values/attrs.xml \
|
||||
@ -609,13 +599,6 @@ RES_DRAWABLE_MDPI = \
|
||||
res/drawable-mdpi/blank.png \
|
||||
res/drawable-mdpi/favicon.png \
|
||||
res/drawable-mdpi/folder.png \
|
||||
res/drawable-mdpi/abouthome_icon.png \
|
||||
res/drawable-mdpi/abouthome_logo_dark.png \
|
||||
res/drawable-mdpi/abouthome_logo_light.png \
|
||||
res/drawable-mdpi/abouthome_promo_box_bg.9.png \
|
||||
res/drawable-mdpi/abouthome_promo_box_pressed_bg.9.png \
|
||||
res/drawable-mdpi/abouthome_promo_logo_apps.png \
|
||||
res/drawable-mdpi/abouthome_promo_logo_sync.png \
|
||||
res/drawable-mdpi/abouthome_thumbnail.png \
|
||||
res/drawable-mdpi/abouthome_thumbnail_add.png \
|
||||
res/drawable-mdpi/alert_addon.png \
|
||||
@ -729,13 +712,6 @@ RES_DRAWABLE_HDPI = \
|
||||
res/drawable-hdpi/folder.png \
|
||||
res/drawable-hdpi/home_bg.png \
|
||||
res/drawable-hdpi/home_star.png \
|
||||
res/drawable-hdpi/abouthome_icon.png \
|
||||
res/drawable-hdpi/abouthome_logo_dark.png \
|
||||
res/drawable-hdpi/abouthome_logo_light.png \
|
||||
res/drawable-hdpi/abouthome_promo_box_bg.9.png \
|
||||
res/drawable-hdpi/abouthome_promo_box_pressed_bg.9.png \
|
||||
res/drawable-hdpi/abouthome_promo_logo_apps.png \
|
||||
res/drawable-hdpi/abouthome_promo_logo_sync.png \
|
||||
res/drawable-hdpi/abouthome_thumbnail.png \
|
||||
res/drawable-hdpi/abouthome_thumbnail_add.png \
|
||||
res/drawable-hdpi/alert_addon.png \
|
||||
@ -819,13 +795,6 @@ RES_DRAWABLE_XHDPI = \
|
||||
res/drawable-xhdpi/blank.png \
|
||||
res/drawable-xhdpi/favicon.png \
|
||||
res/drawable-xhdpi/folder.png \
|
||||
res/drawable-xhdpi/abouthome_icon.png \
|
||||
res/drawable-xhdpi/abouthome_logo_dark.png \
|
||||
res/drawable-xhdpi/abouthome_logo_light.png \
|
||||
res/drawable-xhdpi/abouthome_promo_box_bg.9.png \
|
||||
res/drawable-xhdpi/abouthome_promo_box_pressed_bg.9.png \
|
||||
res/drawable-xhdpi/abouthome_promo_logo_apps.png \
|
||||
res/drawable-xhdpi/abouthome_promo_logo_sync.png \
|
||||
res/drawable-xhdpi/abouthome_thumbnail.png \
|
||||
res/drawable-xhdpi/abouthome_thumbnail_add.png \
|
||||
res/drawable-xhdpi/url_bar_bg_shadow.png \
|
||||
@ -1028,8 +997,6 @@ RES_DRAWABLE_XLARGE_XHDPI_V11 = \
|
||||
$(NULL)
|
||||
|
||||
RES_COLOR = \
|
||||
res/color/abouthome_section_subtitle.xml \
|
||||
res/color/abouthome_section_title.xml \
|
||||
res/color/primary_text.xml \
|
||||
res/color/primary_text_inverse.xml \
|
||||
res/color/secondary_text.xml \
|
||||
@ -1062,8 +1029,6 @@ endif
|
||||
|
||||
MOZ_ANDROID_DRAWABLES += \
|
||||
$(SYNC_RES_DRAWABLE) \
|
||||
mobile/android/base/resources/drawable/abouthome_logo.xml \
|
||||
mobile/android/base/resources/drawable/abouthome_promo_box.xml \
|
||||
mobile/android/base/resources/drawable/action_bar_button.xml \
|
||||
mobile/android/base/resources/drawable/action_bar_button_inverse.xml \
|
||||
mobile/android/base/resources/drawable/bookmark_thumbnail_bg.xml \
|
||||
@ -1100,14 +1065,13 @@ MOZ_ANDROID_DRAWABLES += \
|
||||
|
||||
MOZ_BRANDING_DRAWABLE_MDPI = $(shell if test -e $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources.mn; then cat $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources.mn | tr '\n' ' '; fi)
|
||||
|
||||
RESOURCES=$(RES_LAYOUT) $(RES_LAYOUT_LARGE_LAND_V11) $(RES_LAYOUT_LARGE_V11) $(RES_LAYOUT_XLARGE_V11) $(RES_LAYOUT_XLARGE_LAND_V11) $(RES_VALUES) $(RES_VALUES_LAND) $(RES_VALUES_V11) $(RES_VALUES_LARGE_V11) $(RES_VALUES_LARGE_LAND_V11) $(RES_VALUES_XLARGE_V11) $(RES_VALUES_LAND_V14) $(RES_VALUES_V14) $(RES_VALUES_V16) $(RES_XML) $(RES_XML_V11) $(RES_ANIM) $(RES_DRAWABLE_MDPI) $(RES_DRAWABLE_LDPI) $(RES_DRAWABLE_HDPI) $(RES_DRAWABLE_XHDPI) $(RES_DRAWABLE_MDPI_V11) $(RES_DRAWABLE_HDPI_V11) $(RES_DRAWABLE_XHDPI_V11) $(RES_DRAWABLE_LARGE_MDPI_V11) $(RES_DRAWABLE_LARGE_HDPI_V11) $(RES_DRAWABLE_LARGE_XHDPI_V11) $(RES_DRAWABLE_XLARGE_MDPI_V11) $(RES_DRAWABLE_XLARGE_HDPI_V11) $(RES_DRAWABLE_XLARGE_XHDPI_V11) $(RES_COLOR) $(RES_MENU)
|
||||
RESOURCES=$(RES_LAYOUT) $(RES_LAYOUT_LARGE_LAND_V11) $(RES_LAYOUT_LARGE_V11) $(RES_LAYOUT_XLARGE_V11) $(RES_VALUES) $(RES_VALUES_LAND) $(RES_VALUES_V11) $(RES_VALUES_LARGE_V11) $(RES_VALUES_LARGE_LAND_V11) $(RES_VALUES_XLARGE_V11) $(RES_VALUES_LAND_V14) $(RES_VALUES_V14) $(RES_VALUES_V16) $(RES_XML) $(RES_XML_V11) $(RES_ANIM) $(RES_DRAWABLE_MDPI) $(RES_DRAWABLE_LDPI) $(RES_DRAWABLE_HDPI) $(RES_DRAWABLE_XHDPI) $(RES_DRAWABLE_MDPI_V11) $(RES_DRAWABLE_HDPI_V11) $(RES_DRAWABLE_XHDPI_V11) $(RES_DRAWABLE_LARGE_MDPI_V11) $(RES_DRAWABLE_LARGE_HDPI_V11) $(RES_DRAWABLE_LARGE_XHDPI_V11) $(RES_DRAWABLE_XLARGE_MDPI_V11) $(RES_DRAWABLE_XLARGE_HDPI_V11) $(RES_DRAWABLE_XLARGE_XHDPI_V11) $(RES_COLOR) $(RES_MENU)
|
||||
|
||||
RES_DIRS= \
|
||||
res/layout \
|
||||
res/layout-large-v11 \
|
||||
res/layout-large-land-v11 \
|
||||
res/layout-xlarge-v11 \
|
||||
res/layout-xlarge-land-v11 \
|
||||
res/values \
|
||||
res/values-v11 \
|
||||
res/values-large-v11 \
|
||||
|
@ -6,7 +6,6 @@
|
||||
package org.mozilla.gecko.home;
|
||||
|
||||
import org.mozilla.gecko.R;
|
||||
import org.mozilla.gecko.widget.AboutHome;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
@ -97,13 +96,6 @@ public class HomePager extends ViewPager {
|
||||
return mLoaded;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see AboutHome#setLastTabsVisibility(boolean)
|
||||
*/
|
||||
public void setAboutHomeLastTabsVisibility(boolean visible) {
|
||||
// FIXME: Page handling last tabs should update it.
|
||||
}
|
||||
|
||||
class TabsAdapter extends FragmentStatePagerAdapter {
|
||||
private final ArrayList<TabInfo> mTabs = new ArrayList<TabInfo>();
|
||||
|
||||
|
@ -270,20 +270,6 @@ size. -->
|
||||
<!ENTITY abouthome_last_tabs_open "Open all tabs from last time">
|
||||
<!ENTITY abouthome_visited_empty "Websites you visited go here">
|
||||
|
||||
<!-- Localization note (abouthome_about_sync3, abouthome_about_apps2): The
|
||||
chevron (ex: "»"; unicode= U+00BB) is used as an arrow to show that
|
||||
clicking this text in the promotions box will perform some action. Note
|
||||
that a non-breaking space (unicode= U+00A0) should be used between this
|
||||
character and the remainder of the string to prevent word wrap. -->
|
||||
<!ENTITY abouthome_about_sync3 "Set up Firefox Sync to access bookmarks, history and tabs from your other devices »">
|
||||
<!ENTITY abouthome_about_apps3 "Get apps from the Firefox Marketplace and discover the best the Web has to offer »">
|
||||
<!-- Localization note (abouthome_sync_bold_name, abouthome_apps_bold_name):
|
||||
These strings are accentuated as bold text in the "abouthome_about_..."
|
||||
strings above. These strings should be a subset of the strings above and
|
||||
generally be the name of the product the string describes. -->
|
||||
<!ENTITY abouthome_sync_bold_name "Firefox Sync">
|
||||
<!ENTITY abouthome_apps_bold_name2 "Firefox Marketplace">
|
||||
|
||||
<!ENTITY filepicker_title "Choose File">
|
||||
<!ENTITY filepicker_audio_title "Choose or record a sound">
|
||||
<!ENTITY filepicker_image_title "Choose or take a picture">
|
||||
|
@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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/. -->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:gecko="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<!-- dark theme -->
|
||||
<item gecko:state_dark="true" android:color="#CCFFFFFF" />
|
||||
|
||||
<!-- light theme -->
|
||||
<item gecko:state_light="true" android:color="#CC222222" />
|
||||
|
||||
<!-- default -->
|
||||
<item android:color="@color/text_color_secondary"/>
|
||||
|
||||
</selector>
|
@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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/. -->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:gecko="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<!-- dark theme -->
|
||||
<item gecko:state_dark="true" android:color="@color/text_color_primary_inverse" />
|
||||
|
||||
<!-- light theme -->
|
||||
<item gecko:state_light="true" android:color="@color/text_color_primary" />
|
||||
|
||||
<!-- default -->
|
||||
<item android:color="@color/text_color_primary"/>
|
||||
|
||||
</selector>
|
Before Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 957 B |
Before Width: | Height: | Size: 932 B |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 984 B |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 582 B |
Before Width: | Height: | Size: 581 B |
Before Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 18 KiB |
@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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/. -->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:gecko="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<!-- dark theme -->
|
||||
<item gecko:state_dark="true" android:drawable="@drawable/abouthome_logo_light" />
|
||||
|
||||
<!-- light theme -->
|
||||
<item gecko:state_light="true" android:drawable="@drawable/abouthome_logo_dark" />
|
||||
|
||||
<!-- default -->
|
||||
<item android:drawable="@drawable/abouthome_logo_dark" />
|
||||
|
||||
</selector>
|
@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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/. -->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true" android:drawable="@drawable/abouthome_promo_box_pressed_bg"/>
|
||||
<!-- TODO: create a new 9-patch for focused state (bug 855013). For now re-use the pressed state image -->
|
||||
<item android:state_focused="true" android:drawable="@drawable/abouthome_promo_box_pressed_bg"/>
|
||||
<item android:drawable="@drawable/abouthome_promo_box_bg"/>
|
||||
|
||||
</selector>
|
@ -1,53 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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/. -->
|
||||
|
||||
<org.mozilla.gecko.widget.AboutHomeView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:gecko="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/abouthome_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@color/background_normal">
|
||||
|
||||
<LinearLayout android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<LinearLayout android:orientation="vertical"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="0.6"
|
||||
android:layout_marginLeft="@dimen/abouthome_gutter_large"
|
||||
android:layout_marginRight="@dimen/abouthome_gutter_small">
|
||||
|
||||
<org.mozilla.gecko.widget.PromoBox android:id="@+id/promo_box"
|
||||
android:background="@drawable/abouthome_promo_box"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginRight="12dp"
|
||||
android:layout_marginTop="17dp"
|
||||
android:layout_marginBottom="14dp"
|
||||
android:drawablePadding="7dp"
|
||||
android:gravity="center"
|
||||
android:clickable="true"
|
||||
android:textSize="16sp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:visibility="gone"
|
||||
android:focusable="true"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="0.4"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginLeft="@dimen/abouthome_gutter_small"
|
||||
android:layout_marginRight="@dimen/abouthome_gutter_large">
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</org.mozilla.gecko.widget.AboutHomeView>
|
@ -1,36 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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/. -->
|
||||
|
||||
<org.mozilla.gecko.widget.AboutHomeView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:gecko="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/abouthome_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<LinearLayout android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/abouthome_gutter_large"
|
||||
android:paddingRight="@dimen/abouthome_gutter_large">
|
||||
|
||||
<org.mozilla.gecko.widget.PromoBox android:id="@+id/promo_box"
|
||||
android:background="@drawable/abouthome_promo_box"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginRight="12dp"
|
||||
android:layout_marginTop="17dp"
|
||||
android:layout_marginBottom="14dp"
|
||||
android:drawablePadding="7dp"
|
||||
android:gravity="center"
|
||||
android:clickable="true"
|
||||
android:textSize="16sp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:visibility="gone"
|
||||
android:focusable="true"/>
|
||||
</LinearLayout>
|
||||
|
||||
</org.mozilla.gecko.widget.AboutHomeView>
|
@ -1,37 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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/. -->
|
||||
|
||||
<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:background="#34FFFFFF"
|
||||
android:paddingLeft="12dip"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/abouthome_section_title"
|
||||
android:textStyle="bold"
|
||||
android:gravity="left|center_vertical"
|
||||
android:duplicateParentState="true"/>
|
||||
|
||||
<TextView android:id="@+id/subtitle"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="26dip"
|
||||
android:layout_marginTop="1dip"
|
||||
android:background="#34FFFFFF"
|
||||
android:paddingLeft="12dip"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/abouthome_section_subtitle"
|
||||
android:gravity="left|center_vertical"
|
||||
android:duplicateParentState="true"/>
|
||||
|
||||
<LinearLayout android:id="@+id/items_container"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:isScrollContainer="false"
|
||||
android:duplicateParentState="true"/>
|
||||
|
||||
</merge>
|
@ -5,9 +5,6 @@
|
||||
|
||||
<resources>
|
||||
|
||||
<dimen name="abouthome_gutter_small">20dp</dimen>
|
||||
<dimen name="abouthome_gutter_large">40dp</dimen>
|
||||
<dimen name="abouthome_icon_crop">0dp</dimen>
|
||||
<dimen name="browser_toolbar_height">56dp</dimen>
|
||||
<dimen name="remote_tab_child_row_height">56dp</dimen>
|
||||
<dimen name="remote_tab_group_row_height">34dp</dimen>
|
||||
|
@ -31,11 +31,6 @@
|
||||
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="AboutHomeSection">
|
||||
<attr name="title" format="string"/>
|
||||
<attr name="subtitle" format="string"/>
|
||||
</declare-styleable>
|
||||
|
||||
<!-- DoorHangers -->
|
||||
<declare-styleable name="DoorHanger">
|
||||
<attr name="arrowPopupWidth" format="dimension">
|
||||
|
@ -5,12 +5,6 @@
|
||||
|
||||
<resources>
|
||||
|
||||
<dimen name="abouthome_gutter_small">0dp</dimen>
|
||||
<dimen name="abouthome_gutter_large">0dp</dimen>
|
||||
<dimen name="abouthome_icon_crop">-14dp</dimen>
|
||||
<dimen name="abouthome_icon_radius">2dp</dimen>
|
||||
<dimen name="abouthome_rowitem_height">46dip</dimen>
|
||||
<dimen name="abouthome_rowitem_left_padding">12dip</dimen>
|
||||
<dimen name="abouthome_topsite_pinsize">20dp</dimen>
|
||||
<dimen name="autocomplete_min_width">200dp</dimen>
|
||||
<dimen name="autocomplete_row_height">32dp</dimen>
|
||||
|
@ -393,31 +393,12 @@
|
||||
|
||||
<style name="AboutHome.TextAppearance" />
|
||||
|
||||
<style name="AboutHome.TextAppearance.Title" parent="TextAppearance">
|
||||
<item name="android:textColor">@color/abouthome_section_title</item>
|
||||
</style>
|
||||
|
||||
<style name="AboutHome.TextAppearance.SubTitle" parent="TextAppearance.Micro">
|
||||
<item name="android:textColor">@color/abouthome_section_subtitle</item>
|
||||
</style>
|
||||
|
||||
<style name="AboutHome.TextAppearance.Header" parent="TextAppearance.Small">
|
||||
<item name="android:textColor">#ff222222</item>
|
||||
</style>
|
||||
|
||||
<style name="AboutHome.TextAppearance.PageTitle" parent="TextAppearance.Medium" />
|
||||
|
||||
<style name="AboutHome.RowItem">
|
||||
<item name="android:background">@drawable/action_bar_button</item>
|
||||
<item name="android:focusable">true</item>
|
||||
</style>
|
||||
|
||||
<style name="AboutHome.RowItem.TextRow">
|
||||
<item name="android:textAppearance">@style/AboutHome.TextAppearance.Title</item>
|
||||
<item name="android:ellipsize">middle</item>
|
||||
<item name="android:singleLine">true</item>
|
||||
</style>
|
||||
|
||||
<style name="AboutHome.HeaderItem">
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:layout_height">32dp</item>
|
||||
|
@ -236,11 +236,6 @@
|
||||
|
||||
<string name="abouthome_last_tabs_title">&abouthome_last_tabs_title;</string>
|
||||
<string name="abouthome_last_tabs_open">&abouthome_last_tabs_open;</string>
|
||||
<string name="abouthome_about_sync">&abouthome_about_sync3;</string>
|
||||
<string name="abouthome_about_apps">&abouthome_about_apps3;</string>
|
||||
<string name="abouthome_sync_bold_name">&abouthome_sync_bold_name;</string>
|
||||
<string name="abouthome_apps_bold_name">&abouthome_apps_bold_name2;</string>
|
||||
|
||||
<string name="abouthome_visited_empty">&abouthome_visited_empty;</string>
|
||||
|
||||
<string name="filepicker_title">&filepicker_title;</string>
|
||||
|
@ -1,161 +0,0 @@
|
||||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
|
||||
* 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.widget;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import org.mozilla.gecko.GeckoApplication;
|
||||
import org.mozilla.gecko.LightweightTheme;
|
||||
import org.mozilla.gecko.R;
|
||||
import org.mozilla.gecko.ScrollAnimator;
|
||||
import org.mozilla.gecko.db.BrowserContract;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.res.Configuration;
|
||||
import android.database.ContentObserver;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.ContextMenu.ContextMenuInfo;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
public class AboutHome extends Fragment {
|
||||
private UriLoadListener mUriLoadListener;
|
||||
private LoadCompleteListener mLoadCompleteListener;
|
||||
private LightweightTheme mLightweightTheme;
|
||||
private int mTopPadding;
|
||||
private AboutHomeView mAboutHomeView;
|
||||
private ScrollAnimator mScrollAnimator;
|
||||
|
||||
public interface UriLoadListener {
|
||||
public void onAboutHomeUriLoad(String uriSpec);
|
||||
}
|
||||
|
||||
public interface LoadCompleteListener {
|
||||
public void onAboutHomeLoadComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
mLightweightTheme = ((GeckoApplication) getActivity().getApplication()).getLightweightTheme();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
|
||||
try {
|
||||
mUriLoadListener = (UriLoadListener) activity;
|
||||
} catch (ClassCastException e) {
|
||||
throw new ClassCastException(activity.toString()
|
||||
+ " must implement UriLoadListener");
|
||||
}
|
||||
|
||||
try {
|
||||
mLoadCompleteListener = (LoadCompleteListener) activity;
|
||||
} catch (ClassCastException e) {
|
||||
throw new ClassCastException(activity.toString()
|
||||
+ " must implement LoadCompleteListener");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
|
||||
mUriLoadListener = null;
|
||||
mLoadCompleteListener = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
super.onCreateView(inflater, container, savedInstanceState);
|
||||
|
||||
mAboutHomeView = (AboutHomeView) inflater.inflate(R.layout.abouthome_content, container, false);
|
||||
|
||||
mAboutHomeView.setLightweightTheme(mLightweightTheme);
|
||||
mLightweightTheme.addListener(mAboutHomeView);
|
||||
|
||||
// ScrollAnimator implements the View.OnGenericMotionListener
|
||||
// interface, which was added in API level 12.
|
||||
if (Build.VERSION.SDK_INT >= 12) {
|
||||
mScrollAnimator = new ScrollAnimator();
|
||||
mAboutHomeView.setOnGenericMotionListener(mScrollAnimator);
|
||||
}
|
||||
|
||||
return mAboutHomeView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
view.setPadding(0, mTopPadding, 0, 0);
|
||||
((PromoBox) view.findViewById(R.id.promo_box)).showRandomPromo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
mLightweightTheme.removeListener(mAboutHomeView);
|
||||
|
||||
if (mScrollAnimator != null) {
|
||||
mScrollAnimator.cancel();
|
||||
}
|
||||
mScrollAnimator = null;
|
||||
|
||||
mAboutHomeView = null;
|
||||
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
|
||||
// Reattach the fragment, forcing a reinflation of its view.
|
||||
// We use commitAllowingStateLoss() instead of commit() here to avoid
|
||||
// an IllegalStateException. If the phone is rotated while Fennec
|
||||
// is in the background, onConfigurationChanged() is fired.
|
||||
// onConfigurationChanged() is called before onResume(), so
|
||||
// using commit() would throw an IllegalStateException since it can't
|
||||
// be used between the Activity's onSaveInstanceState() and
|
||||
// onResume().
|
||||
if (isVisible()) {
|
||||
getFragmentManager().beginTransaction()
|
||||
.detach(this)
|
||||
.attach(this)
|
||||
.commitAllowingStateLoss();
|
||||
}
|
||||
}
|
||||
|
||||
public void requestFocus() {
|
||||
View view = getView();
|
||||
if (view != null) {
|
||||
view.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
public void setTopPadding(int topPadding) {
|
||||
View view = getView();
|
||||
if (view != null) {
|
||||
view.setPadding(0, topPadding, 0, 0);
|
||||
}
|
||||
|
||||
// If the padding has changed but the view hasn't been created yet,
|
||||
// store the padding values here; they will be used later in
|
||||
// onViewCreated().
|
||||
mTopPadding = topPadding;
|
||||
}
|
||||
|
||||
public int getTopPadding() {
|
||||
return mTopPadding;
|
||||
}
|
||||
}
|
@ -1,85 +0,0 @@
|
||||
/* 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.widget;
|
||||
|
||||
import org.mozilla.gecko.GeckoLinearLayout;
|
||||
import org.mozilla.gecko.R;
|
||||
import org.mozilla.gecko.util.GamepadUtils;
|
||||
import org.mozilla.gecko.widget.Divider;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class AboutHomeSection extends GeckoLinearLayout {
|
||||
private TextView mTitle;
|
||||
private TextView mSubtitle;
|
||||
private LinearLayout mItemsContainer;
|
||||
|
||||
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);
|
||||
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AboutHomeSection);
|
||||
setTitle(a.getText(R.styleable.AboutHomeSection_title));
|
||||
setSubtitle(a.getText(R.styleable.AboutHomeSection_subtitle));
|
||||
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 addItem(View item) {
|
||||
mItemsContainer.addView(item);
|
||||
|
||||
Divider divider = new Divider(getContext(), null);
|
||||
divider.setBackgroundColor(0x3460666E);
|
||||
|
||||
mItemsContainer.addView(divider);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
mItemsContainer.removeAllViews();
|
||||
}
|
||||
|
||||
public void show() {
|
||||
setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
public void hide() {
|
||||
setVisibility(View.GONE);
|
||||
}
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
package org.mozilla.gecko.widget;
|
||||
|
||||
import org.mozilla.gecko.LightweightTheme;
|
||||
import org.mozilla.gecko.LightweightThemeDrawable;
|
||||
import org.mozilla.gecko.R;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.ScrollView;
|
||||
|
||||
public class AboutHomeView extends ScrollView implements LightweightTheme.OnChangeListener {
|
||||
private LightweightTheme mLightweightTheme;
|
||||
|
||||
public AboutHomeView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public AboutHomeView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public AboutHomeView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
}
|
||||
|
||||
public void setLightweightTheme(LightweightTheme theme) {
|
||||
mLightweightTheme = theme;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLightweightThemeChanged() {
|
||||
if (mLightweightTheme == null) {
|
||||
throw new IllegalStateException("setLightweightTheme() must be called before this view can listen to theme changes.");
|
||||
}
|
||||
|
||||
LightweightThemeDrawable drawable = mLightweightTheme.getColorDrawable(this);
|
||||
if (drawable == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
drawable.setAlpha(255, 0);
|
||||
setBackgroundDrawable(drawable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLightweightThemeReset() {
|
||||
setBackgroundColor(getResources().getColor(R.color.background_normal));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||
super.onLayout(changed, l, t, r, b);
|
||||
onLightweightThemeChanged();
|
||||
}
|
||||
}
|
@ -1,195 +0,0 @@
|
||||
/* 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.widget;
|
||||
|
||||
import org.mozilla.gecko.R;
|
||||
import org.mozilla.gecko.Tabs;
|
||||
import org.mozilla.gecko.db.BrowserDB;
|
||||
import org.mozilla.gecko.sync.setup.SyncAccounts;
|
||||
import org.mozilla.gecko.sync.setup.activities.SetupSyncActivity;
|
||||
import org.mozilla.gecko.util.ThreadUtils;
|
||||
import org.mozilla.gecko.util.UiAsyncTask;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.accounts.OnAccountsUpdateListener;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.SpannableString;
|
||||
import android.text.style.StyleSpan;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* A promotional box for the about:home page. The layout contains an ImageView to the left of a
|
||||
* TextView whose resources may be overidden to display custom values for a new type of promo box.
|
||||
* To do this, add a new Type value and update show() to call setResources() for your values -
|
||||
* including a set[Box Type]Resources() helper method is recommended.
|
||||
*/
|
||||
public class PromoBox extends TextView implements View.OnClickListener {
|
||||
private static final String LOGTAG = "GeckoAboutHomePromoBox";
|
||||
|
||||
/* Small class for implementing a new promo box type. Implementors should override canShow and onClick
|
||||
* to handle their own needs. By default the box is always showable and does nothing when clicked.
|
||||
*/
|
||||
public static class Type {
|
||||
public int text;
|
||||
public int boldText;
|
||||
public int image;
|
||||
public Type(int aText, int aBoldText, int aImage) {
|
||||
text = aText;
|
||||
boldText = aBoldText;
|
||||
image = aImage;
|
||||
}
|
||||
public boolean canShow() {
|
||||
return true;
|
||||
}
|
||||
public void onClick(View v) { }
|
||||
public void onDestroy() { }
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
for (Type type : mTypes) {
|
||||
type.onDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
private class SyncType extends Type {
|
||||
private OnAccountsUpdateListener mAccountListener;
|
||||
public SyncType(int aText, int aBoldText, int aImage) {
|
||||
super(aText, aBoldText, aImage);
|
||||
// The listener will run on the background thread (see 2nd argument)
|
||||
mAccountListener = new OnAccountsUpdateListener() {
|
||||
@Override
|
||||
public void onAccountsUpdated(Account[] accounts) {
|
||||
showRandomPromo();
|
||||
}
|
||||
};
|
||||
AccountManager.get(mContext).addOnAccountsUpdatedListener(mAccountListener, ThreadUtils.getBackgroundHandler(), false);
|
||||
}
|
||||
@Override
|
||||
public boolean canShow() {
|
||||
return !SyncAccounts.syncAccountsExist(mContext);
|
||||
}
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
final Context context = v.getContext();
|
||||
final Intent intent = new Intent(context, SetupSyncActivity.class);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (mAccountListener != null) {
|
||||
AccountManager.get(mContext).removeOnAccountsUpdatedListener(mAccountListener);
|
||||
mAccountListener = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int sTypeIndex = -1;
|
||||
private ArrayList<Type> mTypes;
|
||||
private Type mType;
|
||||
|
||||
private final Context mContext;
|
||||
|
||||
public PromoBox(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
mContext = context;
|
||||
setOnClickListener(this);
|
||||
|
||||
mTypes = new ArrayList<Type>();
|
||||
mTypes.add(new SyncType(R.string.abouthome_about_sync,
|
||||
R.string.abouthome_sync_bold_name,
|
||||
R.drawable.abouthome_promo_logo_sync));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mType != null)
|
||||
mType.onClick(v);
|
||||
}
|
||||
|
||||
private interface GetTypesCallback {
|
||||
void onGotTypes(ArrayList<Type> types);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the specified promo box. If a promo box is already active, it will be overidden with a
|
||||
* promo box of the specified type.
|
||||
*/
|
||||
public void showRandomPromo() {
|
||||
getAvailableTypes(new GetTypesCallback() {
|
||||
@Override
|
||||
public void onGotTypes(ArrayList<Type> types) {
|
||||
if (types.size() == 0) {
|
||||
hide();
|
||||
return;
|
||||
}
|
||||
|
||||
// Try to maintain a promo type for the lifetime of the application
|
||||
if (PromoBox.sTypeIndex == -1 || PromoBox.sTypeIndex >= types.size()) {
|
||||
PromoBox.sTypeIndex = new Random().nextInt(types.size());
|
||||
}
|
||||
mType = types.get(PromoBox.sTypeIndex);
|
||||
|
||||
updateViewResources();
|
||||
setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void hide() {
|
||||
setVisibility(View.GONE);
|
||||
mType = null;
|
||||
}
|
||||
|
||||
private void updateViewResources() {
|
||||
updateTextViewResources();
|
||||
setCompoundDrawablesWithIntrinsicBounds(mType.image, 0, 0, 0);
|
||||
}
|
||||
|
||||
private void updateTextViewResources() {
|
||||
final String text = mContext.getResources().getString(mType.text);
|
||||
final String boldText = mContext.getResources().getString(mType.boldText);
|
||||
final int styleIndex = text.indexOf(boldText);
|
||||
if (styleIndex < 0)
|
||||
setText(text);
|
||||
else {
|
||||
final SpannableString spannableText = new SpannableString(text);
|
||||
spannableText.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), styleIndex, styleIndex + boldText.length(), 0);
|
||||
setText(spannableText, TextView.BufferType.SPANNABLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void getAvailableTypes(final GetTypesCallback callback) {
|
||||
(new UiAsyncTask<Void, Void, ArrayList<Type>>(ThreadUtils.getBackgroundHandler()) {
|
||||
@Override
|
||||
public ArrayList<Type> doInBackground(Void... params) {
|
||||
// Run all of this on a background thread
|
||||
ArrayList<Type> availTypes = new ArrayList<Type>();
|
||||
for (int i = 0; i < mTypes.size(); i++) {
|
||||
Type t = mTypes.get(i);
|
||||
if (t.canShow()) {
|
||||
availTypes.add(t);
|
||||
}
|
||||
}
|
||||
return availTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostExecute(ArrayList<Type> types) {
|
||||
callback.onGotTypes(types);
|
||||
}
|
||||
}).execute();
|
||||
}
|
||||
}
|