Bug 780367 - AboutHomeContent should no longer have two views. r=sriram a=lsblakk
authorMichael Comella <michael.l.comella@gmail.com>
Mon, 06 Aug 2012 20:27:04 -0400
changeset 100516 d6cbf07e54edc1c357aa83c2b7684f9510fc7fb3
parent 100515 cc3973e2be29b4c87e4720d343f018b7e9e9c91f
child 100517 123f0b08a7ac3c1998fe166484647e8d18f25ada
push idunknown
push userunknown
push dateunknown
reviewerssriram, lsblakk
bugs780367
milestone15.0
Bug 780367 - AboutHomeContent should no longer have two views. r=sriram a=lsblakk
mobile/android/base/AboutHomeContent.java
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/AboutHomeContent.java
+++ b/mobile/android/base/AboutHomeContent.java
@@ -327,27 +327,27 @@ public class AboutHomeContent extends Sc
         update(activity, EnumSet.of(UpdateFlags.TOP_SITES));
     }
 
     private void setTopSitesConstants() {
         mNumberOfTopSites = getResources().getInteger(R.integer.number_of_top_sites);
         mNumberOfCols = getResources().getInteger(R.integer.number_of_top_sites_cols);
     }
 
-    @Override
-    public void onConfigurationChanged(Configuration newConfig) {
+    /**
+     * Reinflates and updates all components of this view.
+     */
+    public void refresh() {
         if (mTopSitesAdapter != null)
             mTopSitesAdapter.notifyDataSetChanged();
 
         removeAllViews(); // We must remove the currently inflated view to allow for reinflation.
         inflate();
         mTopSitesGrid.setAdapter(mTopSitesAdapter); // mTopSitesGrid is a new instance (from loadTopSites()).
         update(GeckoApp.mAppContext, AboutHomeContent.UpdateFlags.ALL); // Refresh all elements.
-
-        super.onConfigurationChanged(newConfig);
     }
 
     @Override
     public boolean onInterceptTouchEvent(MotionEvent event) {
         if (mOnInterceptTouchListener != null && mOnInterceptTouchListener.onInterceptTouchEvent(this, event))
             return true;
         return super.onInterceptTouchEvent(event);
     }
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -293,16 +293,19 @@ abstract public class BrowserApp extends
             LinearLayout actionBar = (LinearLayout) getBrowserToolbar();
             mMainLayout.addView(actionBar, index);
             mBrowserToolbar.from(actionBar);
             mBrowserToolbar.refresh();
         }
 
         invalidateOptionsMenu();
         mTabsPanel.refresh();
+
+        if (mAboutHomeContent != null)
+            mAboutHomeContent.refresh();
     }
 
     @Override
     public boolean isBrowserToolbarSupported() {
         return true;
     }
 
     @Override