mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-14 20:39:59 -05:00
Show parsed Markdown for new version info (closes #6940)
This commit is contained in:
parent
c475acd1ea
commit
ef1bb4e800
5 changed files with 13 additions and 5 deletions
|
@ -234,6 +234,7 @@ dependencies {
|
|||
exclude(group = "androidx.viewpager", module = "viewpager")
|
||||
}
|
||||
implementation(libs.insetter)
|
||||
implementation(libs.markwon)
|
||||
|
||||
// Conductor
|
||||
implementation(libs.bundles.conductor)
|
||||
|
|
|
@ -121,6 +121,7 @@ class AboutController : SettingsController(), NoAppBarElevationController {
|
|||
is AppUpdateResult.NoNewUpdate -> {
|
||||
activity?.toast(R.string.update_check_no_new_updates)
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
} catch (error: Exception) {
|
||||
activity?.toast(error.message)
|
||||
|
|
|
@ -8,6 +8,7 @@ import eu.kanade.tachiyomi.R
|
|||
import eu.kanade.tachiyomi.data.updater.AppUpdateResult
|
||||
import eu.kanade.tachiyomi.data.updater.AppUpdateService
|
||||
import eu.kanade.tachiyomi.ui.base.controller.DialogController
|
||||
import io.noties.markwon.Markwon
|
||||
|
||||
class NewUpdateDialogController(bundle: Bundle? = null) : DialogController(bundle) {
|
||||
|
||||
|
@ -16,15 +17,18 @@ class NewUpdateDialogController(bundle: Bundle? = null) : DialogController(bundl
|
|||
)
|
||||
|
||||
override fun onCreateDialog(savedViewState: Bundle?): Dialog {
|
||||
val releaseBody = (args.getString(BODY_KEY) ?: "")
|
||||
.replace("""---(\R|.)*Checksums(\R|.)*""".toRegex(), "")
|
||||
val info = Markwon.create(activity!!).toMarkdown(releaseBody)
|
||||
|
||||
return MaterialAlertDialogBuilder(activity!!)
|
||||
.setTitle(R.string.update_check_notification_update_available)
|
||||
.setMessage(args.getString(BODY_KEY) ?: "")
|
||||
.setMessage(info)
|
||||
.setPositiveButton(R.string.update_check_confirm) { _, _ ->
|
||||
val appContext = applicationContext
|
||||
if (appContext != null) {
|
||||
applicationContext?.let { context ->
|
||||
// Start download
|
||||
val url = args.getString(URL_KEY) ?: ""
|
||||
AppUpdateService.start(appContext, url)
|
||||
AppUpdateService.start(context, url)
|
||||
}
|
||||
}
|
||||
.setNegativeButton(R.string.update_check_ignore, null)
|
||||
|
|
|
@ -25,7 +25,7 @@ class ThemesPreferenceAdapter(private val clickListener: OnItemClickListener) :
|
|||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ThemeViewHolder {
|
||||
val themeResIds = ThemingDelegate.getThemeResIds(themes[viewType], preferences.themeDarkAmoled().get())
|
||||
val themedContext = themeResIds.fold(parent.context) {
|
||||
context, themeResId ->
|
||||
context, themeResId ->
|
||||
ContextThemeWrapper(context, themeResId)
|
||||
}
|
||||
|
||||
|
|
|
@ -56,6 +56,8 @@ image-decoder = "com.github.tachiyomiorg:image-decoder:7481a4a"
|
|||
|
||||
natural-comparator = "com.github.gpanther:java-nat-sort:natural-comparator-1.1"
|
||||
|
||||
markwon = "io.noties.markwon:core:4.6.2"
|
||||
|
||||
material = "com.google.android.material:material:1.7.0-alpha01"
|
||||
androidprocessbutton = "com.github.dmytrodanylyk.android-process-button:library:1.0.4"
|
||||
flexible-adapter-core = "com.github.arkon.FlexibleAdapter:flexible-adapter:c8013533"
|
||||
|
|
Loading…
Reference in a new issue