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

Commit b185da2a authored by Marvin Bernal's avatar Marvin Bernal Committed by Android (Google) Code Review
Browse files

Merge "Make Back arrow stroke appear earlier" into udc-dev

parents 66b0e8ad 461c4112
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -607,7 +607,7 @@ class BackPanelController internal constructor(
        )
    }

    private var previousPreThresholdWidthInterpolator = params.entryWidthTowardsEdgeInterpolator
    private var previousPreThresholdWidthInterpolator = params.entryWidthInterpolator
    private fun preThresholdWidthStretchAmount(progress: Float): Float {
        val interpolator = run {
            val isPastSlop = totalTouchDeltaInactive > viewConfiguration.scaledTouchSlop
+21 −32
Original line number Diff line number Diff line
@@ -147,8 +147,21 @@ data class EdgePanelParams(private var resources: Resources) {
        val flungCommittedWidthSpring = createSpring(10000f, 1f)
        val flungCommittedHeightSpring = createSpring(10000f, 1f)

        val entryIndicatorAlphaThreshold = .23f
        val entryIndicatorAlphaFactor = 1.05f
        val commonArrowDimensAlphaThreshold = .165f
        val commonArrowDimensAlphaFactor = 1.05f
        val commonArrowDimensAlphaSpring = Step(
            threshold = commonArrowDimensAlphaThreshold,
            factor = commonArrowDimensAlphaFactor,
            postThreshold = createSpring(180f, 0.9f),
            preThreshold = createSpring(2000f, 0.6f)
        )
        val commonArrowDimensAlphaSpringInterpolator = Step(
            threshold = commonArrowDimensAlphaThreshold,
            factor = commonArrowDimensAlphaFactor,
            postThreshold = 1f,
            preThreshold = 0f
        )

        entryIndicator = BackIndicatorDimens(
                horizontalTranslation = getDimen(R.dimen.navigation_edge_entry_margin),
                scale = getDimenFloat(R.dimen.navigation_edge_entry_scale),
@@ -162,18 +175,8 @@ data class EdgePanelParams(private var resources: Resources) {
                        alpha = 0f,
                        lengthSpring = createSpring(600f, 0.4f),
                        heightSpring = createSpring(600f, 0.4f),
                        alphaSpring = Step(
                                threshold = entryIndicatorAlphaThreshold,
                                factor = entryIndicatorAlphaFactor,
                                postThreshold = createSpring(200f, 1f),
                                preThreshold = createSpring(2000f, 0.6f)
                        ),
                        alphaInterpolator = Step(
                                threshold = entryIndicatorAlphaThreshold,
                                factor = entryIndicatorAlphaFactor,
                                postThreshold = 1f,
                                preThreshold = 0f
                        )
                        alphaSpring = commonArrowDimensAlphaSpring,
                        alphaInterpolator = commonArrowDimensAlphaSpringInterpolator
                ),
                backgroundDimens = BackgroundDimens(
                        alpha = 1f,
@@ -188,20 +191,6 @@ data class EdgePanelParams(private var resources: Resources) {
                )
        )

        val preThresholdAndActiveIndicatorAlphaThreshold = .355f
        val preThresholdAndActiveIndicatorAlphaFactor = 1.05f
        val preThresholdAndActiveAlphaSpring = Step(
                threshold = preThresholdAndActiveIndicatorAlphaThreshold,
                factor = preThresholdAndActiveIndicatorAlphaFactor,
                postThreshold = createSpring(180f, 0.9f),
                preThreshold = createSpring(2000f, 0.6f)
        )
        val preThresholdAndActiveAlphaSpringInterpolator = Step(
                threshold = preThresholdAndActiveIndicatorAlphaThreshold,
                factor = preThresholdAndActiveIndicatorAlphaFactor,
                postThreshold = 1f,
                preThreshold = 0f
        )
        activeIndicator = BackIndicatorDimens(
                horizontalTranslation = getDimen(R.dimen.navigation_edge_active_margin),
                scale = getDimenFloat(R.dimen.navigation_edge_active_scale),
@@ -214,8 +203,8 @@ data class EdgePanelParams(private var resources: Resources) {
                        alpha = 1f,
                        lengthSpring = activeCommittedArrowLengthSpring,
                        heightSpring = activeCommittedArrowHeightSpring,
                        alphaSpring = preThresholdAndActiveAlphaSpring,
                        alphaInterpolator = preThresholdAndActiveAlphaSpringInterpolator
                        alphaSpring = commonArrowDimensAlphaSpring,
                        alphaInterpolator = commonArrowDimensAlphaSpringInterpolator
                ),
                backgroundDimens = BackgroundDimens(
                        alpha = 1f,
@@ -242,8 +231,8 @@ data class EdgePanelParams(private var resources: Resources) {
                        alpha = 1f,
                        lengthSpring = createSpring(100f, 0.6f),
                        heightSpring = createSpring(100f, 0.6f),
                        alphaSpring = preThresholdAndActiveAlphaSpring,
                        alphaInterpolator = preThresholdAndActiveAlphaSpringInterpolator
                        alphaSpring = commonArrowDimensAlphaSpring,
                        alphaInterpolator = commonArrowDimensAlphaSpringInterpolator
                ),
                backgroundDimens = BackgroundDimens(
                        alpha = 1f,