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 fingerprintTextView: TextView? = null
|
||||
private var fingerprintImageView: ImageView? = null
|
||||
private var unlockContainer: View? = null
|
||||
private var filenameView: TextView? = null
|
||||
private var passwordView: EditText? = null
|
||||
private var keyFileView: EditText? = null
|
||||
@@ -124,6 +125,7 @@ class PasswordActivity : StylishActivity(),
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
supportActionBar?.setDisplayShowHomeEnabled(true)
|
||||
|
||||
unlockContainer = findViewById(R.id.unlock_container)
|
||||
confirmButtonView = findViewById(R.id.pass_ok)
|
||||
filenameView = findViewById(R.id.filename)
|
||||
passwordView = findViewById(R.id.password)
|
||||
@@ -588,6 +590,12 @@ class PasswordActivity : StylishActivity(),
|
||||
}
|
||||
|
||||
private fun loadDatabase(password: String?, keyFile: Uri?) {
|
||||
|
||||
// Deactivate the open button
|
||||
confirmButtonView?.isEnabled = false
|
||||
// Hide credentials
|
||||
unlockContainer?.visibility = View.INVISIBLE
|
||||
|
||||
// Clear before we load
|
||||
val database = App.currentDatabase
|
||||
database.closeAndClear(applicationContext.filesDir)
|
||||
@@ -624,6 +632,11 @@ class PasswordActivity : StylishActivity(),
|
||||
reInitWithFingerprintMode()
|
||||
}
|
||||
|
||||
// Show credentials
|
||||
unlockContainer?.visibility = View.VISIBLE
|
||||
// Activate the open button
|
||||
confirmButtonView?.isEnabled = true
|
||||
|
||||
if (result.isSuccess) {
|
||||
if (database.validatePasswordEncoding(password)) {
|
||||
launchGroupActivity()
|
||||
|
||||
@@ -115,87 +115,87 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<!-- Password Input -->
|
||||
<RelativeLayout
|
||||
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"
|
||||
<!-- Password Input -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/password_input_container"
|
||||
android:layout_width="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:layout_height="wrap_content">
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/password_input_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@+id/password_checkbox"
|
||||
android:layout_toEndOf="@+id/password_checkbox"
|
||||
app:passwordToggleEnabled="true"
|
||||
app:passwordToggleTint="?attr/colorAccent">
|
||||
<android.support.v7.widget.AppCompatCheckBox
|
||||
android:id="@+id/password_checkbox"
|
||||
android:layout_width="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.TextInputEditText
|
||||
android:id="@+id/password"
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/password_input_layout"
|
||||
android:layout_width="match_parent"
|
||||
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:layout_toRightOf="@+id/password_checkbox"
|
||||
android:layout_toEndOf="@+id/password_checkbox"
|
||||
app:passwordToggleEnabled="true"
|
||||
app:passwordToggleTint="?attr/colorAccent">
|
||||
|
||||
<!-- File Input -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/container_key_file"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/password"
|
||||
android:layout_width="match_parent"
|
||||
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
|
||||
android:id="@+id/keyfile_checkox"
|
||||
<!-- File Input -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/container_key_file"
|
||||
android:layout_width="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:layout_height="wrap_content">
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/input_entry_keyfile"
|
||||
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.support.v7.widget.AppCompatCheckBox
|
||||
android:id="@+id/keyfile_checkox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/entry_keyfile"
|
||||
android:inputType="text"
|
||||
android:maxLines="1" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
android:paddingBottom="20dp"
|
||||
android:focusable="false"
|
||||
android:layout_alignBottom="@+id/input_entry_keyfile"
|
||||
android:gravity="center_vertical" />
|
||||
|
||||
<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>
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/input_entry_keyfile"
|
||||
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: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>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
Reference in New Issue
Block a user