mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
Format changelog in app (#51)
Formats the in-app changelog when updating Also allows for force updating to allow for switching develop tags.
This commit is contained in:
parent
6344cc77bf
commit
177e009f8c
3 changed files with 29 additions and 26 deletions
|
|
@ -228,6 +228,8 @@ dependencies {
|
|||
implementation(libs.timber)
|
||||
implementation(libs.aboutlibraries.core)
|
||||
implementation(libs.aboutlibraries.compose.m3)
|
||||
implementation(libs.multiplatform.markdown.renderer)
|
||||
implementation(libs.multiplatform.markdown.renderer.m3)
|
||||
|
||||
androidTestImplementation(platform(libs.androidx.compose.bom))
|
||||
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ import com.github.damontecres.wholphin.util.LoadingState
|
|||
import com.github.damontecres.wholphin.util.Release
|
||||
import com.github.damontecres.wholphin.util.UpdateChecker
|
||||
import com.github.damontecres.wholphin.util.Version
|
||||
import com.mikepenz.markdown.m3.Markdown
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
|
|
@ -120,7 +121,6 @@ fun InstallUpdatePage(
|
|||
|
||||
LoadingState.Success ->
|
||||
release?.let {
|
||||
if (it.version.isGreaterThan(viewModel.currentVersion)) {
|
||||
InstallUpdatePageContent(
|
||||
currentVersion = viewModel.currentVersion,
|
||||
release = it,
|
||||
|
|
@ -136,11 +136,6 @@ fun InstallUpdatePage(
|
|||
},
|
||||
modifier = modifier,
|
||||
)
|
||||
} else {
|
||||
Text(
|
||||
text = "No update available",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -202,11 +197,14 @@ fun InstallUpdatePageContent(
|
|||
},
|
||||
) {
|
||||
item {
|
||||
Text(
|
||||
// TODO render markdown
|
||||
text = release.notes.joinToString("\n\n") + (release.body ?: ""),
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
Markdown(
|
||||
(release.notes.joinToString("\n\n") + (release.body ?: ""))
|
||||
.replace(
|
||||
Regex("https://github.com/damontecres/\\w+/pull/(\\d+)"),
|
||||
"#$1",
|
||||
)
|
||||
// Remove the last line for full changelog since its just a link
|
||||
.replace(Regex("\\*\\*Full Changelog\\*\\*.*"), ""),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ coreKtx = "1.17.0"
|
|||
appcompat = "1.7.1"
|
||||
composeBom = "2025.10.00"
|
||||
compose-runtime = "1.9.3"
|
||||
multiplatformMarkdownRenderer = "0.37.0"
|
||||
timber = "5.0.1"
|
||||
tvFoundation = "1.0.0-alpha12"
|
||||
tvMaterial = "1.0.1"
|
||||
|
|
@ -56,6 +57,8 @@ androidx-datastore = { module = "androidx.datastore:datastore", version.ref = "d
|
|||
desugar_jdk_libs = { module = "com.android.tools:desugar_jdk_libs", version.ref = "desugar_jdk_libs" }
|
||||
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" }
|
||||
hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt" }
|
||||
multiplatform-markdown-renderer = { module = "com.mikepenz:multiplatform-markdown-renderer", version.ref = "multiplatformMarkdownRenderer" }
|
||||
multiplatform-markdown-renderer-m3 = { module = "com.mikepenz:multiplatform-markdown-renderer-m3", version.ref = "multiplatformMarkdownRenderer" }
|
||||
protobuf-kotlin-lite = { module = "com.google.protobuf:protobuf-kotlin-lite", version.ref = "protobuf-javalite" }
|
||||
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines-android" }
|
||||
kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinx-serialization" }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue