mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Copy password from generator #697
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
KeePassDX(2.9.1)
|
KeePassDX(2.9.1)
|
||||||
|
* Copy password from generator #697
|
||||||
* Fix Magikeyboard not fully visible #772
|
* Fix Magikeyboard not fully visible #772
|
||||||
* Fix change font size #770
|
* Fix change font size #770
|
||||||
* Small fixes #771
|
* Small fixes #771
|
||||||
|
|||||||
@@ -26,13 +26,11 @@ import com.google.android.material.textfield.TextInputLayout
|
|||||||
import androidx.fragment.app.DialogFragment
|
import androidx.fragment.app.DialogFragment
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.Button
|
import android.widget.*
|
||||||
import android.widget.CompoundButton
|
|
||||||
import android.widget.EditText
|
|
||||||
import android.widget.SeekBar
|
|
||||||
import com.kunzisoft.keepass.R
|
import com.kunzisoft.keepass.R
|
||||||
import com.kunzisoft.keepass.password.PasswordGenerator
|
import com.kunzisoft.keepass.password.PasswordGenerator
|
||||||
import com.kunzisoft.keepass.settings.PreferencesUtil
|
import com.kunzisoft.keepass.settings.PreferencesUtil
|
||||||
|
import com.kunzisoft.keepass.timeout.ClipboardHelper
|
||||||
import com.kunzisoft.keepass.view.applyFontVisibility
|
import com.kunzisoft.keepass.view.applyFontVisibility
|
||||||
|
|
||||||
class GeneratePasswordDialogFragment : DialogFragment() {
|
class GeneratePasswordDialogFragment : DialogFragment() {
|
||||||
@@ -78,6 +76,15 @@ class GeneratePasswordDialogFragment : DialogFragment() {
|
|||||||
passwordInputLayoutView = root?.findViewById(R.id.password_input_layout)
|
passwordInputLayoutView = root?.findViewById(R.id.password_input_layout)
|
||||||
passwordView = root?.findViewById(R.id.password)
|
passwordView = root?.findViewById(R.id.password)
|
||||||
passwordView?.applyFontVisibility()
|
passwordView?.applyFontVisibility()
|
||||||
|
val passwordCopyView: ImageView? = root?.findViewById(R.id.password_copy_button)
|
||||||
|
passwordCopyView?.visibility = if(PreferencesUtil.allowCopyPasswordAndProtectedFields(activity))
|
||||||
|
View.VISIBLE else View.GONE
|
||||||
|
val clipboardHelper = ClipboardHelper(activity)
|
||||||
|
passwordCopyView?.setOnClickListener {
|
||||||
|
clipboardHelper.timeoutCopyToClipboard(passwordView!!.text.toString(),
|
||||||
|
getString(R.string.copy_field,
|
||||||
|
getString(R.string.entry_password)))
|
||||||
|
}
|
||||||
|
|
||||||
lengthTextView = root?.findViewById(R.id.length)
|
lengthTextView = root?.findViewById(R.id.length)
|
||||||
|
|
||||||
|
|||||||
@@ -33,27 +33,45 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
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">
|
||||||
app:passwordToggleEnabled="true"
|
|
||||||
app:passwordToggleTint="?attr/colorAccent"
|
|
||||||
android:importantForAccessibility="no"
|
|
||||||
android:importantForAutofill="no">
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/password"
|
android:id="@+id/password_input_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/password_copy_button"
|
||||||
android:importantForAccessibility="no"
|
android:importantForAccessibility="no"
|
||||||
android:importantForAutofill="no"
|
android:importantForAutofill="no"
|
||||||
android:ems="10"
|
app:passwordToggleEnabled="true"
|
||||||
android:maxLines="3"
|
app:passwordToggleTint="?attr/colorAccent">
|
||||||
android:hint="@string/hint_generated_password"
|
|
||||||
android:inputType="textPassword|textMultiLine"
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
tools:ignore="TextFields" />
|
android:id="@+id/password"
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ems="10"
|
||||||
|
android:hint="@string/hint_generated_password"
|
||||||
|
android:importantForAccessibility="no"
|
||||||
|
android:importantForAutofill="no"
|
||||||
|
android:inputType="textPassword|textMultiLine"
|
||||||
|
android:maxLines="3"
|
||||||
|
tools:ignore="TextFields" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
|
android:id="@+id/password_copy_button"
|
||||||
|
style="@style/KeepassDXStyle.ImageButton.Simple"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:contentDescription="@string/menu_copy"
|
||||||
|
android:src="@drawable/ic_content_copy_white_24dp" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatButton
|
<androidx.appcompat.widget.AppCompatButton
|
||||||
android:id="@+id/generate_password_button"
|
android:id="@+id/generate_password_button"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
* Copy password from generator #697
|
||||||
* Fix Magikeyboard not fully visible #772
|
* Fix Magikeyboard not fully visible #772
|
||||||
* Fix change font size #770
|
* Fix change font size #770
|
||||||
* Small fixes #771
|
* Small fixes #771
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
* Copie du mot de passe depuis le générateur #697
|
||||||
* Correction Magiclavier non complètement visible #772
|
* Correction Magiclavier non complètement visible #772
|
||||||
* Correction du changement de police #770
|
* Correction du changement de police #770
|
||||||
* Petites corrections #771
|
* Petites corrections #771
|
||||||
|
|||||||
Reference in New Issue
Block a user