diff --git a/app/src/main/java/org/fdroid/fdroid/views/AppDetailsActivity.java b/app/src/main/java/org/fdroid/fdroid/views/AppDetailsActivity.java index 971b3b812..b03988fec 100644 --- a/app/src/main/java/org/fdroid/fdroid/views/AppDetailsActivity.java +++ b/app/src/main/java/org/fdroid/fdroid/views/AppDetailsActivity.java @@ -250,12 +250,15 @@ public class AppDetailsActivity extends AppCompatActivity MenuItem itemIgnoreAll = menu.findItem(R.id.action_ignore_all); itemIgnoreAll.setChecked(prefs.getIgnoreAllUpdates()); MenuItem itemIgnoreThis = menu.findItem(R.id.action_ignore_this); + MenuItem itemBeta = menu.findItem(R.id.action_release_channel_beta); if (itemIgnoreAll.isChecked()) { itemIgnoreThis.setEnabled(false); + itemBeta.setEnabled(false); } else if (app != null && versions != null) { itemIgnoreThis.setVisible(app.hasUpdates(versions, appPrefs)); itemIgnoreThis.setChecked(prefs.shouldIgnoreUpdate(app.autoInstallVersionCode)); } + itemBeta.setChecked(prefs.getReleaseChannels().contains(Apk.RELEASE_CHANNEL_BETA)); return true; } @@ -328,6 +331,13 @@ public class AppDetailsActivity extends AppCompatActivity db.getAppPrefsDao().update(prefs.toggleIgnoreVersionCodeUpdate(app.autoInstallVersionCode))); AppUpdateStatusManager.getInstance(this).checkForUpdates(); return true; + } else if (item.getItemId() == R.id.action_release_channel_beta) { + final AppPrefs prefs = Objects.requireNonNull(appPrefs); + Utils.runOffUiThread(() -> { + db.getAppPrefsDao().update(prefs.toggleReleaseChannel(Apk.RELEASE_CHANNEL_BETA)); + return true; // we don't really care about the result here + }, result -> AppUpdateStatusManager.getInstance(this).checkForUpdates()); + return true; } else if (item.getItemId() == android.R.id.home) { onBackPressed(); return true; diff --git a/app/src/main/res/menu/details2.xml b/app/src/main/res/menu/details2.xml index f2563afa2..69c19837a 100644 --- a/app/src/main/res/menu/details2.xml +++ b/app/src/main/res/menu/details2.xml @@ -19,4 +19,9 @@ android:title="@string/menu_ignore_this" android:checkable="true" app:showAsAction="never" /> + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 37531d9dd..e0a4f7dc5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -223,6 +223,7 @@ This often occurs with apps installed via Google Play or other sources, if they Select for wipe Ignore All Updates Ignore This Update + Allow Beta Updates Website E-Mail Author