mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-12-04 15:52:34 -08:00
fix: Fingerprint button
This commit is contained in:
1 parent
db8920ae69
commit
244174e494
5 files changed
+20
-37
No files matched your search
@@ -629,7 +629,7 @@ class AdvancedUnlockFragment: StylishFragment(), AdvancedUnlockManager.AdvancedU
|
||||
@RequiresApi(Build.VERSION_CODES.M)
|
||||
private fun setAdvancedUnlockedMessageView(text: CharSequence) {
|
||||
lifecycleScope.launch(Dispatchers.Main) {
|
||||
mAdvancedUnlockInfoView?.message = text
|
||||
mAdvancedUnlockInfoView?.setMessage(text)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.annotation.StringRes
|
||||
import com.kunzisoft.keepass.R
|
||||
@@ -41,7 +42,6 @@ class AdvancedUnlockInfoView @JvmOverloads constructor(context: Context,
|
||||
private val unlockContainerView: View
|
||||
private var unlockAnimatedVector: FingerPrintAnimatedVector? = null
|
||||
private var unlockTitleTextView: TextView? = null
|
||||
private var unlockMessageTextView: TextView? = null
|
||||
private var unlockIconImageView: ImageView? = null
|
||||
|
||||
init {
|
||||
@@ -51,7 +51,6 @@ class AdvancedUnlockInfoView @JvmOverloads constructor(context: Context,
|
||||
|
||||
unlockContainerView = findViewById(R.id.fingerprint_container)
|
||||
unlockTitleTextView = findViewById(R.id.biometric_title)
|
||||
unlockMessageTextView = findViewById(R.id.biometric_message)
|
||||
unlockIconImageView = findViewById(R.id.biometric_image)
|
||||
}
|
||||
|
||||
@@ -85,6 +84,7 @@ class AdvancedUnlockInfoView @JvmOverloads constructor(context: Context,
|
||||
unlockContainerView.alpha = 0.8f
|
||||
}
|
||||
unlockIconImageView?.setOnClickListener(listener)
|
||||
unlockTitleTextView?.setOnClickListener(listener)
|
||||
}
|
||||
|
||||
var title: CharSequence
|
||||
@@ -99,22 +99,13 @@ class AdvancedUnlockInfoView @JvmOverloads constructor(context: Context,
|
||||
title = context.getString(textId)
|
||||
}
|
||||
|
||||
var message: CharSequence?
|
||||
get() {
|
||||
return unlockMessageTextView?.text?.toString() ?: ""
|
||||
}
|
||||
set(value) {
|
||||
if (value == null || value.isEmpty()) {
|
||||
unlockMessageTextView?.visibility = GONE
|
||||
} else {
|
||||
unlockMessageTextView?.visibility = VISIBLE
|
||||
stopIconViewAnimation()
|
||||
}
|
||||
unlockMessageTextView?.text = value ?: ""
|
||||
}
|
||||
fun setMessage(text: CharSequence) {
|
||||
if (text.isNotEmpty())
|
||||
Toast.makeText(context, text, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
|
||||
fun setMessage(@StringRes textId: Int) {
|
||||
message = context.getString(textId)
|
||||
Toast.makeText(context, textId, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user