mirror of
https://github.com/smyalygames/vegan-e-numbers.git
synced 2025-05-18 04:54:14 +02:00
feat(app): add licences screen
This commit is contained in:
parent
3a1afc3c9f
commit
4cfee38bf4
@ -8,6 +8,7 @@ plugins {
|
||||
alias(libs.plugins.jetbrainsCompose)
|
||||
alias(libs.plugins.compose.compiler)
|
||||
alias(libs.plugins.kotlinxSerialization)
|
||||
alias(libs.plugins.aboutLibraries)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
@ -51,6 +52,9 @@ kotlin {
|
||||
implementation(libs.voyager.navigator)
|
||||
implementation(libs.voyager.tab)
|
||||
implementation(libs.voyager.screenmodel)
|
||||
|
||||
implementation(libs.aboutlibraries.core)
|
||||
implementation(libs.aboutlibraries.material3)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
36
composeApp/src/commonMain/kotlin/tab/Licenses.kt
Normal file
36
composeApp/src/commonMain/kotlin/tab/Licenses.kt
Normal file
@ -0,0 +1,36 @@
|
||||
package tab
|
||||
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Modifier
|
||||
import cafe.adriel.voyager.core.screen.Screen
|
||||
import com.mikepenz.aboutlibraries.ui.compose.m3.LibrariesContainer
|
||||
import org.jetbrains.compose.resources.ExperimentalResourceApi
|
||||
import veganenumbers.composeapp.generated.resources.Res.readBytes
|
||||
|
||||
|
||||
object Licenses : Screen {
|
||||
|
||||
@OptIn(ExperimentalResourceApi::class)
|
||||
private suspend fun loadLicenses(): String {
|
||||
val bytes = readBytes("files/aboutlibraries.json")
|
||||
val json = bytes.decodeToString()
|
||||
|
||||
return json
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalResourceApi::class)
|
||||
@Composable
|
||||
override fun Content() {
|
||||
var licenses by remember{ mutableStateOf("") }
|
||||
|
||||
LaunchedEffect(currentCompositeKeyHash) {
|
||||
licenses = loadLicenses()
|
||||
}
|
||||
|
||||
LibrariesContainer(
|
||||
licenses,
|
||||
Modifier.fillMaxSize()
|
||||
)
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
[versions]
|
||||
aboutLibraries = "11.2.1"
|
||||
agp = "8.2.0"
|
||||
android-compileSdk = "34"
|
||||
android-minSdk = "24"
|
||||
@ -37,18 +38,17 @@ androidx-constraintlayout = { group = "androidx.constraintlayout", name = "const
|
||||
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }
|
||||
androidx-material3-android = { group = "androidx.compose.material3", name = "material3-android", version.ref = "material3Android" }
|
||||
|
||||
# Koin
|
||||
koin-bom = { module = "io.insert-koin:koin-bom", version.ref = "koin-bom" }
|
||||
koin-core = { module = "io.insert-koin:koin-core" }
|
||||
koin-compose = { module = "io.insert-koin:koin-compose" }
|
||||
# AboutLibraries
|
||||
aboutlibraries-core = { module = "com.mikepenz:aboutlibraries-core", version.ref = "aboutLibraries" }
|
||||
aboutlibraries-material3 = { module = "com.mikepenz:aboutlibraries-compose-m3", version.ref = "aboutLibraries" }
|
||||
|
||||
# Voyager
|
||||
voyager-navigator = { group = "cafe.adriel.voyager", name = "voyager-navigator", version.ref = "voyager" }
|
||||
voyager-tab = { group = "cafe.adriel.voyager", name = "voyager-tab-navigator", version.ref = "voyager" }
|
||||
voyager-screenmodel = { group = "cafe.adriel.voyager", name = "voyager-screenmodel", version.ref = "voyager" }
|
||||
voyager-koin = { group = "cafe.adriel.voyager", name = "voyager-koin", version.ref = "voyager" }
|
||||
|
||||
[plugins]
|
||||
aboutLibraries = { id = "com.mikepenz.aboutlibraries.plugin", version.ref = "aboutLibraries"}
|
||||
androidApplication = { id = "com.android.application", version.ref = "agp" }
|
||||
androidLibrary = { id = "com.android.library", version.ref = "agp" }
|
||||
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
|
||||
|
Loading…
x
Reference in New Issue
Block a user