Prevent scrolling after the homepage recreating

- Only apply the layout transition when contextual home is enabled
- Do not scroll for highlighting when the homepage is recreated and
  never scrolled

Fix: 222238012
Bug: 222473415
Test: robotest, manual
Change-Id: I490c3f8dbca63a5250bae01555592b7795c90af2
This commit is contained in:
Jason Chiu
2022-03-09 14:46:51 +08:00
parent a92e6d8987
commit 764e7fbc44
4 changed files with 28 additions and 12 deletions

View File

@@ -182,6 +182,8 @@ public class SettingsHomepageActivity extends FragmentActivity implements
showSuggestionFragment(scrollNeeded);
if (FeatureFlagUtils.isEnabled(this, FeatureFlags.CONTEXTUAL_HOME)) {
showFragment(() -> new ContextualCardsFragment(), R.id.contextual_cards_content);
((FrameLayout) findViewById(R.id.main_content))
.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
}
}
mMainFragment = showFragment(() -> {
@@ -191,9 +193,6 @@ public class SettingsHomepageActivity extends FragmentActivity implements
return fragment;
}, R.id.main_content);
((FrameLayout) findViewById(R.id.main_content))
.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
// Launch the intent from deep link for large screen devices.
launchDeepLinkIntentToRight();
}