Loading packages/SystemUI/res/drawable/controls_panel_background.xml 0 → 100644 +22 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2022 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. ~ --> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#1F1F1F" /> <corners android:radius="@dimen/notification_corner_radius" /> </shape> No newline at end of file packages/SystemUI/res/layout/controls_with_favorites.xml +1 −1 Original line number Diff line number Diff line Loading @@ -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" /> Loading packages/SystemUI/src/com/android/systemui/controls/management/ControlsAnimations.kt +12 −3 Original line number Diff line number Diff line Loading @@ -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) Loading @@ -61,8 +66,12 @@ object ControlsAnimations { view.transitionAlpha = 0.0f if (translationY == -1f) { if (animateY) { translationY = view.context.resources.getDimensionPixelSize( R.dimen.global_actions_controls_y_translation).toFloat() } else { translationY = 0f } } } Loading packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt +2 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,8 @@ class ControlsActivity @Inject constructor( ControlsAnimations.observerForAnimations( requireViewById<ViewGroup>(R.id.control_detail_root), window, intent intent, !featureFlags.isEnabled(Flags.USE_APP_PANELS) ) ) Loading packages/SystemUI/src/com/android/systemui/controls/ui/PanelTaskViewController.kt +14 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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, Loading Loading
packages/SystemUI/res/drawable/controls_panel_background.xml 0 → 100644 +22 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2022 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. ~ --> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#1F1F1F" /> <corners android:radius="@dimen/notification_corner_radius" /> </shape> No newline at end of file
packages/SystemUI/res/layout/controls_with_favorites.xml +1 −1 Original line number Diff line number Diff line Loading @@ -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" /> Loading
packages/SystemUI/src/com/android/systemui/controls/management/ControlsAnimations.kt +12 −3 Original line number Diff line number Diff line Loading @@ -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) Loading @@ -61,8 +66,12 @@ object ControlsAnimations { view.transitionAlpha = 0.0f if (translationY == -1f) { if (animateY) { translationY = view.context.resources.getDimensionPixelSize( R.dimen.global_actions_controls_y_translation).toFloat() } else { translationY = 0f } } } Loading
packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt +2 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,8 @@ class ControlsActivity @Inject constructor( ControlsAnimations.observerForAnimations( requireViewById<ViewGroup>(R.id.control_detail_root), window, intent intent, !featureFlags.isEnabled(Flags.USE_APP_PANELS) ) ) Loading
packages/SystemUI/src/com/android/systemui/controls/ui/PanelTaskViewController.kt +14 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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, Loading