Added caption to password dialog

This commit is contained in:
M66B 2021-02-26 14:49:39 +01:00
parent 064ee0ba48
commit 8c3c160aa8
2 changed files with 67 additions and 48 deletions

View File

@ -1308,10 +1308,13 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
final boolean export = getArguments().getBoolean("export"); final boolean export = getArguments().getBoolean("export");
View dview = LayoutInflater.from(getContext()).inflate(R.layout.dialog_password, null); View dview = LayoutInflater.from(getContext()).inflate(R.layout.dialog_password, null);
TextView tvCaption = dview.findViewById(R.id.tvCaption);
etPassword1 = dview.findViewById(R.id.tilPassword1); etPassword1 = dview.findViewById(R.id.tilPassword1);
etPassword2 = dview.findViewById(R.id.tilPassword2); etPassword2 = dview.findViewById(R.id.tilPassword2);
TextView tvImportHint = dview.findViewById(R.id.tvImportHint); TextView tvImportHint = dview.findViewById(R.id.tvImportHint);
tvCaption.setText(export ? R.string.title_setup_export : R.string.title_setup_import);
if (savedInstanceState != null) { if (savedInstanceState != null) {
etPassword1.getEditText().setText(savedInstanceState.getString("fair:password1")); etPassword1.getEditText().setText(savedInstanceState.getString("fair:password1"));
etPassword2.getEditText().setText(savedInstanceState.getString("fair:password2")); etPassword2.getEditText().setText(savedInstanceState.getString("fair:password2"));

View File

@ -1,58 +1,74 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <eu.faircode.email.ScrollViewEx xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="24dp"> android:padding="24dp"
android:scrollbarStyle="outsideOverlay">
<com.google.android.material.textfield.TextInputLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/tilPassword1" android:layout_width="match_parent"
android:layout_width="0dp" android:layout_height="wrap_content">
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:passwordToggleEnabled="true">
<com.google.android.material.textfield.TextInputEditText <eu.faircode.email.FixedTextView
android:layout_width="match_parent" android:id="@+id/tvCaption"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:autofillHints="password" android:text="@string/title_setup_export"
android:hint="@string/title_setup_password" android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:imeOptions="actionNext" app:layout_constraintStart_toStartOf="parent"
android:inputType="textPassword" app:layout_constraintTop_toTopOf="parent" />
android:textAppearance="@style/TextAppearance.AppCompat.Medium">
<requestFocus /> <com.google.android.material.textfield.TextInputLayout
</com.google.android.material.textfield.TextInputEditText> android:id="@+id/tilPassword1"
</com.google.android.material.textfield.TextInputLayout> android:layout_width="0dp"
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilPassword2"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tilPassword1"
app:passwordToggleEnabled="true">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:autofillHints="password" android:layout_marginTop="24dp"
android:hint="@string/title_setup_password_repeat" app:layout_constraintEnd_toEndOf="parent"
android:imeOptions="actionDone" app:layout_constraintStart_toStartOf="parent"
android:inputType="textPassword" app:layout_constraintTop_toBottomOf="@+id/tvCaption"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" /> app:passwordToggleEnabled="true">
</com.google.android.material.textfield.TextInputLayout>
<eu.faircode.email.FixedTextView <com.google.android.material.textfield.TextInputEditText
android:id="@+id/tvImportHint" android:layout_width="match_parent"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:autofillHints="password"
android:layout_marginTop="12dp" android:hint="@string/title_setup_password"
android:text="@string/title_setup_import_do" android:imeOptions="actionNext"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:inputType="textPassword"
app:layout_constraintStart_toStartOf="parent" android:textAppearance="@style/TextAppearance.AppCompat.Medium">
app:layout_constraintTop_toBottomOf="@id/tilPassword2" />
</androidx.constraintlayout.widget.ConstraintLayout> <requestFocus />
</com.google.android.material.textfield.TextInputEditText>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilPassword2"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tilPassword1"
app:passwordToggleEnabled="true">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autofillHints="password"
android:hint="@string/title_setup_password_repeat"
android:imeOptions="actionDone"
android:inputType="textPassword"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
</com.google.android.material.textfield.TextInputLayout>
<eu.faircode.email.FixedTextView
android:id="@+id/tvImportHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_setup_import_do"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tilPassword2" />
</androidx.constraintlayout.widget.ConstraintLayout>
</eu.faircode.email.ScrollViewEx>