Merge "Isolate & fix animation logic for BP icon/overlay" into tm-qpr-dev
This commit is contained in:
@@ -35,13 +35,13 @@ class AuthBiometricFingerprintAndFaceIconController(
|
|||||||
|
|
||||||
override val actsAsConfirmButton: Boolean = true
|
override val actsAsConfirmButton: Boolean = true
|
||||||
|
|
||||||
override fun shouldAnimateForTransition(
|
override fun shouldAnimateIconViewForTransition(
|
||||||
@BiometricState oldState: Int,
|
@BiometricState oldState: Int,
|
||||||
@BiometricState newState: Int
|
@BiometricState newState: Int
|
||||||
): Boolean = when (newState) {
|
): Boolean = when (newState) {
|
||||||
STATE_PENDING_CONFIRMATION -> true
|
STATE_PENDING_CONFIRMATION -> true
|
||||||
STATE_AUTHENTICATED -> false
|
STATE_AUTHENTICATED -> false
|
||||||
else -> super.shouldAnimateForTransition(oldState, newState)
|
else -> super.shouldAnimateIconViewForTransition(oldState, newState)
|
||||||
}
|
}
|
||||||
|
|
||||||
@RawRes
|
@RawRes
|
||||||
|
|||||||
@@ -104,12 +104,14 @@ open class AuthBiometricFingerprintIconController(
|
|||||||
|
|
||||||
iconView.frame = 0
|
iconView.frame = 0
|
||||||
iconViewOverlay.frame = 0
|
iconViewOverlay.frame = 0
|
||||||
if (shouldAnimateForTransition(lastState, newState)) {
|
if (shouldAnimateIconViewForTransition(lastState, newState)) {
|
||||||
iconView.playAnimation()
|
|
||||||
iconViewOverlay.playAnimation()
|
|
||||||
} else if (lastState == STATE_IDLE && newState == STATE_AUTHENTICATING_ANIMATING_IN) {
|
|
||||||
iconView.playAnimation()
|
iconView.playAnimation()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shouldAnimateIconViewOverlayForTransition(lastState, newState)) {
|
||||||
|
iconViewOverlay.playAnimation()
|
||||||
|
}
|
||||||
|
|
||||||
LottieColorUtils.applyDynamicColors(context, iconView)
|
LottieColorUtils.applyDynamicColors(context, iconView)
|
||||||
LottieColorUtils.applyDynamicColors(context, iconViewOverlay)
|
LottieColorUtils.applyDynamicColors(context, iconViewOverlay)
|
||||||
}
|
}
|
||||||
@@ -127,7 +129,7 @@ open class AuthBiometricFingerprintIconController(
|
|||||||
}
|
}
|
||||||
|
|
||||||
iconView.frame = 0
|
iconView.frame = 0
|
||||||
if (shouldAnimateForTransition(lastState, newState)) {
|
if (shouldAnimateIconViewForTransition(lastState, newState)) {
|
||||||
iconView.playAnimation()
|
iconView.playAnimation()
|
||||||
}
|
}
|
||||||
LottieColorUtils.applyDynamicColors(context, iconView)
|
LottieColorUtils.applyDynamicColors(context, iconView)
|
||||||
@@ -160,7 +162,20 @@ open class AuthBiometricFingerprintIconController(
|
|||||||
return if (id != null) context.getString(id) else null
|
return if (id != null) context.getString(id) else null
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun shouldAnimateForTransition(
|
protected open fun shouldAnimateIconViewForTransition(
|
||||||
|
@BiometricState oldState: Int,
|
||||||
|
@BiometricState newState: Int
|
||||||
|
) = when (newState) {
|
||||||
|
STATE_HELP,
|
||||||
|
STATE_ERROR -> true
|
||||||
|
STATE_AUTHENTICATING_ANIMATING_IN,
|
||||||
|
STATE_AUTHENTICATING ->
|
||||||
|
oldState == STATE_ERROR || oldState == STATE_HELP || oldState == STATE_IDLE
|
||||||
|
STATE_AUTHENTICATED -> true
|
||||||
|
else -> false
|
||||||
|
}
|
||||||
|
|
||||||
|
protected open fun shouldAnimateIconViewOverlayForTransition(
|
||||||
@BiometricState oldState: Int,
|
@BiometricState oldState: Int,
|
||||||
@BiometricState newState: Int
|
@BiometricState newState: Int
|
||||||
) = when (newState) {
|
) = when (newState) {
|
||||||
|
|||||||
Reference in New Issue
Block a user