Bug 1332955 - Consider restore data( for bookmark parent stack) when reloading home panels. r=ahunt
authorNevin Chen <cnevinchen@gmail.com>
Wed, 25 Jan 2017 12:10:55 +0800
changeset 479876 8ff3ef5e885add7d13f43ee2d4b346fc7f3dff34
parent 479875 ec252adeb5c3445683f98a08205b3b717dad92d5
child 479877 a5d6cf0d1c82209d653289a795cba8dab50fa687
push id44393
push userVYV03354@nifty.ne.jp
push dateTue, 07 Feb 2017 13:53:48 +0000
reviewersahunt
bugs1332955
milestone54.0a1
Bug 1332955 - Consider restore data( for bookmark parent stack) when reloading home panels. r=ahunt MozReview-Commit-ID: 7m6HOnfPLK3
mobile/android/base/java/org/mozilla/gecko/home/HomePager.java
--- a/mobile/android/base/java/org/mozilla/gecko/home/HomePager.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/HomePager.java
@@ -220,18 +220,19 @@ public class HomePager extends ViewPager
         adapter.setPanelStateChangeListener(mPanelStateChangeListener);
         adapter.setCanLoadHint(true);
         setAdapter(adapter);
 
         // Don't show the tabs strip until we have the
         // list of panels in place.
         mTabStrip.setVisibility(View.INVISIBLE);
 
-        // If HomeConfigLoader already exist, force load to select the current item
-        if (lm.getLoader(LOADER_ID_CONFIG) != null) {
+        // If HomeConfigLoader already exist and there's no restoreData(for bookmark's parentStack),
+        // call forceLoad() to trigger updateUiFromConfigState() and reset HomePager's adapter.
+        if (lm.getLoader(LOADER_ID_CONFIG) != null && restoreData == null) {
             lm.getLoader(LOADER_ID_CONFIG).forceLoad();
         } else {
             // Load list of panels from configuration
             lm.initLoader(LOADER_ID_CONFIG, null, mConfigLoaderCallbacks);
         }
 
         if (shouldAnimate) {
             animator.addPropertyAnimationListener(new PropertyAnimator.PropertyAnimationListener() {