Revise homepage highlight mechanism

- Create TopLevelHighlightMixin to handle highlight actions and simplify
  TopLevelSettings
- Fix the error highlight and the flicker after screen rotation
- Postpone creating the fragment until it's needed to accelerate the
  initialization and to fix the search highlight function breakage after
  toggling light/dark mode
- Register activity embedding rules only once for injection and
  wallpaper
- Do not highlight Tips & support since it's full screen
- Refactor ActivityEmbeddingRulesController

Bug: 207316936
Test: manual, robotest build pass
Change-Id: If322ec180b03ee123987c70779a25c6a570d9faf
This commit is contained in:
Jason Chiu
2021-11-30 16:13:37 +08:00
parent 506c6b804f
commit a305c23f5e
9 changed files with 346 additions and 166 deletions

View File

@@ -109,7 +109,8 @@ public class SearchResultTrampoline extends Activity {
final SettingsHomepageActivity homeActivity =
((SettingsApplication) getApplicationContext()).getHomeActivity();
if (homeActivity != null) {
homeActivity.getMainFragment().setHighlightMenuKey(highlightMenuKey);
homeActivity.getMainFragment().setHighlightMenuKey(highlightMenuKey,
/* scrollNeeded= */ true);
}
} else {
// Two-pane case