Loading packages/SystemUI/src/com/android/systemui/haptics/qs/QSLongPressEffect.kt +0 −2 Original line number Diff line number Diff line Loading @@ -189,7 +189,6 @@ constructor( durations?.get(1) ?: LongPressHapticBuilder.INVALID_DURATION, effectDuration ) _postedActionType.value = ActionType.INITIALIZE_ANIMATOR setState(State.IDLE) return true } Loading @@ -209,6 +208,5 @@ constructor( START_ANIMATOR, REVERSE_ANIMATOR, CANCEL_ANIMATOR, INITIALIZE_ANIMATOR, } } packages/SystemUI/src/com/android/systemui/haptics/qs/QSLongPressEffectViewBinder.kt +26 −22 Original line number Diff line number Diff line Loading @@ -67,29 +67,16 @@ object QSLongPressEffectViewBinder { qsLongPressEffect.clearActionType() } QSLongPressEffect.ActionType.START_ANIMATOR -> { if (effectAnimator?.isRunning == false) { effectAnimator?.start() } } QSLongPressEffect.ActionType.REVERSE_ANIMATOR -> { effectAnimator?.let { val pausedProgress = it.animatedFraction qsLongPressEffect.playReverseHaptics(pausedProgress) it.reverse() } } QSLongPressEffect.ActionType.CANCEL_ANIMATOR -> { tile.resetLongPressEffectProperties() effectAnimator?.cancel() } QSLongPressEffect.ActionType.INITIALIZE_ANIMATOR -> { if (effectAnimator?.isRunning != true) { effectAnimator = ValueAnimator.ofFloat(0f, 1f).apply { this.duration = qsLongPressEffect.effectDuration.toLong() interpolator = AccelerateDecelerateInterpolator() doOnStart { qsLongPressEffect.handleAnimationStart() } doOnStart { qsLongPressEffect.handleAnimationStart() } addUpdateListener { val value = animatedValue as Float if (value == 0f) { Loading @@ -98,9 +85,26 @@ object QSLongPressEffectViewBinder { tile.updateLongPressEffectProperties(value) } } doOnEnd { qsLongPressEffect.handleAnimationComplete() } doOnCancel { qsLongPressEffect.handleAnimationCancel() } doOnEnd { qsLongPressEffect.handleAnimationComplete() } doOnCancel { qsLongPressEffect.handleAnimationCancel() } start() } } } QSLongPressEffect.ActionType.REVERSE_ANIMATOR -> { effectAnimator?.let { val pausedProgress = it.animatedFraction qsLongPressEffect.playReverseHaptics(pausedProgress) it.reverse() } } QSLongPressEffect.ActionType.CANCEL_ANIMATOR -> { tile.resetLongPressEffectProperties() effectAnimator?.cancel() } } } Loading Loading
packages/SystemUI/src/com/android/systemui/haptics/qs/QSLongPressEffect.kt +0 −2 Original line number Diff line number Diff line Loading @@ -189,7 +189,6 @@ constructor( durations?.get(1) ?: LongPressHapticBuilder.INVALID_DURATION, effectDuration ) _postedActionType.value = ActionType.INITIALIZE_ANIMATOR setState(State.IDLE) return true } Loading @@ -209,6 +208,5 @@ constructor( START_ANIMATOR, REVERSE_ANIMATOR, CANCEL_ANIMATOR, INITIALIZE_ANIMATOR, } }
packages/SystemUI/src/com/android/systemui/haptics/qs/QSLongPressEffectViewBinder.kt +26 −22 Original line number Diff line number Diff line Loading @@ -67,29 +67,16 @@ object QSLongPressEffectViewBinder { qsLongPressEffect.clearActionType() } QSLongPressEffect.ActionType.START_ANIMATOR -> { if (effectAnimator?.isRunning == false) { effectAnimator?.start() } } QSLongPressEffect.ActionType.REVERSE_ANIMATOR -> { effectAnimator?.let { val pausedProgress = it.animatedFraction qsLongPressEffect.playReverseHaptics(pausedProgress) it.reverse() } } QSLongPressEffect.ActionType.CANCEL_ANIMATOR -> { tile.resetLongPressEffectProperties() effectAnimator?.cancel() } QSLongPressEffect.ActionType.INITIALIZE_ANIMATOR -> { if (effectAnimator?.isRunning != true) { effectAnimator = ValueAnimator.ofFloat(0f, 1f).apply { this.duration = qsLongPressEffect.effectDuration.toLong() interpolator = AccelerateDecelerateInterpolator() doOnStart { qsLongPressEffect.handleAnimationStart() } doOnStart { qsLongPressEffect.handleAnimationStart() } addUpdateListener { val value = animatedValue as Float if (value == 0f) { Loading @@ -98,9 +85,26 @@ object QSLongPressEffectViewBinder { tile.updateLongPressEffectProperties(value) } } doOnEnd { qsLongPressEffect.handleAnimationComplete() } doOnCancel { qsLongPressEffect.handleAnimationCancel() } doOnEnd { qsLongPressEffect.handleAnimationComplete() } doOnCancel { qsLongPressEffect.handleAnimationCancel() } start() } } } QSLongPressEffect.ActionType.REVERSE_ANIMATOR -> { effectAnimator?.let { val pausedProgress = it.animatedFraction qsLongPressEffect.playReverseHaptics(pausedProgress) it.reverse() } } QSLongPressEffect.ActionType.CANCEL_ANIMATOR -> { tile.resetLongPressEffectProperties() effectAnimator?.cancel() } } } Loading