WidgetPicker - Fix sliding scrim on add widget dialog.
Use the system dimming for standalone widget picker activity, as the system
is applying a default transition.
Bug: 342230362
Flag: NONE animation tweak
Test: visual
Change-Id: I278f8bf97acbfbfca652e1e6b616e2d2885ca92a
diff --git a/res/values-night/styles.xml b/res/values-night/styles.xml
index 613c2e9..c95722f 100644
--- a/res/values-night/styles.xml
+++ b/res/values-night/styles.xml
@@ -21,6 +21,9 @@
<style name="AddItemActivityTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
<item name="widgetsTheme">@style/WidgetContainerTheme.Dark</item>
<item name="android:windowTranslucentStatus">true</item>
+ <!-- Add the dim background here, rather than in the activity layout as the window slides
+ in from the bottom, and we don't want the scrim to slide. -->
+ <item name="android:backgroundDimEnabled">true</item>
</style>
<style name="WidgetPickerActivityTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 6d99084..ae3d3b3 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -427,6 +427,9 @@
<item name="widgetsTheme">@style/WidgetContainerTheme</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowTranslucentStatus">true</item>
+ <!-- Add the dim background here, rather than in the activity layout as the window slides
+ in from the bottom, and we don't want the scrim to slide. -->
+ <item name="android:backgroundDimEnabled">true</item>
</style>
<style name="ProxyActivityStarterTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
diff --git a/src/com/android/launcher3/widget/AddItemWidgetsBottomSheet.java b/src/com/android/launcher3/widget/AddItemWidgetsBottomSheet.java
index 4f5d311..5e702aa 100644
--- a/src/com/android/launcher3/widget/AddItemWidgetsBottomSheet.java
+++ b/src/com/android/launcher3/widget/AddItemWidgetsBottomSheet.java
@@ -145,7 +145,10 @@
@Override
protected int getScrimColor(Context context) {
- return context.getResources().getColor(R.color.widgets_picker_scrim);
+ // Don't add a scrim when using the standalone picker activity. The background dimming is
+ // handled by applying dimBackground in the activity theme, so the scrim doesn't slide in
+ // with the window.
+ return -1;
}
@SuppressLint("NewApi") // Already added API check.