Switch to AboutLibraries

This commit is contained in:
arkon
2020-06-08 18:26:20 -04:00
parent ec9d592cf1
commit 7753161332
5 changed files with 16 additions and 51 deletions

View File

@@ -5,10 +5,9 @@ import android.content.Intent
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.webkit.WebView
import androidx.preference.PreferenceScreen
import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.customview.customView
import com.mikepenz.aboutlibraries.LibsBuilder
import eu.kanade.tachiyomi.BuildConfig
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.updater.UpdateChecker
@@ -130,7 +129,12 @@ class AboutController : SettingsController() {
titleRes = R.string.licenses
onClick {
LicensesDialogController().showDialog(router)
LibsBuilder()
.withActivityTitle(activity!!.getString(R.string.licenses))
.withAboutIconShown(false)
.withAboutVersionShown(false)
.withLicenseShown(true)
.start(activity!!)
}
}
}
@@ -165,19 +169,6 @@ class AboutController : SettingsController() {
}
}
class LicensesDialogController(bundle: Bundle? = null) : DialogController(bundle) {
override fun onCreateDialog(savedViewState: Bundle?): Dialog {
val webView = WebView(activity!!)
webView.loadUrl("file:///android_asset/open_source_licenses.html")
return MaterialDialog(activity!!)
.title(res = R.string.licenses)
.customView(view = webView)
.positiveButton(res = android.R.string.ok)
}
}
class NewUpdateDialogController(bundle: Bundle? = null) : DialogController(bundle) {
constructor(body: String, url: String) : this(

View File

@@ -369,7 +369,7 @@
<string name="cookies_cleared">Cookies cleared</string>
<string name="choices_reset">Dialog choices reset</string>
<string name="pref_clear_database">Clear database</string>
<string name="pref_clear_database_summary">Delete history for manga that are not in saved your library</string>
<string name="pref_clear_database_summary">Delete history for manga that are not saved in your library</string>
<string name="clear_database_confirmation">Are you sure? Read chapters and progress of non-library manga will be lost</string>
<string name="clear_database_completed">Entries deleted</string>
<string name="pref_refresh_library_covers">Refresh library manga covers</string>