chore: showing changelog in preview build
This commit is contained in:
parent
11cfa733e9
commit
6651483741
3 changed files with 28 additions and 3 deletions
|
|
@ -294,6 +294,7 @@ object AboutScreen : Screen() {
|
|||
}
|
||||
|
||||
// SY -->
|
||||
// KMK: Unused now
|
||||
if (showWhatsNewDialog) {
|
||||
WhatsNewDialog(onDismissRequest = { showWhatsNewDialog = false })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import androidx.compose.ui.unit.dp
|
|||
import eu.kanade.tachiyomi.BuildConfig
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.updater.RELEASE_URL
|
||||
import eu.kanade.tachiyomi.util.system.isPreviewBuildType
|
||||
import eu.kanade.tachiyomi.util.system.isReleaseBuildType
|
||||
import eu.kanade.tachiyomi.util.system.openInBrowser
|
||||
import kotlinx.serialization.Serializable
|
||||
import nl.adaptivity.xmlutil.AndroidXmlReader
|
||||
|
|
@ -64,7 +64,7 @@ fun WhatsNewDialog(onDismissRequest: () -> Unit) {
|
|||
XML.decodeFromReader<Changelog>(
|
||||
AndroidXmlReader(
|
||||
context.resources.openRawResource(
|
||||
if (isPreviewBuildType) R.raw.changelog_preview else R.raw.changelog_release,
|
||||
if (isReleaseBuildType) R.raw.changelog_release else R.raw.changelog_preview,
|
||||
).bufferedReader(),
|
||||
),
|
||||
).toDisplayChangelog()
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ import eu.kanade.tachiyomi.util.system.dpToPx
|
|||
import eu.kanade.tachiyomi.util.system.isDevFlavor
|
||||
import eu.kanade.tachiyomi.util.system.isNavigationBarNeedsScrim
|
||||
import eu.kanade.tachiyomi.util.system.isPreviewBuildType
|
||||
import eu.kanade.tachiyomi.util.system.isReleaseBuildType
|
||||
import eu.kanade.tachiyomi.util.view.setComposeContent
|
||||
import exh.debug.DebugToggles
|
||||
import exh.eh.EHentaiUpdateWorker
|
||||
|
|
@ -97,6 +98,8 @@ import kotlinx.coroutines.launch
|
|||
import logcat.LogPriority
|
||||
import mihon.core.migration.Migrator
|
||||
import tachiyomi.core.common.Constants
|
||||
import tachiyomi.core.common.preference.Preference
|
||||
import tachiyomi.core.common.preference.PreferenceStore
|
||||
import tachiyomi.core.common.util.lang.launchIO
|
||||
import tachiyomi.core.common.util.system.logcat
|
||||
import tachiyomi.domain.UnsortedPreferences
|
||||
|
|
@ -104,6 +107,8 @@ import tachiyomi.domain.library.service.LibraryPreferences
|
|||
import tachiyomi.domain.release.interactor.GetApplicationRelease
|
||||
import tachiyomi.presentation.core.components.material.Scaffold
|
||||
import tachiyomi.presentation.core.util.collectAsState
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.util.LinkedList
|
||||
import androidx.compose.ui.graphics.Color.Companion as ComposeColor
|
||||
|
|
@ -304,12 +309,31 @@ class MainActivity : BaseActivity() {
|
|||
}
|
||||
// SY <--
|
||||
|
||||
var showChangelog by remember { mutableStateOf(didMigration && !BuildConfig.DEBUG) }
|
||||
// KMK -->
|
||||
val previewLastVersion = Injekt.get<PreferenceStore>().getInt(
|
||||
Preference.appStateKey("preview_last_version_code"),
|
||||
0,
|
||||
)
|
||||
val previewCurrentVersion = BuildConfig.COMMIT_COUNT.toInt()
|
||||
// KMK <--
|
||||
|
||||
var showChangelog by remember {
|
||||
mutableStateOf(
|
||||
// KMK -->
|
||||
// BuildConfig.DEBUG ||
|
||||
isReleaseBuildType && didMigration ||
|
||||
isPreviewBuildType && previewCurrentVersion > previewLastVersion.get()
|
||||
// KMK <--
|
||||
)
|
||||
}
|
||||
if (showChangelog) {
|
||||
// SY -->
|
||||
WhatsNewDialog(onDismissRequest = { showChangelog = false })
|
||||
// SY <--
|
||||
}
|
||||
// KMK -->
|
||||
previewLastVersion.set(previewCurrentVersion)
|
||||
// KMK <--
|
||||
|
||||
// SY -->
|
||||
ConfigureExhDialog(run = runExhConfigureDialog, onRunning = { runExhConfigureDialog = false })
|
||||
|
|
|
|||
Loading…
Reference in a new issue