Fix biometric view visibility

This commit is contained in:
J-Jamet
2020-08-05 14:44:47 +02:00
parent d15b6323c2
commit da051e3ff3
3 changed files with 5 additions and 10 deletions

View File

@@ -446,7 +446,6 @@ open class PasswordActivity : SpecialModeActivity() {
var biometricInitialize = false
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (PreferencesUtil.isBiometricUnlockEnable(this)) {
if (advancedUnlockedManager == null && databaseFileUri != null) {
advancedUnlockedManager = AdvancedUnlockedManager(this,
databaseFileUri,
@@ -478,6 +477,7 @@ open class PasswordActivity : SpecialModeActivity() {
biometricInitialize = true
} else {
advancedUnlockedManager?.destroy()
advancedUnlockInfoView?.visibility = View.GONE
}
}
if (!biometricInitialize) {

View File

@@ -26,6 +26,7 @@ import android.provider.Settings
import android.util.Log
import android.view.Menu
import android.view.MenuInflater
import android.view.View
import android.widget.CompoundButton
import android.widget.TextView
import androidx.annotation.RequiresApi
@@ -334,7 +335,9 @@ class AdvancedUnlockedManager(var context: FragmentActivity,
}
private fun showFingerPrintViews(show: Boolean) {
context.runOnUiThread { advancedUnlockInfoView?.hide = !show }
context.runOnUiThread {
advancedUnlockInfoView?.visibility = if (show) View.VISIBLE else View.GONE
}
}
private fun setAdvancedUnlockedTitleView(textId: Int) {

View File

@@ -113,12 +113,4 @@ class AdvancedUnlockInfoView @JvmOverloads constructor(context: Context,
message = context.getString(textId)
}
var hide: Boolean
get() {
return visibility != VISIBLE
}
set(value) {
visibility = if (value) View.GONE else View.VISIBLE
}
}