diff --git a/packages/SystemUI/res/drawable/controls_panel_background.xml b/packages/SystemUI/res/drawable/controls_panel_background.xml new file mode 100644 index 0000000000000..9092877fc6faf --- /dev/null +++ b/packages/SystemUI/res/drawable/controls_panel_background.xml @@ -0,0 +1,22 @@ + + + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/layout/controls_with_favorites.xml b/packages/SystemUI/res/layout/controls_with_favorites.xml index 9efad22694634..ee3adba00fe5b 100644 --- a/packages/SystemUI/res/layout/controls_with_favorites.xml +++ b/packages/SystemUI/res/layout/controls_with_favorites.xml @@ -90,7 +90,7 @@ android:layout_weight="1" android:layout_marginLeft="@dimen/global_actions_side_margin" android:layout_marginRight="@dimen/global_actions_side_margin" - android:background="#ff0000" + android:background="@drawable/controls_panel_background" android:padding="@dimen/global_actions_side_margin" android:visibility="gone" /> diff --git a/packages/SystemUI/src/com/android/systemui/controls/management/ControlsAnimations.kt b/packages/SystemUI/src/com/android/systemui/controls/management/ControlsAnimations.kt index 4aa597ef3d28e..8d0edf8294163 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/management/ControlsAnimations.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/management/ControlsAnimations.kt @@ -50,7 +50,12 @@ object ControlsAnimations { * Setup an activity to handle enter/exit animations. [view] should be the root of the content. * Fade and translate together. */ - fun observerForAnimations(view: ViewGroup, window: Window, intent: Intent): LifecycleObserver { + fun observerForAnimations( + view: ViewGroup, + window: Window, + intent: Intent, + animateY: Boolean = true + ): LifecycleObserver { return object : LifecycleObserver { var showAnimation = intent.getBooleanExtra(ControlsUiController.EXTRA_ANIMATE, false) @@ -61,8 +66,12 @@ object ControlsAnimations { view.transitionAlpha = 0.0f if (translationY == -1f) { - translationY = view.context.resources.getDimensionPixelSize( - R.dimen.global_actions_controls_y_translation).toFloat() + if (animateY) { + translationY = view.context.resources.getDimensionPixelSize( + R.dimen.global_actions_controls_y_translation).toFloat() + } else { + translationY = 0f + } } } diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt index 5d611c4c82121..d8d8c0ead06a8 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt @@ -70,7 +70,8 @@ class ControlsActivity @Inject constructor( ControlsAnimations.observerForAnimations( requireViewById(R.id.control_detail_root), window, - intent + intent, + !featureFlags.isEnabled(Flags.USE_APP_PANELS) ) ) diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/PanelTaskViewController.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/PanelTaskViewController.kt index 7143be298a9db..f5764c2fdc04a 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/ui/PanelTaskViewController.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/ui/PanelTaskViewController.kt @@ -24,6 +24,10 @@ import android.app.PendingIntent import android.content.ComponentName import android.content.Context import android.content.Intent +import android.graphics.Color +import android.graphics.drawable.ShapeDrawable +import android.graphics.drawable.shapes.RoundRectShape +import com.android.systemui.R import com.android.systemui.util.boundsOnScreen import com.android.wm.shell.TaskView import java.util.concurrent.Executor @@ -64,6 +68,16 @@ class PanelTaskViewController( options.taskAlwaysOnTop = true taskView.post { + val roundedCorner = + activityContext.resources.getDimensionPixelSize( + R.dimen.notification_corner_radius + ) + val radii = FloatArray(8) { roundedCorner.toFloat() } + taskView.background = + ShapeDrawable(RoundRectShape(radii, null, null)).apply { + setTint(Color.TRANSPARENT) + } + taskView.clipToOutline = true taskView.startActivity( pendingIntent, fillInIntent, diff --git a/packages/SystemUI/tests/src/com/android/systemui/controls/ui/PanelTaskViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/controls/ui/PanelTaskViewControllerTest.kt index 5cd2ace4604a4..de04ef810dd07 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/controls/ui/PanelTaskViewControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/controls/ui/PanelTaskViewControllerTest.kt @@ -75,6 +75,7 @@ class PanelTaskViewControllerTest : SysuiTestCase() { uiExecutor.execute(it.arguments[0] as Runnable) true } + whenever(activityContext.resources).thenReturn(context.resources) uiExecutor = FakeExecutor(FakeSystemClock())