Loading packages/SystemUI/src/com/android/systemui/haptics/qs/QSLongPressEffectViewBinder.kt +6 −4 Original line number Diff line number Diff line Loading @@ -18,10 +18,10 @@ package com.android.systemui.haptics.qs import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.android.app.tracing.coroutines.launch import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.qs.tileimpl.QSTileViewImpl import kotlinx.coroutines.DisposableHandle import kotlinx.coroutines.launch class QSLongPressEffectViewBinder { Loading @@ -31,16 +31,18 @@ class QSLongPressEffectViewBinder { fun bind( tile: QSTileViewImpl, tileSpec: String?, effect: QSLongPressEffect?, ) { if (effect == null) return handle = tile.repeatWhenAttached { repeatOnLifecycle(Lifecycle.State.STARTED) { repeatOnLifecycle(Lifecycle.State.CREATED) { effect.scope = this val tag = "${tileSpec ?: "unknownTileSpec"}#LongPressEffect" launch { launch("$tag#progress") { effect.effectProgress.collect { progress -> progress?.let { if (it == 0f) { Loading @@ -51,7 +53,7 @@ class QSLongPressEffectViewBinder { } } launch { launch("$tag#action") { effect.actionType.collect { action -> action?.let { when (it) { Loading packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt +1 −1 Original line number Diff line number Diff line Loading @@ -620,7 +620,7 @@ open class QSTileViewImpl @JvmOverloads constructor( showRippleEffect = false setOnTouchListener(longPressEffect) if (!longPressEffectViewBinder.isBound) { longPressEffectViewBinder.bind(this, longPressEffect) longPressEffectViewBinder.bind(this, state.spec, longPressEffect) } } else { // Long-press effects might have been enabled before but the new state does not Loading Loading
packages/SystemUI/src/com/android/systemui/haptics/qs/QSLongPressEffectViewBinder.kt +6 −4 Original line number Diff line number Diff line Loading @@ -18,10 +18,10 @@ package com.android.systemui.haptics.qs import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.android.app.tracing.coroutines.launch import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.qs.tileimpl.QSTileViewImpl import kotlinx.coroutines.DisposableHandle import kotlinx.coroutines.launch class QSLongPressEffectViewBinder { Loading @@ -31,16 +31,18 @@ class QSLongPressEffectViewBinder { fun bind( tile: QSTileViewImpl, tileSpec: String?, effect: QSLongPressEffect?, ) { if (effect == null) return handle = tile.repeatWhenAttached { repeatOnLifecycle(Lifecycle.State.STARTED) { repeatOnLifecycle(Lifecycle.State.CREATED) { effect.scope = this val tag = "${tileSpec ?: "unknownTileSpec"}#LongPressEffect" launch { launch("$tag#progress") { effect.effectProgress.collect { progress -> progress?.let { if (it == 0f) { Loading @@ -51,7 +53,7 @@ class QSLongPressEffectViewBinder { } } launch { launch("$tag#action") { effect.actionType.collect { action -> action?.let { when (it) { Loading
packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt +1 −1 Original line number Diff line number Diff line Loading @@ -620,7 +620,7 @@ open class QSTileViewImpl @JvmOverloads constructor( showRippleEffect = false setOnTouchListener(longPressEffect) if (!longPressEffectViewBinder.isBound) { longPressEffectViewBinder.bind(this, longPressEffect) longPressEffectViewBinder.bind(this, state.spec, longPressEffect) } } else { // Long-press effects might have been enabled before but the new state does not Loading