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

Commit 85cb9e91 authored by Michael Mikhail's avatar Michael Mikhail
Browse files

Disable opening drawer on the side in large screens

Flag: com.android.systemui.volume_redesign
Fixes: 385721632
Test: Ui Checked on tablet and phone.
Change-Id: I5db2762967d35d6cf0db8ec10074eababb64c076
parent b9a9cd5f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -22,4 +22,6 @@

    <!--  True when small screen (<sw600dp) is landscape. -->
    <bool name="is_small_screen_landscape">true</bool>

    <bool name="volume_dialog_ringer_drawer_should_open_to_the_side">true</bool>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -22,4 +22,6 @@

    <!--  True when small screen (<sw600dp) is landscape. -->
    <bool name="is_small_screen_landscape">false</bool>

    <bool name="volume_dialog_ringer_drawer_should_open_to_the_side">false</bool>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -66,4 +66,6 @@

    <!--  True when small screen (<sw600dp) is landscape. -->
    <bool name="is_small_screen_landscape">false</bool>

    <bool name="volume_dialog_ringer_drawer_should_open_to_the_side">false</bool>
</resources>
+14 −7
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.volume.dialog.ringer.ui.binder

import android.animation.ArgbEvaluator
import android.content.res.Configuration
import android.graphics.drawable.GradientDrawable
import android.view.LayoutInflater
import android.view.View
@@ -127,6 +128,16 @@ constructor(
                when (ringerState) {
                    is RingerViewModelState.Available -> {
                        val uiModel = ringerState.uiModel
                        val orientation =
                            if (
                                view.context.resources.getBoolean(
                                    R.bool.volume_dialog_ringer_drawer_should_open_to_the_side
                                )
                            ) {
                                ringerState.orientation
                            } else {
                                Configuration.ORIENTATION_PORTRAIT
                            }

                        // Set up view background and visibility
                        drawerContainer.visibility = View.VISIBLE
@@ -144,7 +155,7 @@ constructor(
                                drawerContainer.closeDrawer(
                                    ringerBackgroundView,
                                    uiModel.currentButtonIndex,
                                    ringerState.orientation,
                                    orientation,
                                )
                            }
                            is RingerDrawerState.Closed -> {
@@ -186,7 +197,7 @@ constructor(
                                        drawerContainer.closeDrawer(
                                            ringerBackgroundView,
                                            uiModel.currentButtonIndex,
                                            ringerState.orientation,
                                            orientation,
                                        )
                                    }
                                }
@@ -206,11 +217,7 @@ constructor(
                                } else {
                                    ringerDrawerTransitionListener.setProgressChangeEnabled(true)
                                }
                                updateOpenState(
                                    drawerContainer,
                                    ringerState.orientation,
                                    ringerBackgroundView,
                                )
                                updateOpenState(drawerContainer, orientation, ringerBackgroundView)
                                drawerContainer
                                    .getTransition(R.id.close_to_open_transition)
                                    .setInterpolatorInfo(