Group version info at top

This commit is contained in:
arkon 2020-04-22 23:12:18 -04:00
parent 6de00b1f21
commit f71708e5c5

View File

@ -25,6 +25,7 @@ import eu.kanade.tachiyomi.util.preference.defaultValue
import eu.kanade.tachiyomi.util.preference.onChange
import eu.kanade.tachiyomi.util.preference.onClick
import eu.kanade.tachiyomi.util.preference.preference
import eu.kanade.tachiyomi.util.preference.preferenceCategory
import eu.kanade.tachiyomi.util.preference.summaryRes
import eu.kanade.tachiyomi.util.preference.switchPreference
import eu.kanade.tachiyomi.util.preference.titleRes
@ -73,6 +74,27 @@ class AboutController : SettingsController() {
isVisible = false
}
}
preference {
titleRes = R.string.version
summary = if (BuildConfig.DEBUG)
"Preview r${BuildConfig.COMMIT_COUNT} (${BuildConfig.COMMIT_SHA})"
else
"Stable ${BuildConfig.VERSION_NAME}"
if (isUpdaterEnabled) {
onClick { checkVersion() }
}
}
preference {
titleRes = R.string.build_time
summary = getFormattedBuildTime()
onClick {
ChangelogDialogController().showDialog(router)
}
}
preferenceCategory {
preference {
titleRes = R.string.website
val url = "https://tachiyomi.org"
@ -100,25 +122,6 @@ class AboutController : SettingsController() {
startActivity(intent)
}
}
preference {
titleRes = R.string.version
summary = if (BuildConfig.DEBUG)
"Preview r${BuildConfig.COMMIT_COUNT} (${BuildConfig.COMMIT_SHA})"
else
"Stable ${BuildConfig.VERSION_NAME}"
if (isUpdaterEnabled) {
onClick { checkVersion() }
}
}
preference {
titleRes = R.string.build_time
summary = getFormattedBuildTime()
onClick {
ChangelogDialogController().showDialog(router)
}
}
preference {
titleRes = R.string.licenses
@ -127,6 +130,7 @@ class AboutController : SettingsController() {
}
}
}
}
/**
* Checks version and shows a user prompt if an update is available.