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

Commit 46a57bee authored by Yining Liu's avatar Yining Liu
Browse files

Fix Shade background flicker at the beginning of transition

This change fixes the flicker when transitioning from SingleShade to QS
Scene by disabling the broken touch indication on the
NotificationScrollingStack (only when onEmptySpaceClick is not null).

The removal of the touch indication also has a performance improvement,
and is as intended.

Fix: 440593535
Test: manual, drag on single shade to transit to QS scene, should not have flicker
Flag: com.android.systemui.scene_container
Change-Id: I6c19b15022655036ad7e3ca6950e6be632c21066
parent a45822f4
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import androidx.compose.foundation.gestures.animateScrollBy
import androidx.compose.foundation.gestures.rememberScrollableState
import androidx.compose.foundation.gestures.scrollBy
import androidx.compose.foundation.gestures.scrollable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
@@ -120,11 +121,11 @@ import com.android.systemui.statusbar.notification.stack.ui.view.NotificationScr
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationTransitionThresholds.EXPANSION_FOR_MAX_CORNER_RADIUS
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationTransitionThresholds.EXPANSION_FOR_MAX_SCRIM_ALPHA
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationsPlaceholderViewModel
import kotlin.math.max
import kotlin.math.roundToInt
import kotlinx.coroutines.awaitCancellation
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.launch
import kotlin.math.max
import kotlin.math.roundToInt

object Notifications {
    object Elements {
@@ -570,6 +571,8 @@ fun ContentScope.NotificationScrollingStack(
        }
    }

    val interactionSource = remember { MutableInteractionSource() }

    Box(
        modifier =
            modifier
@@ -644,7 +647,11 @@ fun ContentScope.NotificationScrollingStack(
                    )
                }
                .thenIf(onEmptySpaceClick != null) {
                    Modifier.clickable(onClick = { onEmptySpaceClick?.invoke() })
                    Modifier.clickable(
                        interactionSource = interactionSource,
                        indication = null, // Prevent flicker on transition
                        onClick = { onEmptySpaceClick?.invoke() },
                    )
                }
    ) {
        Spacer(