diff options
author | David-Development <david-dev@live.de> | 2022-02-19 11:42:31 +0300 |
---|---|---|
committer | David Luhmer <david-dev@live.de> | 2022-02-19 11:42:31 +0300 |
commit | 6cafa462a5bc314cdf373b4c796b99d437e72c3f (patch) | |
tree | 0c153e48a825d45c796c061d23be97ad1b933a89 | |
parent | 0d6f5a73482319e7601976d58ff3b51e7e377ab0 (diff) |
always show incognito mode icon when its activev.0.9.9.71
Signed-off-by: David Luhmer <david-dev@live.de>
6 files changed, 43 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b484780a..b35dd245 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +0.9.9.71 (Beta) +--------------------- +- Added - <a href="https://github.com/nextcloud/news-android/issues/1060">#1060 Always show incognito mode icon if incognito mode is enabled</a> + + 0.9.9.70 (Beta) --------------------- - Fixed - Try to fix more app crashes during sync (reduce number of items per sync) diff --git a/News-Android-App/build.gradle b/News-Android-App/build.gradle index 7e1095e0..3c4d970d 100644 --- a/News-Android-App/build.gradle +++ b/News-Android-App/build.gradle @@ -27,8 +27,8 @@ android { vectorDrawables.useSupportLibrary = true - versionCode 172 - versionName "0.9.9.69" + versionCode 174 + versionName "0.9.9.71" } buildFeatures { diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsDetailActivity.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsDetailActivity.java index fb18d86d..5b069c1a 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsDetailActivity.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsDetailActivity.java @@ -20,6 +20,8 @@ package de.luhmer.owncloudnewsreader; +import static java.util.Objects.requireNonNull; + import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.ApplicationInfo; @@ -63,8 +65,6 @@ import de.luhmer.owncloudnewsreader.model.TTSItem; import de.luhmer.owncloudnewsreader.view.PodcastSlidingUpPanelLayout; import de.luhmer.owncloudnewsreader.widget.WidgetProvider; -import static java.util.Objects.requireNonNull; - public class NewsDetailActivity extends PodcastFragmentActivity { @@ -91,6 +91,7 @@ public class NewsDetailActivity extends PodcastFragmentActivity { private MenuItem menuItem_PlayPodcast; private MenuItem menuItem_Starred; private MenuItem menuItem_Read; + private MenuItem menuItem_Incognito; private DatabaseConnectionOrm dbConn; protected ActivityNewsDetailBinding binding; @@ -423,6 +424,15 @@ public class NewsDetailActivity extends PodcastFragmentActivity { binding.faDetailBar.faMarkAsRead.setImageResource(darkIcons ? R.drawable.ic_checkbox_outline_black : R.drawable.ic_checkbox_outline_white); } } + + if (menuItem_Incognito != null) { + if (isIncognitoEnabled()) { + // always show incognito icon if incognito mode is enabled + menuItem_Incognito.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); + } else { + menuItem_Incognito.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); + } + } } @@ -443,6 +453,7 @@ public class NewsDetailActivity extends PodcastFragmentActivity { menuItem_Starred = menu.findItem(R.id.action_starred); menuItem_Read = menu.findItem(R.id.action_read); menuItem_PlayPodcast = menu.findItem(R.id.action_playPodcast); + menuItem_Incognito = menu.findItem(R.id.action_incognito_mode); if (mShowFastActions) { menuItem_Starred.setVisible(false); @@ -500,6 +511,7 @@ public class NewsDetailActivity extends PodcastFragmentActivity { this.share(currentPosition); } else if (itemId == R.id.action_incognito_mode) { toggleIncognitoMode(); + updateActionBarIcons(); } return super.onOptionsItemSelected(item); 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 10f5ad70..a3791ca4 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 @@ -388,9 +388,23 @@ public class NewsReaderListActivity extends PodcastFragmentActivity implements if (!isAccountThere) { //Then add the new account Account account = new Account(getString(R.string.app_name), accountType); - mAccountManager.addAccountExplicitly(account, "", new Bundle()); - SettingsFragment.setAccountSyncInterval(this, getResources().getInteger(R.integer.default_sync_minutes)); + try { + mAccountManager.addAccountExplicitly(account, "", new Bundle()); + + SettingsFragment.setAccountSyncInterval(this, getResources().getInteger(R.integer.default_sync_minutes)); + } catch (SecurityException exception) { + // not sure if this error can still occur.. it showed up a few versions ago.. so we'll + // keep it here just to be safe + new AlertDialog.Builder(this) + .setTitle("Failed to add account") + .setMessage("If you installed this app previously from anywhere else than the Google Play Store (e.g. F-Droid), please make sure to uninstall it first.") + .setPositiveButton(android.R.string.ok, (dialog, which) -> { + dialog.dismiss(); + }) + .setIcon(android.R.drawable.ic_dialog_alert) + .show(); + } } } diff --git a/fastlane/metadata/android/de-DE/changelogs/174.txt b/fastlane/metadata/android/de-DE/changelogs/174.txt new file mode 100644 index 00000000..d2a085e2 --- /dev/null +++ b/fastlane/metadata/android/de-DE/changelogs/174.txt @@ -0,0 +1,3 @@ +- Fixed - Try to fix more app crashes during sync (reduce number of items per sync) +- Fixed - Speedup detail view by not storing instance state of webview +- Changed - Always show incognito mode icon if incognito mode is enabled
\ No newline at end of file diff --git a/fastlane/metadata/android/en-US/changelogs/174.txt b/fastlane/metadata/android/en-US/changelogs/174.txt new file mode 100644 index 00000000..d2a085e2 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/174.txt @@ -0,0 +1,3 @@ +- Fixed - Try to fix more app crashes during sync (reduce number of items per sync) +- Fixed - Speedup detail view by not storing instance state of webview +- Changed - Always show incognito mode icon if incognito mode is enabled
\ No newline at end of file |