mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
fix: Fingerprint button
This commit is contained in:
@@ -629,7 +629,7 @@ class AdvancedUnlockFragment: StylishFragment(), AdvancedUnlockManager.AdvancedU
|
|||||||
@RequiresApi(Build.VERSION_CODES.M)
|
@RequiresApi(Build.VERSION_CODES.M)
|
||||||
private fun setAdvancedUnlockedMessageView(text: CharSequence) {
|
private fun setAdvancedUnlockedMessageView(text: CharSequence) {
|
||||||
lifecycleScope.launch(Dispatchers.Main) {
|
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.ImageView
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
|
import android.widget.Toast
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import com.kunzisoft.keepass.R
|
import com.kunzisoft.keepass.R
|
||||||
@@ -41,7 +42,6 @@ class AdvancedUnlockInfoView @JvmOverloads constructor(context: Context,
|
|||||||
private val unlockContainerView: View
|
private val unlockContainerView: View
|
||||||
private var unlockAnimatedVector: FingerPrintAnimatedVector? = null
|
private var unlockAnimatedVector: FingerPrintAnimatedVector? = null
|
||||||
private var unlockTitleTextView: TextView? = null
|
private var unlockTitleTextView: TextView? = null
|
||||||
private var unlockMessageTextView: TextView? = null
|
|
||||||
private var unlockIconImageView: ImageView? = null
|
private var unlockIconImageView: ImageView? = null
|
||||||
|
|
||||||
init {
|
init {
|
||||||
@@ -51,7 +51,6 @@ class AdvancedUnlockInfoView @JvmOverloads constructor(context: Context,
|
|||||||
|
|
||||||
unlockContainerView = findViewById(R.id.fingerprint_container)
|
unlockContainerView = findViewById(R.id.fingerprint_container)
|
||||||
unlockTitleTextView = findViewById(R.id.biometric_title)
|
unlockTitleTextView = findViewById(R.id.biometric_title)
|
||||||
unlockMessageTextView = findViewById(R.id.biometric_message)
|
|
||||||
unlockIconImageView = findViewById(R.id.biometric_image)
|
unlockIconImageView = findViewById(R.id.biometric_image)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,6 +84,7 @@ class AdvancedUnlockInfoView @JvmOverloads constructor(context: Context,
|
|||||||
unlockContainerView.alpha = 0.8f
|
unlockContainerView.alpha = 0.8f
|
||||||
}
|
}
|
||||||
unlockIconImageView?.setOnClickListener(listener)
|
unlockIconImageView?.setOnClickListener(listener)
|
||||||
|
unlockTitleTextView?.setOnClickListener(listener)
|
||||||
}
|
}
|
||||||
|
|
||||||
var title: CharSequence
|
var title: CharSequence
|
||||||
@@ -99,22 +99,13 @@ class AdvancedUnlockInfoView @JvmOverloads constructor(context: Context,
|
|||||||
title = context.getString(textId)
|
title = context.getString(textId)
|
||||||
}
|
}
|
||||||
|
|
||||||
var message: CharSequence?
|
fun setMessage(text: CharSequence) {
|
||||||
get() {
|
if (text.isNotEmpty())
|
||||||
return unlockMessageTextView?.text?.toString() ?: ""
|
Toast.makeText(context, text, Toast.LENGTH_LONG).show()
|
||||||
}
|
}
|
||||||
set(value) {
|
|
||||||
if (value == null || value.isEmpty()) {
|
|
||||||
unlockMessageTextView?.visibility = GONE
|
|
||||||
} else {
|
|
||||||
unlockMessageTextView?.visibility = VISIBLE
|
|
||||||
stopIconViewAnimation()
|
|
||||||
}
|
|
||||||
unlockMessageTextView?.text = value ?: ""
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setMessage(@StringRes textId: Int) {
|
fun setMessage(@StringRes textId: Int) {
|
||||||
message = context.getString(textId)
|
Toast.makeText(context, textId, Toast.LENGTH_LONG).show()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -26,38 +26,23 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:filterTouchesWhenObscured="true">
|
android:filterTouchesWhenObscured="true">
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/biometric_message"
|
|
||||||
style="@style/KeepassDXStyle.TextAppearance.Warning.TextOnPrimary"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginHorizontal="8dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:orientation="vertical"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/biometric_image"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
tools:text="Sample error" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/biometric_image"
|
android:id="@+id/biometric_image"
|
||||||
android:layout_width="42dp"
|
android:layout_width="42dp"
|
||||||
android:layout_height="42dp"
|
android:layout_height="42dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:elevation="8dp"
|
|
||||||
android:layout_margin="4dp"
|
|
||||||
android:src="@drawable/fingerprint"
|
android:src="@drawable/fingerprint"
|
||||||
android:background="@drawable/background_image"
|
android:background="@drawable/background_image"
|
||||||
android:backgroundTint="?attr/colorAccent" />
|
android:backgroundTint="?attr/colorAccent" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/biometric_title"
|
android:id="@+id/biometric_title"
|
||||||
style="@style/KeepassDXStyle.TextAppearance.Secondary.TextOnPrimary"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="8dp"
|
style="@style/KeepassDXStyle.TextAppearance.Tiny.Secondary"
|
||||||
android:orientation="vertical"
|
android:layout_margin="8dp"
|
||||||
|
android:gravity="start|center_vertical"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/biometric_image"
|
app:layout_constraintStart_toEndOf="@+id/biometric_image"
|
||||||
|
|||||||
@@ -175,7 +175,8 @@
|
|||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="8dp">
|
||||||
<androidx.fragment.app.FragmentContainerView
|
<androidx.fragment.app.FragmentContainerView
|
||||||
android:id="@+id/fragment_advanced_unlock_container_view"
|
android:id="@+id/fragment_advanced_unlock_container_view"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@@ -190,6 +191,7 @@
|
|||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:text="@string/unlock"
|
android:text="@string/unlock"
|
||||||
app:icon="@drawable/ic_lock_open_white_24dp"
|
app:icon="@drawable/ic_lock_open_white_24dp"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/fragment_advanced_unlock_container_view"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|||||||
@@ -479,7 +479,12 @@
|
|||||||
<style name="KeepassDXStyle.TextAppearance.Tiny" parent="KeepassDXStyle.TextAppearance">
|
<style name="KeepassDXStyle.TextAppearance.Tiny" parent="KeepassDXStyle.TextAppearance">
|
||||||
<item name="android:textSize">12sp</item>
|
<item name="android:textSize">12sp</item>
|
||||||
</style>
|
</style>
|
||||||
<style name="KeepassDXStyle.TextAppearance.Warning" parent="KeepassDXStyle.TextAppearance">
|
<style name="KeepassDXStyle.TextAppearance.Tiny.Secondary" parent="KeepassDXStyle.TextAppearance">
|
||||||
|
<item name="android:textSize">12sp</item>
|
||||||
|
<item name="android:textColor">?attr/colorAccent</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="KeepassDXStyle.TextAppearance.Warning" parent="KeepassDXStyle.TextAppearance">
|
||||||
<item name="android:textColor">?attr/colorAccent</item>
|
<item name="android:textColor">?attr/colorAccent</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user