Reset hints

This commit is contained in:
M66B 2020-03-21 09:16:49 +01:00
parent 94031f889b
commit 2dcdc264b9
4 changed files with 9 additions and 11 deletions

View File

@ -53,6 +53,7 @@ import java.util.Map;
abstract class ActivityBase extends AppCompatActivity implements SharedPreferences.OnSharedPreferenceChangeListener {
private Context originalContext;
private boolean visible;
private boolean contacts;
private List<IKeyPressedListener> keyPressedListeners = new ArrayList<>();
@ -235,6 +236,8 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
protected void onResume() {
Log.d("Resume " + this.getClass().getName());
visible = true;
boolean contacts = hasPermission(Manifest.permission.READ_CONTACTS);
if (!this.getClass().equals(ActivitySetup.class) && this.contacts != contacts) {
Log.i("Contacts permission=" + contacts);
@ -251,6 +254,8 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
Log.d("Pause " + this.getClass().getName());
super.onPause();
visible = false;
if (!this.getClass().equals(ActivityMain.class) && Helper.shouldAuthenticate(this))
finishAndRemoveTask();
}
@ -367,7 +372,7 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
finish();
if (this.getClass().equals(ActivitySetup.class))
startActivity(getIntent());
} else if (!this.getClass().equals(ActivitySetup.class) &&
} else if (!this.getClass().equals(ActivitySetup.class) && !visible &&
Arrays.asList(FragmentOptions.OPTIONS_RESTART).contains(key))
finish();
}

View File

@ -253,15 +253,6 @@ public class ApplicationEx extends Application {
editor.putBoolean("highlight_unread", highlight_unread);
}
if (BuildConfig.DEBUG && false) {
editor.remove("app_support");
editor.remove("notify_archive");
editor.remove("message_swipe");
editor.remove("message_select");
editor.remove("folder_actions");
editor.remove("folder_sync");
}
if (version < BuildConfig.VERSION_CODE)
editor.putInt("previous_version", version);
editor.putInt("version", BuildConfig.VERSION_CODE);

View File

@ -42,6 +42,7 @@ public class FragmentOptions extends FragmentBase {
private PagerAdapter adapter;
static String[] OPTIONS_RESTART = new String[]{
"first", "app_support", "notify_archive", "message_swipe", "message_select", "folder_actions", "folder_sync",
"subscriptions",
"landscape", "landscape3", "startup", "cards", "indentation", "date", "threading", "highlight_unread", "color_stripe",
"avatars", "gravatars", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold",

View File

@ -82,7 +82,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
};
private final static String[] RESET_QUESTIONS = new String[]{
"welcome", "crash_reports_asked", "review_asked", "review_later", "why",
"welcome", "first", "app_support", "notify_archive", "message_swipe", "message_select", "folder_actions", "folder_sync",
"crash_reports_asked", "review_asked", "review_later", "why",
"reply_hint", "html_always_images", "print_html_confirmed", "move_1_confirmed", "move_n_confirmed",
"identities_asked", "cc_bcc", "inline_image_hint", "compose_reference", "send_dialog",
"setup_advanced"