summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/flag(!com.android.documentsui.flags.use_material3)/values/themes.xml30
-rw-r--r--res/flag(com.android.documentsui.flags.use_material3)/values/themes.xml32
-rw-r--r--src/com/android/documentsui/BaseActivity.java5
3 files changed, 3 insertions, 64 deletions
diff --git a/res/flag(!com.android.documentsui.flags.use_material3)/values/themes.xml b/res/flag(!com.android.documentsui.flags.use_material3)/values/themes.xml
index d6e3af0fe..443374282 100644
--- a/res/flag(!com.android.documentsui.flags.use_material3)/values/themes.xml
+++ b/res/flag(!com.android.documentsui.flags.use_material3)/values/themes.xml
@@ -77,36 +77,6 @@
<item name="android:itemTextAppearance">@style/MenuItemTextAppearance</item>
</style>
- <!-- Theme used for Material 3 uplift, hidden behind the use_material3 flag. -->
- <style name="DocumentsDefaultM3Theme" parent="@style/Theme.Material3.DynamicColors.DayNight.NoActionBar">
-
- <!-- This only used by support lib, not allow to overlay -->
- <item name="windowActionBar">false</item>
- <item name="windowActionModeOverlay">true</item>
-
- <!-- For material design widget, chips, buttons, not support attr-->
- <item name="colorPrimary">@color/primary</item>
- <item name="colorAccent">@color/primary</item>
-
- <!-- TODO need to solve the error handle in GridItemThumbnail -->
- <item name="gridItemTint">@color/item_doc_grid_tint</item>
-
- <item name="actionBarTheme">@style/ActionBarTheme</item>
- <item name="actionModeStyle">@style/ActionModeStyle</item>
- <item name="actionOverflowButtonStyle">@style/OverflowButtonStyle</item>
- <item name="actionOverflowMenuStyle">@style/OverflowMenuStyle</item>
- <item name="alertDialogTheme">@style/AlertDialogTheme</item>
- <item name="autoCompleteTextViewStyle">@style/AutoCompleteTextViewStyle</item>
- <item name="bottomSheetDialogTheme">@style/BottomSheetDialogStyle</item>
- <item name="materialButtonStyle">@style/MaterialButton</item>
- <item name="materialButtonOutlinedStyle">@style/MaterialOutlinedButton</item>
- <item name="materialCardViewStyle">@style/CardViewStyle</item>
- <item name="materialAlertDialogTheme">@style/MaterialAlertDialogTheme</item>
- <item name="queryBackground">@color/menu_search_background</item>
- <item name="snackbarButtonStyle">@style/SnackbarButtonStyle</item>
- <item name="android:itemTextAppearance">@style/MenuItemTextAppearance</item>
- </style>
-
<style name="TabTheme" parent="@android:style/Theme.DeviceDefault.DayNight">
<item name="colorPrimary">@color/edge_effect</item>
</style>
diff --git a/res/flag(com.android.documentsui.flags.use_material3)/values/themes.xml b/res/flag(com.android.documentsui.flags.use_material3)/values/themes.xml
index 73d2ceb26..8f145fd38 100644
--- a/res/flag(com.android.documentsui.flags.use_material3)/values/themes.xml
+++ b/res/flag(com.android.documentsui.flags.use_material3)/values/themes.xml
@@ -48,37 +48,7 @@
</style>
- <style name="DocumentsDefaultTheme" parent="@style/Theme.MaterialComponents.DayNight.NoActionBar">
-
- <!-- This only used by support lib, not allow to overlay -->
- <item name="windowActionBar">false</item>
- <item name="windowActionModeOverlay">true</item>
-
- <!-- For material design widget, chips, buttons, not support attr-->
- <item name="colorPrimary">@color/primary</item>
- <item name="colorAccent">@color/primary</item>
-
- <!-- TODO need to solve the error handle in GridItemThumbnail -->
- <item name="gridItemTint">@color/item_doc_grid_tint</item>
-
- <item name="actionBarTheme">@style/ActionBarTheme</item>
- <item name="actionModeStyle">@style/ActionModeStyle</item>
- <item name="actionOverflowButtonStyle">@style/OverflowButtonStyle</item>
- <item name="actionOverflowMenuStyle">@style/OverflowMenuStyle</item>
- <item name="alertDialogTheme">@style/AlertDialogTheme</item>
- <item name="autoCompleteTextViewStyle">@style/AutoCompleteTextViewStyle</item>
- <item name="bottomSheetDialogTheme">@style/BottomSheetDialogStyle</item>
- <item name="materialButtonStyle">@style/MaterialButton</item>
- <item name="materialButtonOutlinedStyle">@style/MaterialOutlinedButton</item>
- <item name="materialCardViewStyle">@style/CardViewStyle</item>
- <item name="materialAlertDialogTheme">@style/MaterialAlertDialogTheme</item>
- <item name="queryBackground">@color/menu_search_background</item>
- <item name="snackbarButtonStyle">@style/SnackbarButtonStyle</item>
- <item name="android:itemTextAppearance">@style/MenuItemTextAppearance</item>
- </style>
-
- <!-- Theme used for Material 3 uplift, hidden behind the use_material3 flag. -->
- <style name="DocumentsDefaultM3Theme" parent="@style/Theme.Material3.DynamicColors.DayNight.NoActionBar">
+ <style name="DocumentsDefaultTheme" parent="@style/Theme.Material3.DayNight.NoActionBar">
<!-- This only used by support lib, not allow to overlay -->
<item name="windowActionBar">false</item>
diff --git a/src/com/android/documentsui/BaseActivity.java b/src/com/android/documentsui/BaseActivity.java
index 45a2b91a1..b3439d585 100644
--- a/src/com/android/documentsui/BaseActivity.java
+++ b/src/com/android/documentsui/BaseActivity.java
@@ -181,11 +181,10 @@ public abstract class BaseActivity
// ToDo Create tool to check resource version before applyStyle for the theme
// If version code is not match, we should reset overlay package to default,
// in case Activity continuously encounter resource not found exception.
+ getTheme().applyStyle(R.style.DocumentsDefaultTheme, false);
+
if (useMaterial3() && SdkLevel.isAtLeastS()) {
- getTheme().applyStyle(R.style.DocumentsDefaultM3Theme, false);
DynamicColors.applyToActivityIfAvailable(this);
- } else {
- getTheme().applyStyle(R.style.DocumentsDefaultTheme, false);
}
super.onCreate(savedInstanceState);