add setting for updating to prereleases

This commit is contained in:
Cloudburst 2021-08-17 15:23:50 +02:00
parent 8f511a8707
commit 64b302132c
4 changed files with 30 additions and 0 deletions

View File

@ -41,6 +41,16 @@ class InAppUpdater {
@JsonProperty("prerelease") var prerelease: Boolean,
)
data class GithubObject(
@JsonProperty("sha") val sha: String, // sha 256 hash
@JsonProperty("type") val type: String, // object type
@JsonProperty("url") val url: String,
)
data class GithubTag(
@JsonProperty("object") val object: GithubObject,
)
data class Update(
@JsonProperty("shouldUpdate") val shouldUpdate: Boolean,
@JsonProperty("updateURL") val updateURL: String?,

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M7,5h10v2h2L19,3c0,-1.1 -0.9,-1.99 -2,-1.99L7,1c-1.1,0 -2,0.9 -2,2v4h2L7,5zM15.41,16.59L20,12l-4.59,-4.59L14,8.83 17.17,12 14,15.17l1.41,1.42zM10,15.17L6.83,12 10,8.83 8.59,7.41 4,12l4.59,4.59L10,15.17zM17,19L7,19v-2L5,17v4c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2v-4h-2v2z"/>
</vector>

View File

@ -84,5 +84,8 @@
<string name="search_provider_text_providers">Search using providers</string>
<string name="search_provider_text_types">Search using types</string>
<string name="auto_update_key">auto_update</string>
<string name="prerelease_update_key">prerelease_update</string>
<string name="manual_check_update_key">manual_check_update</string>
<string name="prerelease_commit_hash">unknown_prerelease</string>
</resources>

View File

@ -91,6 +91,13 @@
app:defaultValue="true"
android:icon="@drawable/ic_baseline_notifications_active_24"
/>
<SwitchPreference
app:key="@string/prerelease_update_key"
android:title="Update to prereleases"
android:summary="Search for prerelease updates instead of full releases only"
app:defaultValue="false"
android:icon="@drawable/ic_baseline_developer_mode_24"
/>
<Preference
android:title="Check for Update"
app:key="@string/manual_check_update_key"