Added preference to change password

Closes #20
This commit is contained in:
Michael Schättgen 2018-10-10 20:41:37 +02:00
parent 8b6d2694cc
commit 461e4a2d41
3 changed files with 19 additions and 0 deletions

View file

@ -162,6 +162,15 @@ public class PreferencesFragment extends PreferenceFragmentCompat implements Pas
return false;
}
});
Preference setPasswordPreference = findPreference("pref_password");
setPasswordPreference.setOnPreferenceClickListener(preference -> {
PasswordDialogFragment dialog = new PasswordDialogFragment();
// TODO: find a less ugly way to obtain the fragment manager
dialog.show(getActivity().getSupportFragmentManager(), null);
return false;
});
_slotsPreference = findPreference("pref_slots");
_slotsPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override

View file

@ -27,6 +27,8 @@
<string name="pref_secure_screen_summary">Block screenshots and other attempts to capture the screen within the app</string>
<string name="pref_encryption_title">Encryption</string>
<string name="pref_encryption_summary">Encrypt the database and unlock it with a password or fingerprint</string>
<string name="pref_set_password_title">Change password</string>
<string name="pref_set_password_summary">Set a new password which you will need to unlock your vault</string>
<string name="fingerprint_hint">Touch sensor</string>
<string name="fingerprint_not_recognized">Fingerprint not recognized. Try again.</string>

View file

@ -45,6 +45,14 @@
android:summary="@string/pref_encryption_summary"
android:persistent="false"
app:iconSpaceReserved="false"/>
<Preference
android:key="pref_password"
android:title="@string/pref_set_password_title"
android:summary="@string/pref_set_password_summary"
android:dependency="pref_encryption"
app:iconSpaceReserved="false"/>
<Preference
android:key="pref_slots"
android:title="@string/pref_slots_title"