Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ kotlin {
implementation(libs.compose.ui.tooling.preview)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.navigation3.ui)
}

androidUnitTest.dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import androidx.activity.ComponentActivity
import androidx.activity.SystemBarStyle
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.animation.ContentTransform
import androidx.compose.animation.core.spring
import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
Expand Down Expand Up @@ -48,14 +50,13 @@ class MainActivity : ComponentActivity() {
window.isNavigationBarContrastEnforced = false
}
},
popEnterTransition = {
scaleIn(initialScale = 1.05f) +
fadeIn(animationSpec = tween(50))
},
popExitTransition = {
scaleOut(targetScale = 0.9f, animationSpec = tween(50)) +
fadeOut(animationSpec = tween(50, delayMillis = 50))
},
popTransactionSpec = {
// TODO: review these magic numbers from Androidify
ContentTransform(
fadeIn(spring(dampingRatio = 1.0f, stiffness = 1600f)),
scaleOut(targetScale = 0.7f),
)
}
)
}
}
Expand Down
11 changes: 7 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ android-targetSdk = "36"
androidx-activityCompose = "1.11.0"
androidx-core-ktx = "1.17.0"
androidx-core-splashscreen = "1.0.1"
androidx-lifecycle = "2.9.4"
androidx-lifecycle = "2.10.0-alpha03"
androidx-navigation = "2.9.0"
androidx-preference = "1.2.1"
coil = "3.3.0"
compose-android = "1.9.0"
compose-hot-reload = "1.0.0-beta09"
compose-multiplatform = "1.9.0"
compose-hot-reload = "1.0.0-rc02"
compose-multiplatform = "1.10.0-alpha03"
coroutines = "1.10.2"
doistx-normalize = "1.2.0"
exposed = "0.61.0"
Expand All @@ -34,16 +34,19 @@ markdown = "0.37.0"
multiplatform-settings = "1.3.0"
postgresql = "42.7.7"
slf4jNop = "2.0.17"
nav3Core = "1.0.0-alpha03"

[libraries]
aboutlibraries-core = { module = "com.mikepenz:aboutlibraries-core", version.ref = "aboutlibraries" }
android-svg = { module = "com.caverock:androidsvg-aar", version.ref = "android-svg" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-core-ktx" }
androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "androidx-core-splashscreen" }
androidx-navigation-compose = { module = "org.jetbrains.androidx.navigation:navigation-compose", version.ref = "androidx-navigation" }
androidx-navigation3-ui = { module = "org.jetbrains.androidx.navigation3:navigation3-ui", version.ref = "nav3Core" }
androidx-lifecycle-viewmodel-navigation3 = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-navigation3", version.ref = "androidx-lifecycle" }
androidx-lifecycle-runtime-compose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidx-lifecycle" }
androidx-lifecycle-viewmodel-compose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" }
androidx-navigation-compose = { module = "org.jetbrains.androidx.navigation:navigation-compose", version.ref = "androidx-navigation" }
androidx-preference = { module = "androidx.preference:preference-ktx", version.ref = "androidx-preference" }
coil-compose = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coil" }
coil-network-ktor3 = { module = "io.coil-kt.coil3:coil-network-ktor3", version.ref = "coil" }
Expand Down
5 changes: 0 additions & 5 deletions kotlin-js-store/wasm/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
resolved "https://registry.yarnpkg.com/@js-joda/timezone/-/timezone-2.3.0.tgz#72878f6dc8afef20c29906e5d8d946f91618a2c3"
integrity sha512-DHXdNs0SydSqC5f0oRJPpTcNfnpRojgBqMCFupQFv6WgeZAjU3DBx+A7JtaGPP3dHrP2Odi2N8Vf+uAm/8ynCQ==

format-util@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/format-util/-/format-util-1.0.5.tgz#1ffb450c8a03e7bccffe40643180918cc297d271"
integrity sha512-varLbTj0e0yVyRpqQhuWV+8hlePAgaoFRhNFj50BNjEIrw1/DphHSObtqwskVCPWNgzwPoQrZAbfa/SBiicNeg==

[email protected]:
version "8.18.0"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc"
Expand Down
18 changes: 6 additions & 12 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

pluginManagement {
repositories {
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") {
mavenContent {
includeGroupAndSubgroups("org.jetbrains.compose")
includeGroupAndSubgroups("org.jetbrains.androidx")
}
}
// TODO remove dev repo later
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")

google {
mavenContent {
includeGroupAndSubgroups("android")
Expand All @@ -28,12 +25,9 @@ pluginManagement {

dependencyResolutionManagement {
repositories {
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") {
mavenContent {
includeGroupAndSubgroups("org.jetbrains.compose")
includeGroupAndSubgroups("org.jetbrains.androidx")
}
}
// TODO remove dev repo later
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")

google {
mavenContent {
includeGroupAndSubgroups("android")
Expand Down
3 changes: 2 additions & 1 deletion shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ kotlin {
implementation(libs.kotlinx.datetime)

implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.navigation3.ui)
implementation(libs.androidx.lifecycle.viewmodel.navigation3)
implementation(libs.compose.ui.backhandler)
implementation(libs.ktor.client.core)

Expand Down
12 changes: 4 additions & 8 deletions shared/src/commonMain/kotlin/org/jetbrains/kotlinconf/App.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package org.jetbrains.kotlinconf

import androidx.compose.animation.AnimatedContentTransitionScope
import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.animation.ContentTransform
import androidx.compose.foundation.background
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Box
Expand All @@ -13,18 +12,15 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.navigation.NavBackStackEntry
import androidx.navigation3.scene.Scene
import org.jetbrains.kotlinconf.navigation.KotlinConfNavHost
import org.jetbrains.kotlinconf.storage.ApplicationStorage
import org.jetbrains.kotlinconf.ui.theme.KotlinConfTheme
import org.koin.compose.koinInject
import kotlin.jvm.JvmSuppressWildcards

@Composable
fun App(
onThemeChange: ((isDarkTheme: Boolean) -> Unit)? = null,
popEnterTransition: (@JvmSuppressWildcards AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition)? = null,
popExitTransition: (@JvmSuppressWildcards AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition)? = null,
popTransactionSpec: (AnimatedContentTransitionScope<Scene<Any>>.() -> ContentTransform)? = null,
) {
val service = koinInject<ConferenceService>()
val currentTheme by service.getTheme().collectAsStateWithLifecycle(initialValue = Theme.SYSTEM)
Expand Down Expand Up @@ -54,7 +50,7 @@ fun App(
.background(KotlinConfTheme.colors.mainBackground)
) {
if (isOnboardingComplete != null) {
KotlinConfNavHost(isOnboardingComplete, popEnterTransition, popExitTransition)
KotlinConfNavHost(isOnboardingComplete, popTransactionSpec)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package org.jetbrains.kotlinconf.navigation

import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.remember

@Composable
fun <T : Any> rememberBackstack(initial: T): BackStack<T> = remember { BackStack(initial) }

class BackStack<T>(initial: T) {
private val _backStack = mutableStateListOf(initial)
val backStack: List<T> get() = _backStack

fun edit(actions: MutableList<T>.() -> Unit) {
_backStack.actions()
}

fun add(element: T, clearOthers: Boolean = false) {
_backStack.add(element)

if (clearOthers) {
_backStack.removeRange(0, _backStack.lastIndex)
}
}

fun pop() {
_backStack.removeAt(_backStack.lastIndex)
}
}
Loading