mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-04-20 06:47:06 -04:00
[app] Expose beta release channel in the app details UI
This commit is contained in:
committed by
Hans-Christoph Steiner
parent
acafbbaa65
commit
0a7debeb30
@@ -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;
|
||||
|
||||
@@ -19,4 +19,9 @@
|
||||
android:title="@string/menu_ignore_this"
|
||||
android:checkable="true"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/action_release_channel_beta"
|
||||
android:title="@string/menu_release_channel_beta"
|
||||
android:checkable="true"
|
||||
app:showAsAction="never" />
|
||||
</menu>
|
||||
|
||||
@@ -223,6 +223,7 @@ This often occurs with apps installed via Google Play or other sources, if they
|
||||
<string name="menu_select_for_wipe">Select for wipe</string>
|
||||
<string name="menu_ignore_all">Ignore All Updates</string>
|
||||
<string name="menu_ignore_this">Ignore This Update</string>
|
||||
<string name="menu_release_channel_beta">Allow Beta Updates</string>
|
||||
<string name="menu_website">Website</string>
|
||||
<string name="menu_email">E-Mail Author</string>
|
||||
<!-- The title for the link that points to the issue tracker for this app -->
|
||||
|
||||
Reference in New Issue
Block a user