Skip to content

Commit

Permalink
initial versions for stable compose 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
raamcosta committed Apr 12, 2023
1 parent 79a2dcf commit 32e2e5f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ Choose the one that matches your Compose version, considering this table:
<tr>
<td>Compose 1.4 (1.4.x)</td><td><img alt="Maven Central" src="https://img.shields.io/maven-metadata/v?versionPrefix=1.8&color=blue&metadataUrl=https://s01.oss.sonatype.org/service/local/repo_groups/public/content/io/github/raamcosta/compose-destinations/core/maven-metadata.xml&style=for-the-badge)](https://maven-badges.herokuapp.com/maven-central/io.github.raamcosta.compose-destinations/core)"></td>
</tr>
<tr>
<td>Compose 1.5 (1.5.x)</td><td><img alt="Maven Central" src="https://img.shields.io/maven-metadata/v?versionPrefix=1.9&color=blue&metadataUrl=https://s01.oss.sonatype.org/service/local/repo_groups/public/content/io/github/raamcosta/compose-destinations/core/maven-metadata.xml&style=for-the-badge)](https://maven-badges.herokuapp.com/maven-central/io.github.raamcosta.compose-destinations/core)"></td>
</tr>
</table>

> **Warning**: If you choose a version that uses a higher version of Compose than the one you're setting for your app, gradle will upgrade your Compose version via transitive dependency.
Expand Down
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ tasks.register<Delete>("clean") {
*/
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
false
// Don't allow non-stable versions, unless we are already using one for this dependency
isNonStable(candidate.version) && !isNonStable(currentVersion)
// isNonStable(candidate.version) && !isNonStable(currentVersion)
}
}

Expand Down
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ ksp = "1.8.20-1.0.10"

junit = "4.13.2"

compose = "1.4.1"
composeMaterial = "1.4.1"
compose = "1.5.0-alpha02"
composeMaterial = "1.5.0-alpha02"
composeCompiler = "1.4.5"
composeNavigation = "2.5.3"
accompanist = "0.30.1"
composeNavigation = "2.6.0-alpha09"
accompanist = "0.31.0-alpha"

ktxSerialization = "1.5.0"
mockk = "1.13.5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fun MyDrawer(
it.DrawerContent(
isSelected = it == destination,
onDestinationClick = { clickedDestination ->
if (navController.currentBackStackEntry?.getLifecycle()?.currentState == Lifecycle.State.RESUMED
if (navController.currentBackStackEntry?.lifecycle?.currentState == Lifecycle.State.RESUMED
&& navController.currentBackStackEntry?.appDestination() != clickedDestination
) {
navController.navigate(clickedDestination)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fun PlaygroundScaffold(
?: NavGraphs.root.startAppDestination

//Just for me to debug, ignore this line
navController.backQueue.print()
navController.currentBackStack.collectAsState().value.print()

val bottomSheetNavigator = rememberBottomSheetNavigator()
navController.navigatorProvider += bottomSheetNavigator
Expand All @@ -53,7 +53,7 @@ fun PlaygroundScaffold(
}
}

fun List<NavBackStackEntry>.print(prefix: String = "stack") {
fun Collection<NavBackStackEntry>.print(prefix: String = "stack") {
val stack = toMutableList()
.map { it.route() }
.filterIsInstance<Destination>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fun SampleScaffold(
val navBackStackEntry = navController.currentBackStackEntry

// 👇 only for debugging, you shouldn't use currentBackStack API as it is restricted by annotation
navController.backQueue.print()
navController.currentBackStack.collectAsState().value.print()

val bottomSheetNavigator = rememberBottomSheetNavigator()
navController.navigatorProvider += bottomSheetNavigator
Expand All @@ -51,7 +51,7 @@ fun SampleScaffold(
}
}

private fun ArrayDeque<NavBackStackEntry>.print(prefix: String = "stack") {
private fun Collection<NavBackStackEntry>.print(prefix: String = "stack") {
val stack = map { it.destination.route }.toTypedArray().contentToString()
println("$prefix = $stack")
}

0 comments on commit 32e2e5f

Please sign in to comment.