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

Commit 894de67e authored by Michael Mikhail's avatar Michael Mikhail
Browse files

Check shade expansion fraction to allow animation

In compose, it seems that values doesn't get updated before the time of
the transition of UMO from QS to QQS. Therefore, the UMO is still marked
as if it's visible and animation is executed, which leads to the flicker
effect. Checking the shade expanded fraction and decide whether
animation is needed fixes the issue.

Flag: com.android.systemui.qs_ui_refactor_compose_fragment
Fixes: 389576164
Test: Checked UI.
Change-Id: I741f5118ab9d1f66cd10dfe236a374184b3908b6
parent b9a9cd5f
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ import com.android.systemui.media.controls.domain.pipeline.MediaDataManager
import com.android.systemui.media.controls.ui.view.MediaHost
import com.android.systemui.media.dream.MediaDreamComplication
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.qs.flags.QSComposeFragment
import com.android.systemui.res.R
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.shade.ShadeDisplayAware
@@ -289,6 +290,9 @@ constructor(
            updateUserVisibility()
        }

    /** The expansion fraction of notification shade. */
    var shadeExpandedFraction: Float = 0.0f

    /**
     * distance that the full shade transition takes in order for media to fully transition to the
     * shade
@@ -868,7 +872,13 @@ constructor(
        if (isCurrentlyInGuidedTransformation()) {
            return false
        }
        if (skipQqsOnExpansion) {
        if (
            skipQqsOnExpansion ||
                (QSComposeFragment.isEnabled &&
                    desiredLocation == LOCATION_QQS &&
                    previousLocation == LOCATION_QS &&
                    shadeExpandedFraction == 0.0f)
        ) {
            return false
        }
        if (isHubTransition) {
+1 −0
Original line number Diff line number Diff line
@@ -959,6 +959,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum
    void setShadeExpansion(float expandedHeight, float expandedFraction) {
        mShadeExpandedHeight = expandedHeight;
        mShadeExpandedFraction = expandedFraction;
        mMediaHierarchyManager.setShadeExpandedFraction(expandedFraction);
    }

    @VisibleForTesting