mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Minimized hidden text #373
This commit is contained in:
@@ -20,7 +20,6 @@ package com.kunzisoft.keepass.view
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.text.method.PasswordTransformationMethod
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
@@ -199,11 +198,7 @@ class EntryContentsView @JvmOverloads constructor(context: Context,
|
||||
}
|
||||
|
||||
fun setHiddenPasswordStyle(hiddenStyle: Boolean) {
|
||||
if (!hiddenStyle) {
|
||||
passwordView.transformationMethod = null
|
||||
} else {
|
||||
passwordView.transformationMethod = PasswordTransformationMethod.getInstance()
|
||||
}
|
||||
passwordView.applyHiddenStyle(hiddenStyle)
|
||||
// Hidden style for custom fields
|
||||
extrasView.let {
|
||||
for (i in 0 until it.childCount) {
|
||||
|
||||
@@ -21,13 +21,12 @@ package com.kunzisoft.keepass.view
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.text.method.PasswordTransformationMethod
|
||||
import androidx.core.content.ContextCompat
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.kunzisoft.keepass.R
|
||||
|
||||
open class EntryCustomField @JvmOverloads constructor(context: Context,
|
||||
@@ -72,11 +71,7 @@ open class EntryCustomField @JvmOverloads constructor(context: Context,
|
||||
}
|
||||
|
||||
fun setHiddenPasswordStyle(hiddenStyle: Boolean) {
|
||||
if (isProtected && hiddenStyle) {
|
||||
valueView.transformationMethod = PasswordTransformationMethod.getInstance()
|
||||
} else {
|
||||
valueView.transformationMethod = null
|
||||
}
|
||||
valueView.applyHiddenStyle(isProtected && hiddenStyle)
|
||||
}
|
||||
|
||||
fun enableActionButton(enable: Boolean) {
|
||||
|
||||
@@ -21,11 +21,9 @@ package com.kunzisoft.keepass.view
|
||||
|
||||
import android.animation.AnimatorSet
|
||||
import android.animation.ValueAnimator
|
||||
import android.app.Activity
|
||||
import android.content.pm.ActivityInfo
|
||||
import android.content.res.Configuration
|
||||
import android.graphics.Color
|
||||
import android.graphics.Typeface
|
||||
import android.text.method.PasswordTransformationMethod
|
||||
import android.view.View
|
||||
import android.view.animation.AccelerateDecelerateInterpolator
|
||||
import android.widget.TextView
|
||||
@@ -41,6 +39,16 @@ fun TextView.applyFontVisibility() {
|
||||
typeface = typeFace
|
||||
}
|
||||
|
||||
fun TextView.applyHiddenStyle(hide: Boolean) {
|
||||
if (hide) {
|
||||
transformationMethod = PasswordTransformationMethod.getInstance()
|
||||
maxLines = 1
|
||||
} else {
|
||||
transformationMethod = null
|
||||
maxLines = 800
|
||||
}
|
||||
}
|
||||
|
||||
fun Snackbar.asError(): Snackbar {
|
||||
this.view.apply {
|
||||
setBackgroundColor(Color.RED)
|
||||
|
||||
Reference in New Issue
Block a user