Fix small issues

This commit is contained in:
J-Jamet committed 2019-09-02 13:37:07 +02:00
1 parent 8682856c01
commit adcc1c745a
20 files changed
+33 -31

No files matched your search

@@ -144,29 +144,25 @@ class AdvancedUnlockedViewManager(var context: FragmentActivity,
private fun initNotAvailable() {
showFingerPrintViews(false)
advancedUnlockInfoView?.stopIconViewAnimation()
advancedUnlockInfoView?.setIconViewClickListener(null)
}
private fun initPause() {
showFingerPrintViews(true)
advancedUnlockInfoView?.stopIconViewAnimation()
advancedUnlockInfoView?.setIconViewClickListener(null)
}
private fun initNotConfigured() {
showFingerPrintViews(true)
setAdvancedUnlockedView(R.string.configure_biometric)
advancedUnlockInfoView?.stopIconViewAnimation()
advancedUnlockInfoView?.setIconViewClickListener(null)
}
private fun initWaitData() {
showFingerPrintViews(true)
setAdvancedUnlockedView(R.string.no_password_stored)
advancedUnlockInfoView?.startIconViewAnimation()
setAdvancedUnlockedView(R.string.no_credentials_stored)
advancedUnlockInfoView?.setIconViewClickListener(null)
}
@@ -174,7 +170,6 @@ class AdvancedUnlockedViewManager(var context: FragmentActivity,
private fun initEncryptData() {
showFingerPrintViews(true)
setAdvancedUnlockedView(R.string.open_biometric_prompt_store_credential)
advancedUnlockInfoView?.startIconViewAnimation()
biometricHelper?.initEncryptData { biometricPrompt, cryptoObject, promptInfo ->
// Set listener to open the biometric dialog and save credential
@@ -189,7 +184,6 @@ class AdvancedUnlockedViewManager(var context: FragmentActivity,
private fun initDecryptData() {
showFingerPrintViews(true)
setAdvancedUnlockedView(R.string.open_biometric_prompt_unlock_database)
advancedUnlockInfoView?.startIconViewAnimation()
if (biometricHelper != null) {
prefsNoBackup.getString(preferenceKeyIvSpec, null)?.let {
@@ -39,19 +39,23 @@ class FingerPrintAnimatedVector(context: Context, imageView: ImageView) {
imageView.setImageDrawable(scanFingerprint)
}
private var animationCallback = object : Animatable2.AnimationCallback() {
override fun onAnimationEnd(drawable: Drawable) {
if (!scanFingerprint.isRunning)
scanFingerprint.start()
}
}
fun startScan() {
scanFingerprint.registerAnimationCallback(object : Animatable2.AnimationCallback() {
override fun onAnimationEnd(drawable: Drawable) {
if (!scanFingerprint.isRunning)
scanFingerprint.start()
}
})
scanFingerprint.registerAnimationCallback(animationCallback)
if (!scanFingerprint.isRunning)
scanFingerprint.start()
}
fun stopScan() {
scanFingerprint.unregisterAnimationCallback(animationCallback)
if (scanFingerprint.isRunning)
scanFingerprint.stop()
}
@@ -50,8 +50,12 @@ class AdvancedUnlockInfoView @JvmOverloads constructor(context: Context,
}
fun setIconViewClickListener(listener: ((view: View)->Unit)?) {
unlockIconImageView?.setOnClickListener(listener)
if (listener == null)
stopIconViewAnimation()
else
startIconViewAnimation()
unlockContainerView.alpha = if (listener == null) 0.8f else 1f
unlockIconImageView?.setOnClickListener(listener)
}
var text: CharSequence