Merge pull request #969 from digitalheir/minimize-after-copy

Minimize or Close app after copying OTP #805
This commit is contained in:
Alexander Bakker 2022-09-17 17:55:25 +02:00 committed by GitHub
commit 714459c528
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 0 deletions

View file

@ -355,6 +355,10 @@ public class Preferences {
return _prefs.getBoolean("pref_copy_on_tap", false);
}
public boolean isMinimizeOnCopyEnabled() {
return _prefs.getBoolean("pref_minimize_on_copy", false);
}
public void setGroupFilter(List<String> groupFilter) {
JSONArray json = new JSONArray(groupFilter);
_prefs.edit().putString("pref_group_filter", json.toString()).apply();

View file

@ -948,6 +948,9 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
clip.getDescription().setExtras(extras);
}
clipboard.setPrimaryClip(clip);
if (_prefs.isMinimizeOnCopyEnabled()) {
moveTaskToBack(true);
}
}
private class ActionModeCallbacks implements ActionMode.Callback {

View file

@ -280,6 +280,8 @@
<string name="pref_highlight_entry_title">Highlight tokens when tapped</string>
<string name="pref_highlight_entry_summary">Make tokens easier to distinguish from each other by temporarily highlighting them when tapped</string>
<string name="pref_minimize_on_copy_title">Minimize on copy</string>
<string name="pref_minimize_on_copy_summary">Minimize the app after copying a token</string>
<string name="pref_copy_on_tap_title">Copy tokens when tapped</string>
<string name="pref_copy_on_tap_summary">Copy tokens to the clipboard by tapping them</string>
<string name="pref_pause_entry_title">Freeze tokens when tapped</string>

View file

@ -8,6 +8,12 @@
android:title="@string/pref_focus_search"
android:summary="@string/pref_focus_search_summary"
app:iconSpaceReserved="false"/>
<androidx.preference.SwitchPreferenceCompat
android:defaultValue="false"
android:key="pref_minimize_on_copy"
android:title="@string/pref_minimize_on_copy_title"
android:summary="@string/pref_minimize_on_copy_summary"
app:iconSpaceReserved="false"/>
<androidx.preference.SwitchPreferenceCompat
android:defaultValue="false"
android:key="pref_copy_on_tap"