mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-13 05:52:48 +01:00
Fix what's new link in dialog
This commit is contained in:
parent
93e2b88d41
commit
22ed163c8f
@ -70,3 +70,13 @@ val GITHUB_REPO: String by lazy {
|
|||||||
"tachiyomiorg/tachiyomi"
|
"tachiyomiorg/tachiyomi"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val RELEASE_TAG: String by lazy {
|
||||||
|
if (BuildConfig.PREVIEW) {
|
||||||
|
"r${BuildConfig.COMMIT_COUNT}"
|
||||||
|
} else {
|
||||||
|
"v${BuildConfig.VERSION_NAME}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val RELEASE_URL = "https://github.com/$GITHUB_REPO/releases/tag/$RELEASE_TAG"
|
||||||
|
@ -5,6 +5,7 @@ import android.os.Bundle
|
|||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||||
import eu.kanade.tachiyomi.BuildConfig
|
import eu.kanade.tachiyomi.BuildConfig
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
|
import eu.kanade.tachiyomi.data.updater.RELEASE_URL
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.DialogController
|
import eu.kanade.tachiyomi.ui.base.controller.DialogController
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.openInBrowser
|
import eu.kanade.tachiyomi.ui.base.controller.openInBrowser
|
||||||
|
|
||||||
@ -16,7 +17,7 @@ class WhatsNewDialogController(bundle: Bundle? = null) : DialogController(bundle
|
|||||||
.setTitle(activity!!.getString(R.string.updated_version, BuildConfig.VERSION_NAME))
|
.setTitle(activity!!.getString(R.string.updated_version, BuildConfig.VERSION_NAME))
|
||||||
.setPositiveButton(android.R.string.ok, null)
|
.setPositiveButton(android.R.string.ok, null)
|
||||||
.setNeutralButton(R.string.whats_new) { _, _ ->
|
.setNeutralButton(R.string.whats_new) { _, _ ->
|
||||||
openInBrowser("https://github.com/tachiyomiorg/tachiyomi/releases/tag/v${BuildConfig.VERSION_NAME}")
|
openInBrowser(RELEASE_URL)
|
||||||
}
|
}
|
||||||
.create()
|
.create()
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import eu.kanade.tachiyomi.BuildConfig
|
|||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
import eu.kanade.tachiyomi.data.updater.AppUpdateChecker
|
import eu.kanade.tachiyomi.data.updater.AppUpdateChecker
|
||||||
import eu.kanade.tachiyomi.data.updater.AppUpdateResult
|
import eu.kanade.tachiyomi.data.updater.AppUpdateResult
|
||||||
|
import eu.kanade.tachiyomi.data.updater.RELEASE_URL
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.NoAppBarElevationController
|
import eu.kanade.tachiyomi.ui.base.controller.NoAppBarElevationController
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.openInBrowser
|
import eu.kanade.tachiyomi.ui.base.controller.openInBrowser
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
||||||
@ -73,12 +74,7 @@ class AboutController : SettingsController(), NoAppBarElevationController {
|
|||||||
titleRes = R.string.whats_new
|
titleRes = R.string.whats_new
|
||||||
|
|
||||||
onClick {
|
onClick {
|
||||||
val url = if (BuildConfig.PREVIEW) {
|
openInBrowser(RELEASE_URL)
|
||||||
"https://github.com/tachiyomiorg/tachiyomi-preview/releases/tag/r${BuildConfig.COMMIT_COUNT}"
|
|
||||||
} else {
|
|
||||||
"https://github.com/tachiyomiorg/tachiyomi/releases/tag/v${BuildConfig.VERSION_NAME}"
|
|
||||||
}
|
|
||||||
openInBrowser(url)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user