From e0d291ae0ea58e1855508655cad96af94b18e525 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 1 Sep 2020 12:29:33 -0700 Subject: [PATCH] open wordlists browser even without Storage permission and add a na-key to rationale for storage permissions so don't ask forever when user wants to decline. --- .../eehouse/android/xw4/DictsDelegate.java | 19 +++++++++++++++++-- .../app/src/main/res/values/common_rsrc.xml | 1 + .../app/src/main/res/values/strings.xml | 4 ++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictsDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictsDelegate.java index caee91ed3..cd084d2da 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictsDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictsDelegate.java @@ -524,8 +524,9 @@ public class DictsDelegate extends ListDelegateBase makeNotAgainBuilder( R.string.not_again_dicts, R.string.key_na_dicts ) .show(); - tryGetPerms( Perm.STORAGE, R.string.dicts_storage_rationale, - Action.STORAGE_CONFIRMED ); + Perms23.tryGetPermsNA( this, Perm.STORAGE, R.string.dicts_storage_rationale, + R.string.key_na_perms_storage_dicts, + Action.STORAGE_CONFIRMED ); } // init @Override @@ -944,6 +945,20 @@ public class DictsDelegate extends ListDelegateBase return handled; } + @Override + public boolean onNegButton( Action action, Object[] params ) + { + boolean handled = true; + switch ( action ) { + case STORAGE_CONFIRMED: + mkListAdapter(); + break; + default: + handled = super.onNegButton( action, params ); + } + return handled; + } + private DictLoc itemToRealLoc( int item ) { item += DictLoc.INTERNAL.ordinal(); diff --git a/xwords4/android/app/src/main/res/values/common_rsrc.xml b/xwords4/android/app/src/main/res/values/common_rsrc.xml index 039a233ff..683318f11 100644 --- a/xwords4/android/app/src/main/res/values/common_rsrc.xml +++ b/xwords4/android/app/src/main/res/values/common_rsrc.xml @@ -154,6 +154,7 @@ key_na_sms_banned key_na_longtap_lookup key_na_perms_phonestate + key_na_perms_storage_dicts key_na_newFeatureFilter key_na_dupstatus_host diff --git a/xwords4/android/app/src/main/res/values/strings.xml b/xwords4/android/app/src/main/res/values/strings.xml index 5e9ec6b29..693ab67e8 100644 --- a/xwords4/android/app/src/main/res/values/strings.xml +++ b/xwords4/android/app/src/main/res/values/strings.xml @@ -2426,9 +2426,9 @@ still be able to receive invitations if you don’t grant this permission, but only the phone number of the sender will be displayed. - + Storing a wordlist in the - Downloads area requires permission. + Downloads area requires Storage permission. Remove SMS