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

Compose 1.7.0 & revised back nav handling #70

Merged
merged 5 commits into from
Oct 16, 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
11 changes: 11 additions & 0 deletions _ci/update_credits_json.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -euo pipefail

origin=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) || exit

cd "${origin}/.."
rm -rf tasks-app-desktop/build/generated/aboutLibraries/
./gradlew :tasks-app-desktop:exportLibraryDefinitions -PaboutLibraries.exportPath=src/main/resources
rm -rf tasks-app-android/build/generated/aboutLibraries
./gradlew :tasks-app-android:exportLibraryDefinitions -PaboutLibraries.exportPath=src/main/assets
11 changes: 6 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ tasksApp-name = "1.2.2"
compileSdk = "34"
minSdk = "24"
targetSdk = "34"
agp = "8.5.1"
agp = "8.5.2"
kotlin = "2.0.20"
ksp = "2.0.20-1.0.24"
coroutines = "1.9.0"
ktor = "3.0.0"
compose-plugin = "1.7.0-rc01"
compose-plugin = "1.7.0"
compose-m3-adaptive = "1.0.0"
room = "2.7.0-alpha09"
sqlite = "2.5.0-alpha09"
koin = "4.0.0"
Expand Down Expand Up @@ -50,9 +51,9 @@ koin-androidx-startup = { module = "io.insert-koin:koin-androidx-startup" }
koin-compose = { module = "io.insert-koin:koin-compose" }
koin-compose-viewmodel = { module = "io.insert-koin:koin-compose-viewmodel" }

androidx-compose-m3-adaptive = { module = "androidx.compose.material3.adaptive:adaptive", version = "1.0.0" }
androidx-compose-m3-adaptive-layout = { module = "androidx.compose.material3.adaptive:adaptive-layout", version = "1.0.0" }
androidx-compose-m3-adaptive-navigation = { module = "androidx.compose.material3.adaptive:adaptive-navigation", version = "1.0.0" }
compose-m3-adaptive = { module = "org.jetbrains.compose.material3.adaptive:adaptive", version.ref = "compose-m3-adaptive" }
compose-m3-adaptive-layout = { module = "org.jetbrains.compose.material3.adaptive:adaptive-layout", version.ref = "compose-m3-adaptive" }
compose-m3-adaptive-navigation = { module = "org.jetbrains.compose.material3.adaptive:adaptive-navigation", version.ref = "compose-m3-adaptive" }

coil-compose = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coil" }
coil-network = { module = "io.coil-kt.coil3:coil-network-ktor3", version.ref = "coil" }
Expand Down
2 changes: 1 addition & 1 deletion tasks-app-android/src/main/assets/licenses_android.json
Original file line number Diff line number Diff line change
Expand Up @@ -2324,7 +2324,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Resources for Compose JB",
"name": "Resources for Compose JB",
"licenses": [
Expand Down
74 changes: 51 additions & 23 deletions tasks-app-desktop/src/main/resources/licenses_desktop.json
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "2.8.3-rc01",
"artifactVersion": "2.8.3",
"description": "Compose integration with Lifecycle",
"name": "Lifecycle Runtime Compose",
"licenses": [
Expand Down Expand Up @@ -771,7 +771,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.3.0-rc01",
"artifactVersion": "1.3.0",
"description": "WindowManager Core Library.",
"name": "WindowManager Core",
"licenses": [
Expand All @@ -785,7 +785,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Animation engine and animation primitives that are the building blocks of the Compose animation library",
"name": "Compose Animation Core",
"licenses": [
Expand All @@ -799,7 +799,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Compose animation library",
"name": "Compose Animation",
"licenses": [
Expand All @@ -813,7 +813,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Resources for Compose JB",
"name": "Resources for Compose JB",
"licenses": [
Expand All @@ -827,7 +827,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Compose Desktop",
"name": "Compose Desktop",
"licenses": [
Expand All @@ -841,7 +841,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Higher level abstractions of the Compose UI primitives. This library is design system agnostic, providing the high-level building blocks for both application and design-system developers",
"name": "Compose Foundation",
"licenses": [
Expand All @@ -855,7 +855,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Compose layout implementations",
"name": "Compose Layouts",
"licenses": [
Expand All @@ -869,7 +869,35 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.0.0-rc01",
"artifactVersion": "1.0.0",
"description": "Compose Material Design Adaptive Library",
"name": "Material Adaptive",
"licenses": [
"Apache-2.0"
]
},
{
"uniqueId": "org.jetbrains.compose.material3.adaptive:adaptive-layout-desktop",
"developers": [
{
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.0.0",
"description": "Compose Material Design Adaptive Library",
"name": "Material Adaptive",
"licenses": [
"Apache-2.0"
]
},
{
"uniqueId": "org.jetbrains.compose.material3.adaptive:adaptive-navigation-desktop",
"developers": [
{
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.0.0",
"description": "Compose Material Design Adaptive Library",
"name": "Material Adaptive",
"licenses": [
Expand All @@ -883,7 +911,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Compose Material Design Adaptive Navigation Suite Library",
"name": "Material Adaptive Navigation Suite",
"licenses": [
Expand All @@ -897,7 +925,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Compose Material You Design Components library",
"name": "Compose Material3 Components",
"licenses": [
Expand All @@ -911,7 +939,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Compose Material Design Components library",
"name": "Compose Material Components",
"licenses": [
Expand All @@ -925,7 +953,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Compose Material Design core icons. This module contains the most commonly used set of Material icons.",
"name": "Compose Material Icons Core",
"licenses": [
Expand All @@ -939,7 +967,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Material ripple used to build interactive components",
"name": "Compose Material Ripple",
"licenses": [
Expand All @@ -953,7 +981,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Tree composition support for code generated by the Compose compiler plugin and corresponding public API",
"name": "Compose Runtime",
"licenses": [
Expand All @@ -967,7 +995,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Compose components that allow saving and restoring the local ui state",
"name": "Compose Saveable",
"licenses": [
Expand All @@ -981,7 +1009,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Compose UI primitives. This library contains the primitives that form the Compose UI Toolkit, such as drawing, measurement and layout.",
"name": "Compose UI primitives",
"licenses": [
Expand All @@ -995,7 +1023,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Compose classes related to dimensions without units",
"name": "Compose Geometry",
"licenses": [
Expand All @@ -1009,7 +1037,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Compose graphics",
"name": "Compose Graphics",
"licenses": [
Expand All @@ -1023,7 +1051,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Compose Text primitives and utilities",
"name": "Compose UI Text",
"licenses": [
Expand All @@ -1037,7 +1065,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Compose tooling library API. This library provides the API required to declare @Preview composables in user apps.",
"name": "Compose UI Preview Tooling",
"licenses": [
Expand All @@ -1051,7 +1079,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Compose classes for simple units",
"name": "Compose Unit",
"licenses": [
Expand All @@ -1065,7 +1093,7 @@
"name": "Compose Multiplatform Team"
}
],
"artifactVersion": "1.7.0-rc01",
"artifactVersion": "1.7.0",
"description": "Internal Compose utilities used by other modules",
"name": "Compose Util",
"licenses": [
Expand Down
6 changes: 3 additions & 3 deletions tasks-app-shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ kotlin {
sourceSets {
androidMain.dependencies {
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.compose.m3.adaptive)
implementation(libs.androidx.compose.m3.adaptive.layout)
implementation(libs.androidx.compose.m3.adaptive.navigation)

implementation(libs.play.services.auth)
}
Expand All @@ -71,6 +68,9 @@ kotlin {
implementation(compose.material3)
api(compose.components.resources)
implementation(compose.material3AdaptiveNavigationSuite)
implementation(libs.compose.m3.adaptive)
implementation(libs.compose.m3.adaptive.layout)
implementation(libs.compose.m3.adaptive.navigation)
implementation(libs.bundles.coil)

implementation(libs.jetbrains.lifecycle.viewmodel.compose)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2024 Olivier Patry
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software
* is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package net.opatry.tasks.app.ui.component

import androidx.activity.compose.BackHandler
import androidx.compose.runtime.Composable

@Composable
actual fun MyBackHandler(canNavigateBack: () -> Boolean, navigateBack: () -> Unit) {
BackHandler(canNavigateBack()) {
navigateBack()
}
}
Loading