Backed out changeset e979b2ee0d42
authorChenxia Liu <liuche@mozilla.com>
Tue, 06 Aug 2013 18:06:33 -0700
changeset 143502 bcda9a677aec73fb6c733acbda717caf345a5c83
parent 143501 e979b2ee0d42b888050a4793d5501ac31493cef2
child 143503 97996b685d4f18db145ce8e1de23dec03dbb4d86
push id25130
push userlrocha@mozilla.com
push dateWed, 21 Aug 2013 09:41:27 +0000
treeherdermozilla-central@b2486721572e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone25.0a1
backs oute979b2ee0d42b888050a4793d5501ac31493cef2
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset e979b2ee0d42
mobile/android/base/Makefile.in
mobile/android/base/home/MostRecentPage.java
mobile/android/base/home/MostVisitedPage.java
mobile/android/base/locales/en-US/android_strings.dtd
mobile/android/base/resources/drawable-hdpi/icon_most_recent_empty.png
mobile/android/base/resources/drawable-mdpi/icon_most_recent_empty.png
mobile/android/base/resources/drawable-xhdpi/icon_most_recent_empty.png
mobile/android/base/resources/layout/home_list_with_title.xml
mobile/android/base/resources/values-v16/styles.xml
mobile/android/base/resources/values/styles.xml
mobile/android/base/strings.xml.in
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -632,17 +632,16 @@ RES_DRAWABLE_MDPI = \
   res/drawable-mdpi/ic_menu_new_tab.png \
   res/drawable-mdpi/ic_menu_reload.png \
   res/drawable-mdpi/ic_status_logo.png \
   res/drawable-mdpi/ic_url_bar_go.png \
   res/drawable-mdpi/ic_url_bar_reader.png \
   res/drawable-mdpi/ic_url_bar_search.png \
   res/drawable-mdpi/ic_url_bar_star.png \
   res/drawable-mdpi/ic_url_bar_tab.png \
-  res/drawable-mdpi/icon_most_recent_empty.png \
   res/drawable-mdpi/icon_last_tabs.png \
   res/drawable-mdpi/icon_most_recent.png \
   res/drawable-mdpi/icon_most_visited.png \
   res/drawable-mdpi/icon_pageaction.png \
   res/drawable-mdpi/progress_spinner_1.png \
   res/drawable-mdpi/progress_spinner_2.png \
   res/drawable-mdpi/progress_spinner_3.png \
   res/drawable-mdpi/progress_spinner_4.png \
@@ -749,17 +748,16 @@ RES_DRAWABLE_HDPI = \
   res/drawable-hdpi/ic_menu_new_tab.png \
   res/drawable-hdpi/ic_menu_reload.png \
   res/drawable-hdpi/ic_status_logo.png \
   res/drawable-hdpi/ic_url_bar_go.png \
   res/drawable-hdpi/ic_url_bar_reader.png \
   res/drawable-hdpi/ic_url_bar_search.png \
   res/drawable-hdpi/ic_url_bar_star.png \
   res/drawable-hdpi/ic_url_bar_tab.png \
-  res/drawable-hdpi/icon_most_recent_empty.png \
   res/drawable-hdpi/icon_last_tabs.png \
   res/drawable-hdpi/icon_most_recent.png \
   res/drawable-hdpi/icon_most_visited.png \
   res/drawable-hdpi/icon_pageaction.png \
   res/drawable-hdpi/tab_indicator_divider.9.png \
   res/drawable-hdpi/tab_indicator_selected.9.png \
   res/drawable-hdpi/tab_indicator_selected_focused.9.png \
   res/drawable-hdpi/spinner_default.9.png \
@@ -842,17 +840,16 @@ RES_DRAWABLE_XHDPI = \
   res/drawable-xhdpi/ic_menu_new_tab.png \
   res/drawable-xhdpi/ic_menu_reload.png \
   res/drawable-xhdpi/ic_status_logo.png \
   res/drawable-xhdpi/ic_url_bar_go.png \
   res/drawable-xhdpi/ic_url_bar_reader.png \
   res/drawable-xhdpi/ic_url_bar_search.png \
   res/drawable-xhdpi/ic_url_bar_star.png \
   res/drawable-xhdpi/ic_url_bar_tab.png \
-  res/drawable-xhdpi/icon_most_recent_empty.png \
   res/drawable-xhdpi/icon_last_tabs.png \
   res/drawable-xhdpi/icon_most_recent.png \
   res/drawable-xhdpi/icon_most_visited.png \
   res/drawable-xhdpi/icon_pageaction.png \
   res/drawable-xhdpi/spinner_default.9.png \
   res/drawable-xhdpi/spinner_focused.9.png \
   res/drawable-xhdpi/spinner_pressed.9.png \
   res/drawable-xhdpi/tab_new.png \
--- a/mobile/android/base/home/MostRecentPage.java
+++ b/mobile/android/base/home/MostRecentPage.java
@@ -19,17 +19,16 @@ import android.os.Bundle;
 import android.support.v4.app.LoaderManager;
 import android.support.v4.content.Loader;
 import android.support.v4.widget.SimpleCursorAdapter;
 import android.util.SparseArray;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.LayoutInflater;
 import android.widget.AdapterView;
-import android.widget.ImageView;
 import android.widget.ListView;
 import android.widget.TextView;
 
 import java.util.Date;
 
 /**
  * Fragment that displays recent history in a ListView.
  */
@@ -41,18 +40,16 @@ public class MostRecentPage extends Home
     private static final int LOADER_ID_HISTORY = 0;
 
     // Adapter for the list of search results
     private MostRecentAdapter mAdapter;
 
     // The view shown by the fragment.
     private ListView mList;
 
-    private View emptyView;
-
     // Callbacks used for the search and favicon cursor loaders
     private CursorLoaderCallbacks mCursorLoaderCallbacks;
 
     // On URL open listener
     private OnUrlOpenListener mUrlOpenListener;
 
     public static MostRecentPage newInstance() {
         return new MostRecentPage();
@@ -101,24 +98,16 @@ public class MostRecentPage extends Home
                     return;
                 }
 
                 final String url = c.getString(c.getColumnIndexOrThrow(URLColumns.URL));
                 mUrlOpenListener.onUrlOpen(url);
             }
         });
 
-        // Set empty page view.
-        if (emptyView == null) {
-            emptyView = view.findViewById(R.id.home_empty_view);
-            ((ImageView) emptyView.findViewById(R.id.home_empty_image)).setImageResource(R.drawable.icon_most_recent_empty);
-            ((TextView) emptyView.findViewById(R.id.home_empty_text)).setText(R.string.home_most_recent_empty);
-            mList.setEmptyView(emptyView);
-        }
-
         registerForContextMenu(mList);
     }
 
     @Override
     public void onDestroyView() {
         super.onDestroyView();
         mList = null;
     }
--- a/mobile/android/base/home/MostVisitedPage.java
+++ b/mobile/android/base/home/MostVisitedPage.java
@@ -36,16 +36,19 @@ public class MostVisitedPage extends Hom
     private static final int LOADER_ID_FRECENCY = 0;
 
     // Adapter for the list of search results
     private VisitedAdapter mAdapter;
 
     // The view shown by the fragment.
     private ListView mList;
 
+    // Empty message view
+    private View mEmptyMessage;
+
     // Callbacks used for the search and favicon cursor loaders
     private CursorLoaderCallbacks mCursorLoaderCallbacks;
 
     // On URL open listener
     private OnUrlOpenListener mUrlOpenListener;
 
     public static MostVisitedPage newInstance() {
         return new MostVisitedPage();
@@ -79,16 +82,17 @@ public class MostVisitedPage extends Hom
         return inflater.inflate(R.layout.home_most_visited_page, container, false);
     }
 
     @Override
     public void onViewCreated(View view, Bundle savedInstanceState) {
         final TextView title = (TextView) view.findViewById(R.id.title);
         title.setText(R.string.home_most_visited_title);
 
+        mEmptyMessage = view.findViewById(R.id.empty_message);
         mList = (HomeListView) view.findViewById(R.id.list);
 
         mList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
             @Override
             public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                 final Cursor c = mAdapter.getCursor();
                 if (c == null || !c.moveToPosition(position)) {
                     return;
@@ -101,16 +105,17 @@ public class MostVisitedPage extends Hom
 
         registerForContextMenu(mList);
     }
 
     @Override
     public void onDestroyView() {
         super.onDestroyView();
         mList = null;
+        mEmptyMessage = null;
     }
 
     @Override
     public void onActivityCreated(Bundle savedInstanceState) {
         super.onActivityCreated(savedInstanceState);
 
         final Activity activity = getActivity();
 
@@ -172,16 +177,20 @@ public class MostVisitedPage extends Hom
             } else {
                 return super.onCreateLoader(id, args);
             }
         }
 
         @Override
         public void onLoadFinished(Loader<Cursor> loader, Cursor c) {
             if (loader.getId() == LOADER_ID_FRECENCY) {
+                // Only set empty view once cursor is loaded to avoid
+                // flashing the empty message before loading.
+                mList.setEmptyView(mEmptyMessage);
+
                 mAdapter.swapCursor(c);
                 loadFavicons(c);
             } else {
                 super.onLoadFinished(loader, c);
             }
         }
 
         @Override
--- a/mobile/android/base/locales/en-US/android_strings.dtd
+++ b/mobile/android/base/locales/en-US/android_strings.dtd
@@ -260,18 +260,18 @@ size. -->
 <!ENTITY button_clear_data "Clear data">
 <!ENTITY button_set "Set">
 <!ENTITY button_clear "Clear">
 
 <!ENTITY home_history_title "History">
 <!ENTITY home_last_tabs_title "Tabs from last time">
 <!ENTITY home_last_tabs_open "Open all tabs from last time">
 <!ENTITY home_most_recent_title "Most recent">
-<!ENTITY home_most_recent_empty "Websites you visited most recently show up here.">
 <!ENTITY home_most_visited_title "Most visited">
+<!ENTITY home_visited_empty "Websites you visited go here">
 <!ENTITY pin_bookmark_dialog_hint "Enter a search keyword">
 
 <!ENTITY filepicker_title "Choose File">
 <!ENTITY filepicker_audio_title "Choose or record a sound">
 <!ENTITY filepicker_image_title "Choose or take a picture">
 <!ENTITY filepicker_video_title "Choose or record a video">
 
 <!-- Site identity popup -->
deleted file mode 100644
index 3259ebcb9e913af3c3f1816bc018dcc804076b68..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 918a0546298bc8532630426c6188d7f65d0d8ae0..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index cc0361c13c1bed9577be2f0a7f25659b9fac51e3..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
--- a/mobile/android/base/resources/layout/home_list_with_title.xml
+++ b/mobile/android/base/resources/layout/home_list_with_title.xml
@@ -1,37 +1,21 @@
 <?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">
 
-    <LinearLayout android:id="@+id/home_empty_view"
-                  android:layout_width="fill_parent"
-                  android:layout_height="fill_parent"
-                  android:orientation="vertical"
-                  android:gravity="center"
-                  android:paddingLeft="50dp"
-                  android:paddingRight="50dp"
-                  android:visibility="gone">
-
-        <ImageView android:id="@+id/home_empty_image"
-                   android:layout_width="wrap_content"
-                   android:layout_height="wrap_content"
-                   android:paddingBottom="15dp"
-                   android:scaleType="fitXY"/>
-
-        <TextView android:id="@+id/home_empty_text"
-                  android:layout_width="fill_parent"
-                  android:layout_height="wrap_content"
-                  android:gravity="center"
-                  android:textAppearance="@style/TextAppearance.EmptyMessage"/>
-
-    </LinearLayout>
+    <TextView android:id="@+id/empty_message"
+              style="@style/Widget.Home.EmptyMessage"
+              android:layout_width="fill_parent"
+              android:layout_height="fill_parent"
+              android:text="@string/home_visited_empty"
+              android:visibility="gone"/>
 
     <TextView android:id="@+id/title"
               style="@style/Widget.Home.PageTitle"/>
 
     <org.mozilla.gecko.home.HomeListView
             android:id="@+id/list"
             android:layout_width="fill_parent"
             android:layout_height="0dp"
--- a/mobile/android/base/resources/values-v16/styles.xml
+++ b/mobile/android/base/resources/values-v16/styles.xml
@@ -1,19 +1,15 @@
 <?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/. -->
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android">
 
-    <style name="TextAppearance.EmptyMessage" parent="TextAppearance.Large">
-        <item name="android:fontFamily">sans-serif-light</item>
-    </style>
-
     <style name="TextAppearance.Widget.TwoLinePageRow.Title" parent="TextAppearance.Medium">
         <item name="android:fontFamily">sans-serif-light</item>
     </style>
 
     <style name="TextAppearance.Widget.Home.PageTitle" parent="TextAppearance.Medium">
         <item name="android:fontFamily">sans-serif-light</item>
     </style>
 
--- a/mobile/android/base/resources/values/styles.xml
+++ b/mobile/android/base/resources/values/styles.xml
@@ -161,16 +161,24 @@
         <item name="android:textAppearance">@style/TextAppearance.Widget.Home.Header</item>
         <item name="android:background">#fff5f7f9</item>
         <item name="android:focusable">false</item>
         <item name="android:gravity">center|left</item>
         <item name="android:paddingLeft">10dip</item>
         <item name="android:paddingRight">10dip</item>
     </style>
 
+    <style name="Widget.Home.EmptyMessage">
+        <item name="android:textAppearance">@style/TextAppearance.Widget.Home.PageTitle</item>
+        <item name="android:gravity">center</item>
+        <item name="android:focusable">false</item>
+        <item name="android:paddingLeft">10dip</item>
+        <item name="android:paddingRight">10dip</item>
+    </style>
+
     <style name="Widget.Home.PageButton">
         <item name="android:layout_width">fill_parent</item>
         <item name="android:layout_height">40dip</item>
         <item name="android:textAppearance">@style/TextAppearance.Widget.Home.PageTitle</item>
         <item name="android:background">@drawable/action_bar_button</item>
         <item name="android:focusable">true</item>
         <item name="android:gravity">center|left</item>
         <item name="android:paddingLeft">10dip</item>
@@ -245,18 +253,16 @@
 
     <style name="TextAppearance.Small.Inverse">
         <item name="android:textColor">?android:attr/textColorSecondaryInverse</item>
         <item name="android:textColorHint">?android:attr/textColorHintInverse</item>
         <item name="android:textColorHighlight">@color/text_color_highlight_inverse</item>
         <item name="android:textColorLink">?android:attr/textColorLink</item>
     </style>
 
-    <style name="TextAppearance.EmptyMessage" parent="TextAppearance.Large"/>
-
     <style name="TextAppearance.Micro">
         <item name="android:textSize">12sp</item>
         <item name="android:textColor">?android:attr/textColorTertiary</item>
     </style>
 
     <style name="TextAppearance.Micro.Inverse">
         <item name="android:textColor">?android:attr/textColorTertiaryInverse</item>
         <item name="android:textColorHint">?android:attr/textColorHintInverse</item>
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -242,18 +242,18 @@
   <string name="button_clear">&button_clear;</string>
   <string name="button_yes">&button_yes;</string>
   <string name="button_no">&button_no;</string>
 
   <string name="home_history_title">&home_history_title;</string>
   <string name="home_last_tabs_title">&home_last_tabs_title;</string>
   <string name="home_last_tabs_open">&home_last_tabs_open;</string>
   <string name="home_most_recent_title">&home_most_recent_title;</string>
-  <string name="home_most_recent_empty">&home_most_recent_empty;</string>
   <string name="home_most_visited_title">&home_most_visited_title;</string>
+  <string name="home_visited_empty">&home_visited_empty;</string>
   <string name="pin_bookmark_dialog_hint">&pin_bookmark_dialog_hint;</string>
 
   <string name="filepicker_title">&filepicker_title;</string>
   <string name="filepicker_audio_title">&filepicker_audio_title;</string>
   <string name="filepicker_image_title">&filepicker_image_title;</string>
   <string name="filepicker_video_title">&filepicker_video_title;</string>
 
   <!-- Default bookmarks. Use bookmarks titles shared with XUL from mobile's