Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency org.jetbrains.compose:compose-gradle-plugin to v1.7.0-beta02 #160

Merged
merged 2 commits into from
Sep 10, 2024
Merged
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
7 changes: 4 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ android-sdk-compile = "35"
android-sdk-target = "35"
android-sdk-min = "24"

composeJetbrains = "1.7.0-beta01"
composeLifecycle = "2.8.1"
composeJetbrains = "1.7.0-beta02"
composeLifecycle = "2.8.2"

conventions = "0.0.77"

Expand Down Expand Up @@ -40,7 +40,8 @@ buildscript-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", ver
buildscript-publish = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "publish" }

compose-lifecycle = { module = "org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose", version.ref = "composeLifecycle" }
compose-navigation = "org.jetbrains.androidx.navigation:navigation-compose:2.8.0-alpha09"
compose-navigation = "org.jetbrains.androidx.navigation:navigation-compose:2.8.0-alpha10"
compose-navigationMaterial = { module = "org.jetbrains.compose.material:material-navigation", version.ref = "composeJetbrains" }
compose-navigationAndroid = "androidx.navigation:navigation-compose:2.8.0"

detektEygraber-formatting = { module = "com.eygraber.detekt.rules:formatting", version.ref = "detektEygraber" }
Expand Down
30 changes: 24 additions & 6 deletions kotlin-js-store/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 11 additions & 16 deletions vice-nav/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,24 @@ kotlin {
)

sourceSets {
androidMain {
dependencies {
api(libs.compose.navigationAndroid)
}
androidMain.dependencies {
api(libs.compose.navigationAndroid)
}

commonMain {
dependencies {
api(projects.viceCore)
commonMain.dependencies {
api(projects.viceCore)

implementation(compose.runtime)
api(libs.compose.navigation)
api(libs.compose.navigationMaterial)

implementation(libs.kotlinx.coroutines.core)
implementation(compose.runtime)

api(libs.compose.navigation)
}
implementation(libs.kotlinx.coroutines.core)
}

commonTest {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
commonTest.dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.compose.animation.AnimatedContentTransitionScope
import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.animation.SizeTransform
import androidx.compose.material.navigation.bottomSheet
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.remember
import androidx.compose.ui.window.DialogProperties
Expand Down Expand Up @@ -118,3 +119,32 @@ public inline fun <reified T : Any> NavGraphBuilder.viceDialog(
remember(it.id) { destinationFactory(TypedNavBackStackEntry(it.toRoute<T>(), it)) }.Vice()
}
}

public fun NavGraphBuilder.viceBottomSheet(
route: String,
arguments: List<NamedNavArgument> = emptyList(),
deepLinks: List<NavDeepLink> = emptyList(),
destinationFactory: (NavBackStackEntry) -> ViceDestination<*, *, *, *>,
) {
bottomSheet(
route = route,
arguments = arguments,
deepLinks = deepLinks,
) {
remember(it.id) { destinationFactory(it) }.Vice()
}
}

// TODO: Only available starting Compose 1.8.0
// public inline fun <reified T : Any> NavGraphBuilder.viceBottomSheet(
// typeMap: Map<KType, @JvmSuppressWildcards NavType<*>> = emptyMap(),
// deepLinks: List<NavDeepLink> = emptyList(),
// crossinline destinationFactory: (TypedNavBackStackEntry<T>) -> ViceDestination<*, *, *, *>,
// ) {
// bottomSheet<T>(
// typeMap = typeMap,
// deepLinks = deepLinks,
// ) {
// remember(it.id) { destinationFactory(TypedNavBackStackEntry(it.toRoute<T>(), it)) }.Vice()
// }
// }