commit | 9971a7ef3ec1437b02916c1bd51b3f8dd5f3f0d6 | [log] [tgz] |
---|---|---|
author | Chuck Liao <chuckliao@google.com> | Tue Oct 26 19:28:29 2021 +0800 |
committer | Chuck Liao <chuckliao@google.com> | Thu Oct 28 22:40:48 2021 +0800 |
tree | a1e673cbb3617b8cbc9ad8f8755d47c225bd3f20 | |
parent | 2ade042fcbd60c8fb45219519f782e645ec32a05 [diff] |
Fix the title not translated when resuming app from overview Video: https://drive.google.com/file/d/140kssFO_fBgizjRpUlmzqL5ZhkN1yXHE/view?usp=sharing&resourcekey=0-y5hWfEFbc9ss4Y2LrFB8vQ https://drive.google.com/file/d/1L6bbeqE_YV4takc91O9ZPjnpT1mrbOZ9/view?usp=sharing&resourcekey=0-3RWB2NOt4B8kYgnKf5er8g Bug: 197825064 Test: manual Change-Id: If92411df840dbcc2186ac6a232dc5874181e5764
diff --git a/src/com/android/customization/model/grid/GridSectionController.java b/src/com/android/customization/model/grid/GridSectionController.java index 5470d77..64a6cce 100644 --- a/src/com/android/customization/model/grid/GridSectionController.java +++ b/src/com/android/customization/model/grid/GridSectionController.java
@@ -74,8 +74,8 @@ } }, /* reload= */ true); - gridSectionView.setOnClickListener(v -> mSectionNavigationController.navigateTo( - GridFragment.newInstance(context.getString(R.string.grid_title)))); + gridSectionView.setOnClickListener( + v -> mSectionNavigationController.navigateTo(new GridFragment())); return gridSectionView; }
diff --git a/src/com/android/customization/picker/grid/GridFragment.java b/src/com/android/customization/picker/grid/GridFragment.java index 5e5ee6a..d554f72 100644 --- a/src/com/android/customization/picker/grid/GridFragment.java +++ b/src/com/android/customization/picker/grid/GridFragment.java
@@ -61,12 +61,6 @@ private static final String KEY_STATE_BOTTOM_ACTION_BAR_VISIBLE = "GridFragment.bottomActionBarVisible"; - public static GridFragment newInstance(CharSequence title) { - GridFragment fragment = new GridFragment(); - fragment.setArguments(AppbarFragment.createArguments(title)); - return fragment; - } - private WallpaperInfo mHomeWallpaper; private RecyclerView mOptionsContainer; private OptionSelectorController<GridOption> mOptionsController; @@ -166,6 +160,11 @@ } @Override + public CharSequence getDefaultTitle() { + return getString(R.string.grid_title); + } + + @Override protected void onBottomActionBarReady(BottomActionBar bottomActionBar) { super.onBottomActionBarReady(bottomActionBar); mBottomActionBar = bottomActionBar;