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

Commit c277a107 authored by Fabián Kozynski's avatar Fabián Kozynski
Browse files

Add more conditions to excluding gesture

When QS is expanding in lockscreen or in split shade, there's no STL
transition, but BrightnessSlider is moving in the screen. This causes
the modifier to send a new rect (with global coordinates) on every
frame.

Instead, restrict this to only exclude gestures when QS is settled.

Test: manual, log calls to modifier lambda
Fixes: 401811481
Flag: com.android.systemui.qs_ui_refactor_compose_fragment
Change-Id: I3fc6754dc250524a3a40868a7ad557906a479d85
parent d7cd85e5
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -746,7 +746,16 @@ constructor(
                                Box(
                                    Modifier.systemGestureExclusionInShade(
                                        enabled = {
                                            layoutState.transitionState is TransitionState.Idle
                                            /*
                                             * While we are transitioning into QS (either from QQS
                                             * or from gone), the global position of the brightness
                                             * slider will change in every frame. This causes
                                             * the modifier to send a new gesture exclusion
                                             * rectangle on every frame. Instead, only apply the
                                             * modifier when this is settled.
                                             */
                                            layoutState.transitionState is TransitionState.Idle &&
                                                viewModel.isNotTransitioning
                                        }
                                    )
                                ) {
+5 −0
Original line number Diff line number Diff line
@@ -312,6 +312,11 @@ constructor(
            source = containerViewModel.editModeViewModel.isEditing,
        )

    /** True if we are not in an expansion (from Gone to QQS/QS) animation. */
    val isNotTransitioning by derivedStateOf {
        viewTranslationY == 0f && viewAlpha == 1f && constrainedSquishinessFraction == 1f
    }

    private val inFirstPage: Boolean
        get() = inFirstPageViewModel.inFirstPage