diff options
author | David Luhmer <david-dev@live.de> | 2021-10-27 16:47:00 +0300 |
---|---|---|
committer | David Luhmer <david-dev@live.de> | 2021-10-27 16:47:00 +0300 |
commit | 3761e77a6ed4c321a9f20aedc408c6eb8a3c6067 (patch) | |
tree | 541c720be0a710247d2503494d022e07bb1b6814 /News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java | |
parent | 2e23cfbaea9f636ba643eed6a7fcc13b32f4b833 (diff) |
refactor intent exposure
Diffstat (limited to 'News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java')
-rw-r--r-- | News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java index 3cccfc91..10f5ad70 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java @@ -912,7 +912,8 @@ public class NewsReaderListActivity extends PodcastFragmentActivity implements } if (requestCode == RESULT_LOGIN) { - Intent intent = getIntent().putExtra(PREF_SERVER_SETTINGS, true); + Intent intent = new Intent(); + intent.putExtra(PREF_SERVER_SETTINGS, true); setResult(RESULT_OK, intent); } @@ -981,12 +982,16 @@ public class NewsReaderListActivity extends PodcastFragmentActivity implements } private void ensureCorrectTheme(Intent data) { - String oldListLayout = data.getStringExtra(SettingsActivity.AI_FEED_LIST_LAYOUT); - String newListLayout = mPrefs.getString(SettingsActivity.SP_FEED_LIST_LAYOUT, "0"); + String oldListLayout = data.getStringExtra(SettingsActivity.RI_FEED_LIST_LAYOUT); + String newListLayout = mPrefs.getString(SettingsActivity.SP_FEED_LIST_LAYOUT, "0"); + boolean themeChanged = !newListLayout.equals(oldListLayout); + boolean cacheWasCleared = data.hasExtra(SettingsActivity.RI_CACHE_CLEARED); - if (ThemeChooser.themeRequiresRestartOfUI() || !newListLayout.equals(oldListLayout)) { + Log.d(TAG, "themeChanged: " + themeChanged + " cacheWasCleared: " + cacheWasCleared); + + if (ThemeChooser.themeRequiresRestartOfUI() || themeChanged) { NewsReaderListActivity.this.recreate(); - } else if (data.hasExtra(SettingsActivity.CACHE_CLEARED)) { + } else if (cacheWasCleared) { resetUiAndStartSync(); } } |