mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Hide credentials when opening database #250
This commit is contained in:
@@ -77,6 +77,7 @@ class PasswordActivity : StylishActivity(),
|
|||||||
private var fingerPrintAnimatedVector: FingerPrintAnimatedVector? = null
|
private var fingerPrintAnimatedVector: FingerPrintAnimatedVector? = null
|
||||||
private var fingerprintTextView: TextView? = null
|
private var fingerprintTextView: TextView? = null
|
||||||
private var fingerprintImageView: ImageView? = null
|
private var fingerprintImageView: ImageView? = null
|
||||||
|
private var unlockContainer: View? = null
|
||||||
private var filenameView: TextView? = null
|
private var filenameView: TextView? = null
|
||||||
private var passwordView: EditText? = null
|
private var passwordView: EditText? = null
|
||||||
private var keyFileView: EditText? = null
|
private var keyFileView: EditText? = null
|
||||||
@@ -124,6 +125,7 @@ class PasswordActivity : StylishActivity(),
|
|||||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||||
supportActionBar?.setDisplayShowHomeEnabled(true)
|
supportActionBar?.setDisplayShowHomeEnabled(true)
|
||||||
|
|
||||||
|
unlockContainer = findViewById(R.id.unlock_container)
|
||||||
confirmButtonView = findViewById(R.id.pass_ok)
|
confirmButtonView = findViewById(R.id.pass_ok)
|
||||||
filenameView = findViewById(R.id.filename)
|
filenameView = findViewById(R.id.filename)
|
||||||
passwordView = findViewById(R.id.password)
|
passwordView = findViewById(R.id.password)
|
||||||
@@ -588,6 +590,12 @@ class PasswordActivity : StylishActivity(),
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun loadDatabase(password: String?, keyFile: Uri?) {
|
private fun loadDatabase(password: String?, keyFile: Uri?) {
|
||||||
|
|
||||||
|
// Deactivate the open button
|
||||||
|
confirmButtonView?.isEnabled = false
|
||||||
|
// Hide credentials
|
||||||
|
unlockContainer?.visibility = View.INVISIBLE
|
||||||
|
|
||||||
// Clear before we load
|
// Clear before we load
|
||||||
val database = App.currentDatabase
|
val database = App.currentDatabase
|
||||||
database.closeAndClear(applicationContext.filesDir)
|
database.closeAndClear(applicationContext.filesDir)
|
||||||
@@ -624,6 +632,11 @@ class PasswordActivity : StylishActivity(),
|
|||||||
reInitWithFingerprintMode()
|
reInitWithFingerprintMode()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show credentials
|
||||||
|
unlockContainer?.visibility = View.VISIBLE
|
||||||
|
// Activate the open button
|
||||||
|
confirmButtonView?.isEnabled = true
|
||||||
|
|
||||||
if (result.isSuccess) {
|
if (result.isSuccess) {
|
||||||
if (database.validatePasswordEncoding(password)) {
|
if (database.validatePasswordEncoding(password)) {
|
||||||
launchGroupActivity()
|
launchGroupActivity()
|
||||||
|
|||||||
@@ -115,87 +115,87 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent">
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
<!-- Password Input -->
|
<!-- Password Input -->
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/password_input_container"
|
android:id="@+id/password_input_container"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatCheckBox
|
|
||||||
android:id="@+id/password_checkbox"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:paddingBottom="20dp"
|
|
||||||
android:focusable="false"
|
|
||||||
android:layout_alignBottom="@+id/password_input_layout"
|
|
||||||
android:gravity="center_vertical" />
|
|
||||||
|
|
||||||
<android.support.design.widget.TextInputLayout
|
<android.support.v7.widget.AppCompatCheckBox
|
||||||
android:id="@+id/password_input_layout"
|
android:id="@+id/password_checkbox"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toRightOf="@+id/password_checkbox"
|
android:paddingBottom="20dp"
|
||||||
android:layout_toEndOf="@+id/password_checkbox"
|
android:focusable="false"
|
||||||
app:passwordToggleEnabled="true"
|
android:layout_alignBottom="@+id/password_input_layout"
|
||||||
app:passwordToggleTint="?attr/colorAccent">
|
android:gravity="center_vertical" />
|
||||||
|
|
||||||
<android.support.design.widget.TextInputEditText
|
<android.support.design.widget.TextInputLayout
|
||||||
android:id="@+id/password"
|
android:id="@+id/password_input_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/password"
|
android:layout_toRightOf="@+id/password_checkbox"
|
||||||
android:inputType="textPassword"
|
android:layout_toEndOf="@+id/password_checkbox"
|
||||||
android:importantForAccessibility="no"
|
app:passwordToggleEnabled="true"
|
||||||
android:imeOptions="actionDone"
|
app:passwordToggleTint="?attr/colorAccent">
|
||||||
android:maxLines="1"/>
|
|
||||||
</android.support.design.widget.TextInputLayout>
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<!-- File Input -->
|
<android.support.design.widget.TextInputEditText
|
||||||
<RelativeLayout
|
android:id="@+id/password"
|
||||||
android:id="@+id/container_key_file"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content">
|
android:hint="@string/password"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:importantForAccessibility="no"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:maxLines="1"/>
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatCheckBox
|
<!-- File Input -->
|
||||||
android:id="@+id/keyfile_checkox"
|
<RelativeLayout
|
||||||
|
android:id="@+id/container_key_file"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:paddingBottom="20dp"
|
|
||||||
android:focusable="false"
|
|
||||||
android:layout_alignBottom="@+id/input_entry_keyfile"
|
|
||||||
android:gravity="center_vertical" />
|
|
||||||
|
|
||||||
<android.support.design.widget.TextInputLayout
|
<android.support.v7.widget.AppCompatCheckBox
|
||||||
android:id="@+id/input_entry_keyfile"
|
android:id="@+id/keyfile_checkox"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_toEndOf="@+id/keyfile_checkox"
|
|
||||||
android:layout_toRightOf="@+id/keyfile_checkox"
|
|
||||||
android:layout_toLeftOf="@+id/browse_button"
|
|
||||||
android:layout_toStartOf="@+id/browse_button">
|
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatEditText
|
|
||||||
android:id="@+id/pass_keyfile"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/entry_keyfile"
|
android:paddingBottom="20dp"
|
||||||
android:inputType="text"
|
android:focusable="false"
|
||||||
android:maxLines="1" />
|
android:layout_alignBottom="@+id/input_entry_keyfile"
|
||||||
</android.support.design.widget.TextInputLayout>
|
android:gravity="center_vertical" />
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatImageView
|
<android.support.design.widget.TextInputLayout
|
||||||
android:id="@+id/browse_button"
|
android:id="@+id/input_entry_keyfile"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignBottom="@+id/input_entry_keyfile"
|
android:layout_toEndOf="@+id/keyfile_checkox"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_toRightOf="@+id/keyfile_checkox"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_toLeftOf="@+id/browse_button"
|
||||||
android:padding="8dp"
|
android:layout_toStartOf="@+id/browse_button">
|
||||||
android:focusable="true"
|
|
||||||
android:src="@drawable/ic_folder_white_24dp"
|
<android.support.v7.widget.AppCompatEditText
|
||||||
android:tint="?attr/colorAccentCompat" />
|
android:id="@+id/pass_keyfile"
|
||||||
</RelativeLayout>
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/entry_keyfile"
|
||||||
|
android:inputType="text"
|
||||||
|
android:maxLines="1" />
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatImageView
|
||||||
|
android:id="@+id/browse_button"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@+id/input_entry_keyfile"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:focusable="true"
|
||||||
|
android:src="@drawable/ic_folder_white_24dp"
|
||||||
|
android:tint="?attr/colorAccentCompat" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</android.support.constraint.ConstraintLayout>
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user