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

Commit 3b72421c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make Volume Dialog slide espite current screen orientation" into main

parents 7557e8fb a8e47322
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
    android:id="@+id/volume_dialog"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_gravity="end"
    android:layout_gravity="right"
    android:alpha="0"
    android:clipChildren="false"
    android:minWidth="@dimen/volume_dialog_window_width">
@@ -60,7 +60,7 @@
        android:layout_marginEnd="@dimen/volume_dialog_window_margin"
        android:layout_marginBottom="@dimen/volume_dialog_slider_vertical_margin"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintHeight_max="@dimen/volume_dialog_slider_height"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.5" />
@@ -96,7 +96,7 @@
        android:orientation="horizontal"
        android:showDividers="middle|beginning|end"
        app:layout_constraintBottom_toBottomOf="@id/volume_dialog_main_slider_container"
        app:layout_constraintEnd_toStartOf="@id/volume_dialog_background"
        app:layout_constraintRight_toLeftOf="@id/volume_dialog_background"
        app:layout_constraintTop_toTopOf="@id/volume_dialog_main_slider_container" />

</androidx.constraintlayout.widget.ConstraintLayout>
+1 −11
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import androidx.dynamicanimation.animation.SpringAnimation
import androidx.dynamicanimation.animation.SpringForce
import com.android.app.tracing.coroutines.launchInTraced
import com.android.app.tracing.coroutines.launchTraced
import com.android.internal.view.RotationPolicy
import com.android.systemui.common.ui.view.onApplyWindowInsets
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.res.R
@@ -189,16 +188,7 @@ constructor(
     */
    private fun View.applyAnimationProgress(fraction: Float) {
        alpha = ceil(fraction)
        if (display.rotation == RotationPolicy.NATURAL_ROTATION) {
                if (isLayoutRtl) {
                    -1
                } else {
                    1
                } * width / 2f
            } else {
                null
            }
            ?.let { maxTranslationX -> translationX = lerp(maxTranslationX, 0f, fraction) }
        translationX = lerp(width, 0, fraction).toFloat()
    }

    private suspend fun ViewTreeObserver.listenToComputeInternalInsets() =