Updates to About Controller
Removed option to disable crash reports Added What's new: linking to the github release Link to website Fixed Build Time Added open source licenese
This commit is contained in:
parent
879a9c735c
commit
5ce1b8dd50
6 changed files with 69 additions and 21 deletions
|
@ -5,6 +5,7 @@ import java.time.format.DateTimeFormatter
|
|||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("com.google.android.gms.oss-licenses-plugin")
|
||||
kotlin("android")
|
||||
kotlin("android.extensions")
|
||||
kotlin("kapt")
|
||||
|
@ -243,6 +244,8 @@ dependencies {
|
|||
|
||||
// Text distance
|
||||
implementation("info.debatty:java-string-similarity:1.2.1")
|
||||
|
||||
implementation("com.google.android.gms:play-services-oss-licenses:17.0.0")
|
||||
}
|
||||
|
||||
tasks.preBuild {
|
||||
|
|
|
@ -116,6 +116,13 @@
|
|||
android:name=".extension.util.ExtensionInstallActivity"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
|
||||
|
||||
<activity
|
||||
android:name="com.google.android.gms.oss.licenses.OssLicensesMenuActivity"
|
||||
android:theme="@style/Theme.OSS" />
|
||||
<activity
|
||||
android:name="com.google.android.gms.oss.licenses.OssLicensesActivity"
|
||||
android:theme="@style/Theme.OSS" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.provider"
|
||||
|
|
|
@ -6,6 +6,7 @@ import android.net.Uri
|
|||
import android.os.Bundle
|
||||
import androidx.preference.PreferenceScreen
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity
|
||||
import eu.kanade.tachiyomi.BuildConfig
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
|
@ -51,12 +52,16 @@ class SettingsAboutController : SettingsController() {
|
|||
override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) {
|
||||
titleRes = R.string.about
|
||||
|
||||
switchPreference {
|
||||
key = "acra.enable"
|
||||
titleRes = R.string.send_crash_report
|
||||
summaryRes = R.string.helps_fix_bugs
|
||||
defaultValue = true
|
||||
preference {
|
||||
titleRes = R.string.website
|
||||
val url = "https://tachiyomi.org"
|
||||
summary = url
|
||||
onClick {
|
||||
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
preference {
|
||||
title = "Discord"
|
||||
val url = "https://discord.gg/tachiyomi"
|
||||
|
@ -75,23 +80,45 @@ class SettingsAboutController : SettingsController() {
|
|||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
preference {
|
||||
titleRes = R.string.version
|
||||
summary = if (BuildConfig.DEBUG)
|
||||
"r" + BuildConfig.COMMIT_COUNT
|
||||
else
|
||||
BuildConfig.VERSION_NAME
|
||||
|
||||
if (isUpdaterEnabled) {
|
||||
onClick { checkVersion() }
|
||||
preferenceCategory {
|
||||
preference {
|
||||
titleRes = R.string.whats_new
|
||||
onClick {
|
||||
val intent = Intent(
|
||||
Intent.ACTION_VIEW, Uri.parse(
|
||||
if (BuildConfig.DEBUG) {
|
||||
"https://github.com/Jays2Kings/tachiyomiJ2K/commits/master"
|
||||
} else {
|
||||
"https://github.com/Jays2Kings/tachiyomiJ2K/releases/tag/v${BuildConfig.VERSION_NAME}"
|
||||
}
|
||||
)
|
||||
)
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
}
|
||||
preference {
|
||||
titleRes = R.string.build_time
|
||||
summary = getFormattedBuildTime()
|
||||
preference {
|
||||
titleRes = R.string.version
|
||||
summary = if (BuildConfig.DEBUG) "r" + BuildConfig.COMMIT_COUNT
|
||||
else BuildConfig.VERSION_NAME
|
||||
|
||||
onClick {
|
||||
ChangelogDialogController().showDialog(router)
|
||||
if (isUpdaterEnabled) {
|
||||
onClick { checkVersion() }
|
||||
}
|
||||
}
|
||||
preference {
|
||||
titleRes = R.string.build_time
|
||||
summary = getFormattedBuildTime()
|
||||
|
||||
onClick {
|
||||
ChangelogDialogController().showDialog(router)
|
||||
}
|
||||
}
|
||||
preference {
|
||||
titleRes = R.string.open_source_licenses
|
||||
|
||||
onClick {
|
||||
startActivity(Intent(activity, OssLicensesMenuActivity::class.java))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -159,7 +186,7 @@ class SettingsAboutController : SettingsController() {
|
|||
|
||||
private fun getFormattedBuildTime(): String {
|
||||
try {
|
||||
val inputDf = SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'", Locale.US)
|
||||
val inputDf = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", Locale.getDefault())
|
||||
inputDf.timeZone = TimeZone.getTimeZone("UTC")
|
||||
val buildTime = inputDf.parse(BuildConfig.BUILD_TIME) ?: return BuildConfig.BUILD_TIME
|
||||
|
||||
|
|
|
@ -532,6 +532,9 @@
|
|||
<string name="build_time">Build time</string>
|
||||
<string name="send_crash_report">Send crash reports</string>
|
||||
<string name="helps_fix_bugs">Helps fix any bugs. No sensitive data will be sent</string>
|
||||
<string name="whats_new">What\'s new in this release</string>
|
||||
<string name="website">Website</string>
|
||||
<string name="open_source_licenses">Open source licenses</string>
|
||||
|
||||
<!-- Login dialog -->
|
||||
<string name="log_in_to_">Log in to %1$s</string>
|
||||
|
|
|
@ -76,4 +76,10 @@
|
|||
<item name="android:windowLightStatusBar">false</item>
|
||||
<item name="android:windowLightNavigationBar" tools:targetApi="27">false</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.OSS" parent="Theme.MaterialComponents.DayNight">
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@android:color/black</item>
|
||||
<item name="android:colorEdgeEffect">@color/colorAccent</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
@ -16,6 +16,8 @@ pluginManagement {
|
|||
useModule("com.google.gms:google-services:4.3.3")
|
||||
}else if(requested.id.id.equals("com.github.zellius.shortcut-helper")){
|
||||
useModule("com.github.zellius:android-shortcut-gradle-plugin:0.1.2")
|
||||
}else if(requested.id.id.equals("com.google.android.gms.oss-licenses-plugin")){
|
||||
useModule("com.google.android.gms:oss-licenses-plugin:0.10.2")
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue