Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bee18180 authored by Fabian Kozynski's avatar Fabian Kozynski Committed by Automerger Merge Worker
Browse files

Merge "Polish background for controls panel." into tm-qpr-dev am: bb848b65

parents 672dbc5a bb848b65
Loading
Loading
Loading
Loading
+22 −0
Original line number Original line 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
+1 −1
Original line number Original line Diff line number Diff line
@@ -90,7 +90,7 @@
      android:layout_weight="1"
      android:layout_weight="1"
      android:layout_marginLeft="@dimen/global_actions_side_margin"
      android:layout_marginLeft="@dimen/global_actions_side_margin"
      android:layout_marginRight="@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:padding="@dimen/global_actions_side_margin"
      android:visibility="gone"
      android:visibility="gone"
      />
      />
+12 −3
Original line number Original line Diff line number Diff line
@@ -50,7 +50,12 @@ object ControlsAnimations {
     * Setup an activity to handle enter/exit animations. [view] should be the root of the content.
     * Setup an activity to handle enter/exit animations. [view] should be the root of the content.
     * Fade and translate together.
     * 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 {
        return object : LifecycleObserver {
            var showAnimation = intent.getBooleanExtra(ControlsUiController.EXTRA_ANIMATE, false)
            var showAnimation = intent.getBooleanExtra(ControlsUiController.EXTRA_ANIMATE, false)


@@ -61,8 +66,12 @@ object ControlsAnimations {
                view.transitionAlpha = 0.0f
                view.transitionAlpha = 0.0f


                if (translationY == -1f) {
                if (translationY == -1f) {
                    if (animateY) {
                        translationY = view.context.resources.getDimensionPixelSize(
                        translationY = view.context.resources.getDimensionPixelSize(
                                R.dimen.global_actions_controls_y_translation).toFloat()
                                R.dimen.global_actions_controls_y_translation).toFloat()
                    } else {
                        translationY = 0f
                    }
                }
                }
            }
            }


+2 −1
Original line number Original line Diff line number Diff line
@@ -70,7 +70,8 @@ class ControlsActivity @Inject constructor(
            ControlsAnimations.observerForAnimations(
            ControlsAnimations.observerForAnimations(
                requireViewById<ViewGroup>(R.id.control_detail_root),
                requireViewById<ViewGroup>(R.id.control_detail_root),
                window,
                window,
                intent
                intent,
                !featureFlags.isEnabled(Flags.USE_APP_PANELS)
            )
            )
        )
        )


+14 −0
Original line number Original line Diff line number Diff line
@@ -24,6 +24,10 @@ import android.app.PendingIntent
import android.content.ComponentName
import android.content.ComponentName
import android.content.Context
import android.content.Context
import android.content.Intent
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.systemui.util.boundsOnScreen
import com.android.wm.shell.TaskView
import com.android.wm.shell.TaskView
import java.util.concurrent.Executor
import java.util.concurrent.Executor
@@ -64,6 +68,16 @@ class PanelTaskViewController(
                options.taskAlwaysOnTop = true
                options.taskAlwaysOnTop = true


                taskView.post {
                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(
                    taskView.startActivity(
                        pendingIntent,
                        pendingIntent,
                        fillInIntent,
                        fillInIntent,
Loading