mirror of
https://github.com/Shabinder/SpotiFlyer.git
synced 2024-11-21 08:44:33 +01:00
Compose,Kotlin,Gradle and Deps Update and Deprecated Code Migration
This commit is contained in:
parent
2198613506
commit
9299fc0c55
@ -82,15 +82,6 @@ android {
|
||||
packagingOptions {
|
||||
exclude("META-INF/*")
|
||||
}
|
||||
configurations {
|
||||
"implementation" {
|
||||
exclude(group = "androidx.compose.animation")
|
||||
exclude(group = "androidx.compose.foundation")
|
||||
exclude(group = "androidx.compose.material")
|
||||
exclude(group = "androidx.compose.runtime")
|
||||
exclude(group = "androidx.compose.ui")
|
||||
}
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
implementation(compose.material)
|
||||
|
@ -250,7 +250,7 @@ class MainActivity : ComponentActivity() {
|
||||
if (long) android.widget.Toast.LENGTH_LONG else android.widget.Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
Log.i("Toasting",string)
|
||||
Log.i("Toasting", string)
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@ -267,7 +267,7 @@ class MainActivity : ComponentActivity() {
|
||||
SpotiFlyerRoot(
|
||||
componentContext,
|
||||
dependencies = object : SpotiFlyerRoot.Dependencies {
|
||||
override val storeFactory = LoggingStoreFactory(DefaultStoreFactory)
|
||||
override val storeFactory = LoggingStoreFactory(DefaultStoreFactory())
|
||||
override val database = this@MainActivity.fileManager.db
|
||||
override val fetchQuery = this@MainActivity.fetcher
|
||||
override val fileManager: FileManager = this@MainActivity.fileManager
|
||||
|
@ -1,24 +1,24 @@
|
||||
[versions]
|
||||
kotlin = "1.5.31"
|
||||
kotlin = "1.6.10"
|
||||
androidCoroutines = "1.5.1"
|
||||
ktLint = "10.1.0"
|
||||
mosaic = "0.1.0"
|
||||
koin = "3.1.2"
|
||||
kermit = "0.1.9"
|
||||
mokoParcelize = "0.7.1"
|
||||
ktor = "1.6.3"
|
||||
kotlinxSerialization = "1.3.0"
|
||||
sqlDelight = "1.5.1"
|
||||
ktor = "1.6.7"
|
||||
kotlinxSerialization = "1.3.1"
|
||||
sqlDelight = "1.5.3"
|
||||
sqliteJdbcDriver = "3.34.0"
|
||||
slf4j = "1.7.31"
|
||||
i18n4k = "0.1.3"
|
||||
essenty = "0.1.3"
|
||||
essenty = "0.2.2"
|
||||
multiplatformSettings = "0.7.7"
|
||||
decompose = "0.3.1"
|
||||
mviKotlin = "2.0.4"
|
||||
accompanist = "0.18.0"
|
||||
statelyVersion = "1.1.10"
|
||||
statelyIsoVersion = "1.2.0-nmm"
|
||||
decompose = "0.5.0"
|
||||
mviKotlin = "3.0.0-alpha03"
|
||||
accompanist = "0.22.0-rc"
|
||||
statelyVersion = "1.2.1"
|
||||
statelyIsoVersion = "1.2.1"
|
||||
androidxLifecycle = "2.4.0-alpha03"
|
||||
|
||||
|
||||
@ -29,12 +29,12 @@ kotlin-kotlinTestCommon = { group = "org.jetbrains.kotlin", name = "kotlin-test-
|
||||
kotlin-kotlinTestJs = { group = "org.jetbrains.kotlin", name = "kotlin-test-js", version.ref = "kotlin" }
|
||||
kotlin-kotlinTestJunit = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit", version.ref = "kotlin" }
|
||||
kotlin-kotlinTestAnnotationsCommon = { group = "org.jetbrains.kotlin", name = "kotlin-test-annotations-common", version.ref = "kotlin" }
|
||||
kotlin-coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version = "1.5.2-native-mt" }
|
||||
kotlin-coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version = "1.6.0" }
|
||||
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerialization" }
|
||||
kotlinx-atomicfu = { group = "org.jetbrains.kotlinx", name = "atomicfu", version = "0.16.3" }
|
||||
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version = "0.2.1" }
|
||||
kotlinx-atomicfu = { group = "org.jetbrains.kotlinx", name = "atomicfu", version = "0.17.0" }
|
||||
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version = "0.3.2" }
|
||||
|
||||
kotlin-compose-gradle = { group = "org.jetbrains.compose", name = "compose-gradle-plugin", version = "1.0.0-alpha4-build366" }
|
||||
kotlin-compose-gradle = { group = "org.jetbrains.compose", name = "compose-gradle-plugin", version = "1.0.1" }
|
||||
mosaic-gradle = { group = "com.jakewharton.mosaic", name = "mosaic-gradle-plugin", version.ref = "mosaic" }
|
||||
|
||||
essenty-lifecycle = { group = "com.arkivanov.essenty", name = "lifecycle", version.ref = "essenty" }
|
||||
|
@ -6,6 +6,8 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.graphics.painter.BitmapPainter
|
||||
import androidx.compose.ui.res.loadImageBitmap
|
||||
import androidx.compose.ui.res.useResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.DialogState
|
||||
|
||||
@OptIn(ExperimentalAnimationApi::class)
|
||||
@Composable
|
||||
@ -17,6 +19,7 @@ actual fun Dialog(
|
||||
AnimatedVisibility(isVisible) {
|
||||
androidx.compose.ui.window.Dialog(
|
||||
onDismiss,
|
||||
state = DialogState(width = 350.dp, height = 340.dp),
|
||||
title = "SpotiFlyer",
|
||||
icon = BitmapPainter(useResource("drawable/spotiflyer.png", ::loadImageBitmap))
|
||||
) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
package com.shabinder.common.root
|
||||
|
||||
import com.arkivanov.decompose.ComponentContext
|
||||
import com.arkivanov.decompose.RouterState
|
||||
import com.arkivanov.decompose.router.RouterState
|
||||
import com.arkivanov.decompose.value.Value
|
||||
import com.arkivanov.mvikotlin.core.store.StoreFactory
|
||||
import com.shabinder.common.core_components.analytics.AnalyticsManager
|
||||
|
@ -19,6 +19,11 @@ package com.shabinder.common.root.integration
|
||||
import co.touchlab.stately.ensureNeverFrozen
|
||||
import co.touchlab.stately.freeze
|
||||
import com.arkivanov.decompose.*
|
||||
import com.arkivanov.decompose.router.RouterState
|
||||
import com.arkivanov.decompose.router.pop
|
||||
import com.arkivanov.decompose.router.popWhile
|
||||
import com.arkivanov.decompose.router.push
|
||||
import com.arkivanov.decompose.router.router
|
||||
import com.arkivanov.decompose.value.Value
|
||||
import com.arkivanov.essenty.parcelable.Parcelable
|
||||
import com.arkivanov.essenty.parcelable.Parcelize
|
||||
@ -26,8 +31,8 @@ import com.shabinder.common.core_components.analytics.AnalyticsEvent
|
||||
import com.shabinder.common.core_components.analytics.AnalyticsView
|
||||
import com.shabinder.common.list.SpotiFlyerList
|
||||
import com.shabinder.common.main.SpotiFlyerMain
|
||||
import com.shabinder.common.models.Consumer
|
||||
import com.shabinder.common.models.Actions
|
||||
import com.shabinder.common.models.Consumer
|
||||
import com.shabinder.common.preference.SpotiFlyerPreference
|
||||
import com.shabinder.common.root.SpotiFlyerRoot
|
||||
import com.shabinder.common.root.SpotiFlyerRoot.Child
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
import androidx.compose.desktop.DesktopMaterialTheme
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.Surface
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.awt.ComposeWindow
|
||||
@ -69,7 +70,7 @@ private lateinit var appWindow: ComposeWindow
|
||||
fun main() {
|
||||
val lifecycle = LifecycleRegistry()
|
||||
val rootComponent = spotiFlyerRoot(DefaultComponentContext(lifecycle))
|
||||
val windowState = WindowState(size = WindowSize(450.dp, 800.dp))
|
||||
val windowState = WindowState(width = 450.dp, height = 800.dp)
|
||||
singleWindowApplication(
|
||||
title = "SpotiFlyer",
|
||||
state = windowState,
|
||||
@ -82,7 +83,7 @@ fun main() {
|
||||
color = Color.Black,
|
||||
contentColor = colorOffWhite
|
||||
) {
|
||||
DesktopMaterialTheme(
|
||||
MaterialTheme(
|
||||
colors = SpotiFlyerColors,
|
||||
typography = SpotiFlyerTypography,
|
||||
shapes = SpotiFlyerShapes
|
||||
@ -110,7 +111,7 @@ private fun spotiFlyerRoot(componentContext: ComponentContext): SpotiFlyerRoot =
|
||||
componentContext = componentContext,
|
||||
dependencies = object : SpotiFlyerRoot.Dependencies {
|
||||
override val appInit: ApplicationInit = koin.get()
|
||||
override val storeFactory = DefaultStoreFactory
|
||||
override val storeFactory = DefaultStoreFactory()
|
||||
override val fetchQuery: FetchPlatformQueryResult = koin.get()
|
||||
override val fileManager: FileManager = koin.get()
|
||||
override val database: Database? = fileManager.db
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
#distributionSha256Sum=7faa7198769f872826c8ef4f1450f839ec27f0b4d5d1e51bade63667cbccd205
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
Loading…
Reference in New Issue
Block a user