Bug 1332955 - Consider restore data( for bookmark parent stack) when reloading home panels. r=ahunt
MozReview-Commit-ID: 7m6HOnfPLK3
--- 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() {