Bug 919704 - Remove empty screen for Top Sites. r=sriram a=lsblakk
authorChenxia Liu <liuche@mozilla.com>
Mon, 21 Oct 2013 22:31:54 -0700
changeset 155868 92d60b740d289dfacda9b41a75e4155570aebdab
parent 155867 7453a764f9a91bda79a50f22d9656eae24c74af1
child 155869 9c524d4d834a6a5d4f297389d62711e9b11825af
push id4454
push usersramasubramanian@mozilla.com
push dateTue, 22 Oct 2013 05:36:10 +0000
treeherdermozilla-aurora@1cb44a39126e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssriram, lsblakk
bugs919704
milestone26.0a2
Bug 919704 - Remove empty screen for Top Sites. r=sriram a=lsblakk
mobile/android/base/Makefile.in
mobile/android/base/home/TopSitesPage.java
mobile/android/base/resources/drawable-hdpi/icon_most_visited_empty.png
mobile/android/base/resources/drawable-mdpi/icon_most_visited_empty.png
mobile/android/base/resources/drawable-xhdpi/icon_most_visited_empty.png
mobile/android/base/resources/layout/home_top_sites_page.xml
mobile/android/base/strings.xml.in
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -661,17 +661,16 @@ RES_DRAWABLE_MDPI = \
   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_last_tabs.png \
   res/drawable-mdpi/icon_last_tabs_empty.png \
   res/drawable-mdpi/icon_most_recent.png \
   res/drawable-mdpi/icon_most_recent_empty.png \
   res/drawable-mdpi/icon_most_visited.png \
-  res/drawable-mdpi/icon_most_visited_empty.png \
   res/drawable-mdpi/icon_openinapp.png \
   res/drawable-mdpi/icon_pageaction.png \
   res/drawable-mdpi/icon_reading_list_empty.png \
   res/drawable-mdpi/progress_spinner.png \
   res/drawable-mdpi/tab_indicator_divider.9.png \
   res/drawable-mdpi/tab_indicator_selected.9.png \
   res/drawable-mdpi/tab_indicator_selected_focused.9.png \
   res/drawable-mdpi/spinner_default.9.png \
@@ -775,17 +774,16 @@ RES_DRAWABLE_HDPI = \
   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_last_tabs.png \
   res/drawable-hdpi/icon_last_tabs_empty.png \
   res/drawable-hdpi/icon_most_recent.png \
   res/drawable-hdpi/icon_most_recent_empty.png \
   res/drawable-hdpi/icon_most_visited.png \
-  res/drawable-hdpi/icon_most_visited_empty.png \
   res/drawable-hdpi/icon_openinapp.png \
   res/drawable-hdpi/icon_pageaction.png \
   res/drawable-hdpi/icon_reading_list_empty.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 \
   res/drawable-hdpi/spinner_focused.9.png \
@@ -875,17 +873,16 @@ RES_DRAWABLE_XHDPI = \
   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_last_tabs.png \
   res/drawable-xhdpi/icon_last_tabs_empty.png \
   res/drawable-xhdpi/icon_most_recent.png \
   res/drawable-xhdpi/icon_most_recent_empty.png \
   res/drawable-xhdpi/icon_most_visited.png \
-  res/drawable-xhdpi/icon_most_visited_empty.png \
   res/drawable-xhdpi/icon_openinapp.png \
   res/drawable-xhdpi/icon_pageaction.png \
   res/drawable-xhdpi/icon_reading_list_empty.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 \
   res/drawable-xhdpi/tab_new_pb.png \
--- a/mobile/android/base/home/TopSitesPage.java
+++ b/mobile/android/base/home/TopSitesPage.java
@@ -43,21 +43,18 @@ import android.view.ContextMenu;
 import android.view.ContextMenu.ContextMenuInfo;
 import android.view.LayoutInflater;
 import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.View.OnTouchListener;
 import android.view.ViewGroup;
-import android.view.ViewStub;
 import android.widget.AdapterView;
-import android.widget.ImageView;
 import android.widget.ListView;
-import android.widget.TextView;
 import android.widget.Toast;
 
 import java.util.EnumSet;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
 
 /**
@@ -83,19 +80,16 @@ public class TopSitesPage extends HomeFr
     private TopSitesGridAdapter mGridAdapter;
 
     // List of top sites
     private ListView mList;
 
     // Grid of top sites
     private TopSitesGridView mGrid;
 
-    // Reference to the View to display when there are no results.
-    private View mEmptyView;
-
     // Banner to show snippets.
     private HomeBanner mBanner;
 
     // Raw Y value of the last event that happened on the list view.
     private float mListTouchY = -1;
 
     // Scrolling direction of the banner.
     private boolean mSnapBannerToTop;
@@ -223,17 +217,16 @@ public class TopSitesPage extends HomeFr
         });
     }
 
     @Override
     public void onDestroyView() {
         super.onDestroyView();
         mList = null;
         mGrid = null;
-        mEmptyView = null;
         mListAdapter = null;
         mGridAdapter = null;
     }
 
     @Override
     public void onConfigurationChanged(Configuration newConfig) {
         super.onConfigurationChanged(newConfig);
 
@@ -486,30 +479,16 @@ public class TopSitesPage extends HomeFr
     }
 
     private void updateUiFromCursor(Cursor c) {
         mList.setHeaderDividersEnabled(c != null && c.getCount() > mMaxGridEntries);
 
         if (c != null && c.getCount() > 0) {
             return;
         }
-
-        if (mEmptyView == null) {
-            // Set empty page view. We delay this so that the empty view won't flash.
-            ViewStub emptyViewStub = (ViewStub) getView().findViewById(R.id.home_empty_view_stub);
-            mEmptyView = emptyViewStub.inflate();
-
-            final ImageView emptyIcon = (ImageView) mEmptyView.findViewById(R.id.home_empty_image);
-            emptyIcon.setImageResource(R.drawable.icon_most_visited_empty);
-
-            final TextView emptyText = (TextView) mEmptyView.findViewById(R.id.home_empty_text);
-            emptyText.setText(R.string.home_most_visited_empty);
-
-            mList.setEmptyView(mEmptyView);
-        }
     }
 
     private static class TopSitesLoader extends SimpleCursorLoader {
         // Max number of search results
         private static final int SEARCH_LIMIT = 30;
         private int mMaxGridEntries;
 
         public TopSitesLoader(Context context) {
deleted file mode 100644
index 93f5bf2d0ddb74d232252088c59837e6dc682216..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index bb2881758447ac8832eae19d1a7dd3b739f1d020..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 4182b7e4c36a5b6b66880d180ec11ff825601484..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
--- a/mobile/android/base/resources/layout/home_top_sites_page.xml
+++ b/mobile/android/base/resources/layout/home_top_sites_page.xml
@@ -3,21 +3,16 @@
    - 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/. -->
 
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
               android:layout_width="fill_parent"
               android:layout_height="fill_parent"
               android:orientation="vertical">
 
-    <ViewStub android:id="@+id/home_empty_view_stub"
-              android:layout="@layout/home_empty_page"
-              android:layout_width="fill_parent"
-              android:layout_height="fill_parent"/>
-
     <org.mozilla.gecko.home.HomeListView
             android:id="@+id/list"
             style="@style/Widget.TopSitesListView"
             android:layout_width="fill_parent"
             android:layout_height="0dp"
             android:layout_weight="1"/>
 
     <org.mozilla.gecko.home.HomeBanner android:id="@+id/home_banner"
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -255,18 +255,16 @@
   <string name="home_top_sites_title">&home_top_sites_title;</string>
   <string name="home_top_sites_add">&home_top_sites_add;</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_last_tabs_empty">&home_last_tabs_empty;</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_most_visited_empty">&home_most_visited_empty;</string>
   <string name="home_reading_list_empty">&home_reading_list_empty;</string>
   <string name="home_reading_list_hint">&home_reading_list_hint;</string>
   <string name="home_reading_list_hint_accessible">&home_reading_list_hint_accessible;</string>
   <string name="pin_site_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>