diff --git a/app/src/main/java/me/impy/aegis/ui/PreferencesActivity.java b/app/src/main/java/me/impy/aegis/ui/PreferencesActivity.java index f059e52d..f7717a86 100644 --- a/app/src/main/java/me/impy/aegis/ui/PreferencesActivity.java +++ b/app/src/main/java/me/impy/aegis/ui/PreferencesActivity.java @@ -2,6 +2,7 @@ package me.impy.aegis.ui; import android.content.Intent; import android.os.Bundle; +import android.preference.EditTextPreference; import android.preference.Preference; import android.preference.PreferenceFragment; import android.widget.Toast; @@ -91,6 +92,16 @@ public class PreferencesActivity extends AegisActivity { } }); + EditTextPreference timeoutPreference = (EditTextPreference) findPreference("pref_timeout"); + timeoutPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { + @Override + public boolean onPreferenceChange(Preference preference, Object newValue) { + preference.setSummary(String.format(getString(R.string.pref_timeout_summary), (String) newValue)); + return true; + } + }); + timeoutPreference.getOnPreferenceChangeListener().onPreferenceChange(timeoutPreference, timeoutPreference.getText()); + Preference issuerPreference = findPreference("pref_issuer"); issuerPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5bad2312..94afbe47 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -6,11 +6,20 @@ Discard Save IntroActivity + Preferences - Night mode - Enable this to use darker colors - Show the issuer - Enable this to show the issuer next to the profile name + Night mode + Enable this to use darker colors + Show the issuer + Enable this to show the issuer next to the profile name + Timeout + Automatically lock the database after %1$s seconds of inactivity + Key slots + Manage the list of keys that can decrypt the database + Import + Import a database + Export + Export the database Touch sensor Fingerprint not recognized. Try again diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index d4bf5d19..da5ebeab 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -7,34 +7,41 @@ + android:title="@string/pref_night_mode_title" + android:summary="@string/pref_night_mode_summary"/> + android:title="@string/pref_issuer_title" + android:summary="@string/pref_issuer_summary"/> + + android:title="@string/pref_slots_title" + android:summary="@string/pref_slots_summary"/> + android:title="@string/pref_import_title" + android:summary="@string/pref_import_summary"/> + android:title="@string/pref_export_title" + android:summary="@string/pref_export_summary"/>