diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-05-04 17:53:03 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-05-04 17:53:03 +0000 |
commit | fe7640181d703ca1f0b96ff5fafaa091f507dd21 (patch) | |
tree | bd4621cf235c6e7fa15bbdf4a8bfa3285b999cfd | |
parent | 1a926fe8a72172e785342e0f00a9b0d6d2c8f317 (diff) | |
parent | 5150819e625fec622dba135ca5d24fedd7c5b972 (diff) | |
download | ThemePicker-fe7640181d703ca1f0b96ff5fafaa091f507dd21.tar.gz |
Snap for 7316203 from 5150819e625fec622dba135ca5d24fedd7c5b972 to rvc-platform-releaseandroid-platform-11.0.0_r9android-platform-11.0.0_r8android-platform-11.0.0_r7android-platform-11.0.0_r40android-platform-11.0.0_r39android-platform-11.0.0_r38android-platform-11.0.0_r37android-platform-11.0.0_r36android-platform-11.0.0_r35android-platform-11.0.0_r34android-platform-11.0.0_r33android-platform-11.0.0_r32android-platform-11.0.0_r31android-platform-11.0.0_r30android-platform-11.0.0_r29android-platform-11.0.0_r28android-platform-11.0.0_r27android-platform-11.0.0_r26android-platform-11.0.0_r25android-platform-11.0.0_r24android-platform-11.0.0_r23android-platform-11.0.0_r22android-platform-11.0.0_r21android-platform-11.0.0_r20android-platform-11.0.0_r19android-platform-11.0.0_r18android-platform-11.0.0_r17android-platform-11.0.0_r16android-platform-11.0.0_r15android-platform-11.0.0_r14android-platform-11.0.0_r13android-platform-11.0.0_r12android-platform-11.0.0_r11android-platform-11.0.0_r10android11-platform-release
Change-Id: Ibc553b04b7220a4f04afe3e18e024ad32bc009f9
-rw-r--r-- | src/com/android/customization/picker/theme/ThemeFragment.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/com/android/customization/picker/theme/ThemeFragment.java b/src/com/android/customization/picker/theme/ThemeFragment.java index de8aa69b..7b582747 100644 --- a/src/com/android/customization/picker/theme/ThemeFragment.java +++ b/src/com/android/customization/picker/theme/ThemeFragment.java @@ -287,9 +287,10 @@ public class ThemeFragment extends AppbarFragment { mSelectedTheme = previouslySelectedTheme != null ? previouslySelectedTheme : activeTheme; - // 3. Select the default theme if there is no matching custom enabled theme. + // 3. Select the first system theme(default theme currently) + // if there is no matching custom enabled theme. if (mSelectedTheme == null) { - mSelectedTheme = findDefaultThemeBundle(options); + mSelectedTheme = findFirstSystemThemeBundle(options); } mOptionsController.setSelectedOption(mSelectedTheme); @@ -324,8 +325,7 @@ public class ThemeFragment extends AppbarFragment { } } if (mSelectedTheme == null) { - // Select the default theme if there is no matching custom enabled theme - mSelectedTheme = findDefaultThemeBundle(options); + mSelectedTheme = findFirstSystemThemeBundle(options); } mOptionsController.setSelectedOption(mSelectedTheme); // Set selected option above will show BottomActionBar, @@ -334,11 +334,9 @@ public class ThemeFragment extends AppbarFragment { }, true); } - private ThemeBundle findDefaultThemeBundle(List<ThemeBundle> options) { - String defaultThemeTitle = - getActivity().getResources().getString(R.string.default_theme_title); + private ThemeBundle findFirstSystemThemeBundle(List<ThemeBundle> options) { for (ThemeBundle bundle : options) { - if (bundle.getTitle().equals(defaultThemeTitle)) { + if (!(bundle instanceof CustomTheme)) { return bundle; } } |