[UI/App] Add Open repo button in build info dialog.

This commit is contained in:
Kuba Szczodrzyński 2021-03-28 22:54:18 +02:00
parent 76838fcc41
commit 93233f6afa
2 changed files with 9 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import okhttp3.Request
import pl.szczodrzynski.edziennik.*
import pl.szczodrzynski.edziennik.data.api.szkolny.interceptor.Signing
import pl.szczodrzynski.edziennik.ui.modules.base.BuildInvalidActivity
import pl.szczodrzynski.edziennik.utils.Utils
class BuildManager(val app: App) : CoroutineScope {
@ -109,6 +110,13 @@ class BuildManager(val app: App) : CoroutineScope {
.setTitle(R.string.build_details)
.setMessage(message)
.setPositiveButton(R.string.ok, null)
.setNeutralButton(R.string.build_dialog_open_repo) { _, _ ->
val url = if (gitRemote == null)
"https://szkolny.eu/github/android"
else
"https://github.com/$gitRemote"
Utils.openUrl(activity, url)
}
.show()
}

View File

@ -1423,4 +1423,5 @@
<string name="build_invalid_title">Informacja dotycząca wersji aplikacji</string>
<string name="settings_about_version_details_text">Szczegóły wersji</string>
<string name="settings_about_version_details_subtext">Informacje o kompilacji</string>
<string name="build_dialog_open_repo">Sprawdź kod</string>
</resources>