[flexiglass] Fixes extraneous haptic feedback in pattern bouncer. am: 4e9af5b759 am: f1f1940b20
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23334224 Change-Id: Ic4c71092e7e6d4d3b01399366d1cb3875958ada3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
committed by
Automerger Merge Worker
commit
1f5a2e955e
@@ -100,10 +100,14 @@ internal fun PatternBouncer(
|
|||||||
|
|
||||||
// When the current dot is changed, we need to update our animations.
|
// When the current dot is changed, we need to update our animations.
|
||||||
LaunchedEffect(currentDot, isAnimationEnabled) {
|
LaunchedEffect(currentDot, isAnimationEnabled) {
|
||||||
view.performHapticFeedback(
|
// Perform haptic feedback, but only if the current dot is not null, so we don't perform it
|
||||||
HapticFeedbackConstants.VIRTUAL_KEY,
|
// when the UI first shows up or when the user lifts their pointer/finger.
|
||||||
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING,
|
if (currentDot != null) {
|
||||||
)
|
view.performHapticFeedback(
|
||||||
|
HapticFeedbackConstants.VIRTUAL_KEY,
|
||||||
|
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if (!isAnimationEnabled) {
|
if (!isAnimationEnabled) {
|
||||||
return@LaunchedEffect
|
return@LaunchedEffect
|
||||||
|
|||||||
Reference in New Issue
Block a user