Merge pull request #392 from Ullas-Aithal/feature/373
Implemented #373. Added code to move the activity to background after copy to clipboard is selected.
This commit is contained in:
commit
75f2ce95a3
6 changed files with 21 additions and 3 deletions
|
@ -390,7 +390,8 @@ public class MainActivity extends BaseActivity
|
|||
if (key.equals(getString(R.string.settings_key_label_size)) ||
|
||||
key.equals(getString(R.string.settings_key_label_scroll)) ||
|
||||
key.equals(getString(R.string.settings_key_split_group_size)) ||
|
||||
key.equals(getString(R.string.settings_key_thumbnail_size))) {
|
||||
key.equals(getString(R.string.settings_key_thumbnail_size)) ||
|
||||
key.equals(getString(R.string.settings_key_minimize_on_copy))) {
|
||||
adapter.notifyDataSetChanged();
|
||||
} else if (key.equals(getString(R.string.settings_key_search_includes))) {
|
||||
adapter.clearFilter();
|
||||
|
|
|
@ -547,6 +547,10 @@ public class Settings {
|
|||
return getBoolean(R.string.settings_key_backup_append_date_time, false);
|
||||
}
|
||||
|
||||
public boolean isMinimizeAppOnCopyEnabled() {
|
||||
return getBoolean(R.string.settings_key_minimize_on_copy, false);
|
||||
}
|
||||
|
||||
private Constants.AutoBackup getAutoBackupEncryptedSetting() {
|
||||
String stringValue = getString(R.string.settings_key_auto_backup_password_enc, R.string.settings_default_auto_backup_password_enc);
|
||||
return Constants.AutoBackup.valueOf(stringValue.toUpperCase(Locale.ENGLISH));
|
||||
|
|
|
@ -49,6 +49,7 @@ import android.widget.GridView;
|
|||
import android.widget.LinearLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.shadowice.flocke.andotp.Activities.MainActivity;
|
||||
import org.shadowice.flocke.andotp.Database.Entry;
|
||||
import org.shadowice.flocke.andotp.Dialogs.TagsDialog;
|
||||
import org.shadowice.flocke.andotp.R;
|
||||
|
@ -270,6 +271,9 @@ public class EntriesCardAdapter extends RecyclerView.Adapter<EntryViewHolder>
|
|||
public void onCopyButtonClicked(String text, int position) {
|
||||
copyToClipboard(text);
|
||||
updateLastUsed(position, getRealIndex(position));
|
||||
if(context != null && settings.isMinimizeAppOnCopyEnabled()) {
|
||||
((MainActivity)context).moveTaskToBack(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -24,12 +24,14 @@
|
|||
<string name="settings_key_label_size" translatable="false">pref_label_size_sp</string>
|
||||
<string name="settings_key_card_layout" translatable="false">pref_card_layout</string>
|
||||
<string name="settings_key_label_scroll" translatable="false">pref_label_scroll</string>
|
||||
<string name="settings_key_minimize_on_copy" translatable="false">pref_minimize_on_copy</string>
|
||||
<string name="settings_key_thumbnail_size" translatable="false">pref_thumbnail_size</string>
|
||||
<string name="settings_key_split_group_size" translatable="false">pref_split_group_size</string>
|
||||
<string name="settings_key_tag_functionality" translatable="false">pref_tag_functionality</string>
|
||||
<string name="settings_key_search_includes" translatable="false">pref_search_includes</string>
|
||||
<string name="settings_key_label_highlight_token" translatable="false">pref_label_highlight_token</string>
|
||||
|
||||
|
||||
<string name="settings_key_backup_append_date_time" translatable="false">pref_backup_append_date_time</string>
|
||||
<string name="settings_key_backup_ask" translatable="false">pref_backup_ask</string>
|
||||
<string name="settings_key_backup_directory" translatable="false">pref_backup_directory</string>
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
<string name="settings_title_thumbnail_size_ask">Thumbnail size</string>
|
||||
<string name="settings_title_split_group_size">Split Token with space</string>
|
||||
<string name="settings_title_tag_functionality">Tag selection behavior</string>
|
||||
<string name="settings_title_minimize_on_copy">Minimize app after copying OTP</string>
|
||||
<string name="settings_title_search_includes">Search behavior</string>
|
||||
<string name="settings_title_label_highlight_token">Highlight expiring tokens</string>
|
||||
|
||||
|
@ -58,6 +59,7 @@
|
|||
services. <b>DO NOT enable this if you rely on the accessibility services!</b></string>
|
||||
|
||||
<string name="settings_desc_label_scroll">Scroll overlong labels instead of truncating them</string>
|
||||
<string name="settings_desc_minimize_on_copy">App will be minimized when you copy the OTP to clipboard</string>
|
||||
<string name="settings_desc_search_includes">Specify which values should be included when searching</string>
|
||||
<string name="settings_desc_label_highlight_token">Highlights token in red if it\'s expiring in 8 seconds</string>
|
||||
|
||||
|
|
|
@ -119,6 +119,12 @@
|
|||
android:entryValues="@array/settings_values_tag_functionality"
|
||||
android:defaultValue="@string/settings_default_tag_functionality" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="@string/settings_key_minimize_on_copy"
|
||||
android:title="@string/settings_title_minimize_on_copy"
|
||||
android:summary="@string/settings_desc_minimize_on_copy"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<MultiSelectListPreference
|
||||
android:key="@string/settings_key_search_includes"
|
||||
android:title="@string/settings_title_search_includes"
|
||||
|
@ -133,7 +139,6 @@
|
|||
android:summary="@string/settings_desc_label_highlight_token"
|
||||
android:defaultValue="true" />
|
||||
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
|
|
Loading…
Reference in a new issue