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
This commit is contained in:
Zak Cohen
2024-05-20 15:23:23 -07:00
parent 38ad424a17
commit 10cf086910
3 changed files with 10 additions and 1 deletions

View File

@@ -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">

View File

@@ -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">

View File

@@ -145,7 +145,10 @@ public class AddItemWidgetsBottomSheet extends AbstractSlideInView<AddItemActivi
@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.