Skip to content

Commit

Permalink
Expose default release channel setting
Browse files Browse the repository at this point in the history
  • Loading branch information
t895 authored and thestinger committed Oct 30, 2024
1 parent bbb8468 commit 0d5fd28
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ object PackageStates : LifecycleEventObserver {
}
}

// TODO: surface in UI
var defaultReleaseChannel: ReleaseChannel = ReleaseChannel.valueOf(
prefs.getString(defaultReleaseChannelPrefsKey, ReleaseChannel.stable.name)!!
); private set
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/res/values/prefs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,19 @@
<item>Unmetered</item>
</string-array>

<!-- Keep this in sync with Repo.kt::ReleaseChannel and its order -->
<string name="pref_key_default_release_channel">default_release_channel</string>
<string-array name="pref_release_channels">
<item>@string/release_channel_stable</item>
<item>@string/release_channel_beta</item>
<item>@string/release_channel_alpha</item>
</string-array>
<string name="pref_def_release_channel">stable</string>
<string-array name="pref_release_channel_values">
<item>stable</item>
<item>beta</item>
<item>alpha</item>
</string-array>

<string name="pref_key_always_allow_nocode_updates">always_allow_nocode_updates</string>
<bool name="pref_def_always_allow_noCode_updates">true</bool>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<string name="search">Search</string>

<string name="release_channel">Release channel</string>
<string name="default_release_channel">Default release channel</string>
<string name="release_channel_alpha">Alpha</string>
<string name="release_channel_beta">Beta</string>
<string name="release_channel_stable">Stable</string>
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/res/xml/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
app:key="@string/pref_key_background_update_check_interval"
app:defaultValue="@string/pref_def_background_update_check_interval" />

<ListPreference
app:title="@string/default_release_channel"
app:useSimpleSummaryProvider="true"
app:key="@string/pref_key_default_release_channel"
app:entries="@array/pref_release_channels"
app:entryValues="@array/pref_release_channel_values"
app:defaultValue="@string/pref_def_release_channel" />

<SwitchPreferenceCompat
app:title="@string/pref_auto_update_packages"
app:dependency="@string/pref_key_background_update_check"
Expand Down

0 comments on commit 0d5fd28

Please sign in to comment.