From ad49c119f80e5ca86d6750145ff0a8107e1cc090 Mon Sep 17 00:00:00 2001 From: Raghav Aggarwal Date: Thu, 10 Aug 2023 12:48:25 +0530 Subject: [PATCH 1/2] bump Compose to 1.5.0 and Navigation to 2.7.0 --- app/build.gradle | 10 ++++----- .../com/raghav/spacedawnv2/ui/MainActivity.kt | 21 +++++++++++++++++-- build.gradle | 4 ++-- data/build.gradle | 5 ++--- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5ba4676..1bcd2ac 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,12 +9,12 @@ plugins { android { namespace 'com.raghav.spacedawnv2' - compileSdk 33 + compileSdk 34 defaultConfig { applicationId "com.raghav.spacedawnv2" minSdk 24 - targetSdk 33 + targetSdk 34 versionCode 1 versionName "1.0" @@ -65,7 +65,7 @@ ktlint { exclude { it.file.path.contains("$buildDir/generated/") } } } - disabledRules = ["import-ordering", "max-line-length", "argument-list-wrapping"] + //disabledRules = ["import-ordering", "max-line-length", "argument-list-wrapping"] } dependencies { @@ -78,7 +78,7 @@ dependencies { implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1' implementation 'androidx.activity:activity-compose:1.5.1' - implementation platform('androidx.compose:compose-bom:2022.10.00') + implementation platform('androidx.compose:compose-bom:2023.08.00') implementation 'androidx.compose.ui:ui' implementation 'androidx.compose.ui:ui-graphics' implementation 'androidx.compose.ui:ui-tooling-preview' @@ -118,7 +118,7 @@ dependencies { implementation("io.coil-kt:coil-compose:$coil_version") // Navigation - def nav_version = "2.5.3" + def nav_version = "2.7.0" implementation "androidx.navigation:navigation-compose:$nav_version" // Room diff --git a/app/src/main/java/com/raghav/spacedawnv2/ui/MainActivity.kt b/app/src/main/java/com/raghav/spacedawnv2/ui/MainActivity.kt index 8e15b97..b893b30 100644 --- a/app/src/main/java/com/raghav/spacedawnv2/ui/MainActivity.kt +++ b/app/src/main/java/com/raghav/spacedawnv2/ui/MainActivity.kt @@ -4,6 +4,7 @@ import android.app.Activity import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent +import androidx.compose.animation.AnimatedContentTransitionScope import androidx.compose.foundation.layout.RowScope import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding @@ -85,7 +86,15 @@ fun SpaceDawnApp(modifier: Modifier = Modifier) { startDestination = LaunchesScreen.route, modifier = Modifier.padding(innerPadding) ) { - composable(LaunchesScreen.route) { + composable( + LaunchesScreen.route, + enterTransition = { + slideIntoContainer(AnimatedContentTransitionScope.SlideDirection.Right) + }, + exitTransition = { + slideOutOfContainer(AnimatedContentTransitionScope.SlideDirection.Left) + } + ) { val activity = (LocalContext.current as? Activity) val actionLabel by rememberUpdatedState(newValue = stringResource(id = R.string.reminders)) LaunchesScreen( @@ -117,7 +126,15 @@ fun SpaceDawnApp(modifier: Modifier = Modifier) { } ) } - composable(RemindersScreen.route) { + composable( + RemindersScreen.route, + enterTransition = { + slideIntoContainer(AnimatedContentTransitionScope.SlideDirection.Left) + }, + exitTransition = { + slideOutOfContainer(AnimatedContentTransitionScope.SlideDirection.Right) + } + ) { val snackBarMessage by rememberUpdatedState(newValue = stringResource(R.string.reminder_cancelled_successfully)) RemindersScreen( onBackPressed = { navController.navigateSingleTopTo(LaunchesScreen.route) }, diff --git a/build.gradle b/build.gradle index a5440fd..f6243dd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id 'com.android.application' version '8.0.2' apply false - id 'com.android.library' version '8.0.2' apply false + id 'com.android.application' version '8.1.0' apply false + id 'com.android.library' version '8.1.0' apply false id 'org.jetbrains.kotlin.android' version '1.7.20' apply false id 'org.jetbrains.kotlin.jvm' version '1.8.20' apply false id "org.jlleitschuh.gradle.ktlint" version "11.5.0" diff --git a/data/build.gradle b/data/build.gradle index ca0c456..319f59e 100644 --- a/data/build.gradle +++ b/data/build.gradle @@ -9,11 +9,11 @@ plugins { android { namespace 'com.raghav.data' - compileSdk 33 + compileSdk 34 defaultConfig { minSdk 24 - targetSdk 33 + targetSdk 34 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -47,7 +47,6 @@ ktlint { exclude { it.file.path.contains("$buildDir/generated/") } } } - disabledRules = ["import-ordering", "max-line-length", "argument-list-wrapping"] } dependencies { From dc975c760f53adc5c9557bf7da3680a6c584748b Mon Sep 17 00:00:00 2001 From: Raghav Aggarwal Date: Thu, 10 Aug 2023 12:48:25 +0530 Subject: [PATCH 2/2] bump Compose to 1.5.0 and Navigation to 2.7.0 --- app/build.gradle | 9 ++++---- .../com/raghav/spacedawnv2/ui/MainActivity.kt | 21 +++++++++++++++++-- build.gradle | 4 ++-- data/build.gradle | 5 ++--- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5ba4676..ac8cbdb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,12 +9,12 @@ plugins { android { namespace 'com.raghav.spacedawnv2' - compileSdk 33 + compileSdk 34 defaultConfig { applicationId "com.raghav.spacedawnv2" minSdk 24 - targetSdk 33 + targetSdk 34 versionCode 1 versionName "1.0" @@ -65,7 +65,6 @@ ktlint { exclude { it.file.path.contains("$buildDir/generated/") } } } - disabledRules = ["import-ordering", "max-line-length", "argument-list-wrapping"] } dependencies { @@ -78,7 +77,7 @@ dependencies { implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1' implementation 'androidx.activity:activity-compose:1.5.1' - implementation platform('androidx.compose:compose-bom:2022.10.00') + implementation platform('androidx.compose:compose-bom:2023.08.00') implementation 'androidx.compose.ui:ui' implementation 'androidx.compose.ui:ui-graphics' implementation 'androidx.compose.ui:ui-tooling-preview' @@ -118,7 +117,7 @@ dependencies { implementation("io.coil-kt:coil-compose:$coil_version") // Navigation - def nav_version = "2.5.3" + def nav_version = "2.7.0" implementation "androidx.navigation:navigation-compose:$nav_version" // Room diff --git a/app/src/main/java/com/raghav/spacedawnv2/ui/MainActivity.kt b/app/src/main/java/com/raghav/spacedawnv2/ui/MainActivity.kt index 8e15b97..b893b30 100644 --- a/app/src/main/java/com/raghav/spacedawnv2/ui/MainActivity.kt +++ b/app/src/main/java/com/raghav/spacedawnv2/ui/MainActivity.kt @@ -4,6 +4,7 @@ import android.app.Activity import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent +import androidx.compose.animation.AnimatedContentTransitionScope import androidx.compose.foundation.layout.RowScope import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding @@ -85,7 +86,15 @@ fun SpaceDawnApp(modifier: Modifier = Modifier) { startDestination = LaunchesScreen.route, modifier = Modifier.padding(innerPadding) ) { - composable(LaunchesScreen.route) { + composable( + LaunchesScreen.route, + enterTransition = { + slideIntoContainer(AnimatedContentTransitionScope.SlideDirection.Right) + }, + exitTransition = { + slideOutOfContainer(AnimatedContentTransitionScope.SlideDirection.Left) + } + ) { val activity = (LocalContext.current as? Activity) val actionLabel by rememberUpdatedState(newValue = stringResource(id = R.string.reminders)) LaunchesScreen( @@ -117,7 +126,15 @@ fun SpaceDawnApp(modifier: Modifier = Modifier) { } ) } - composable(RemindersScreen.route) { + composable( + RemindersScreen.route, + enterTransition = { + slideIntoContainer(AnimatedContentTransitionScope.SlideDirection.Left) + }, + exitTransition = { + slideOutOfContainer(AnimatedContentTransitionScope.SlideDirection.Right) + } + ) { val snackBarMessage by rememberUpdatedState(newValue = stringResource(R.string.reminder_cancelled_successfully)) RemindersScreen( onBackPressed = { navController.navigateSingleTopTo(LaunchesScreen.route) }, diff --git a/build.gradle b/build.gradle index a5440fd..f6243dd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id 'com.android.application' version '8.0.2' apply false - id 'com.android.library' version '8.0.2' apply false + id 'com.android.application' version '8.1.0' apply false + id 'com.android.library' version '8.1.0' apply false id 'org.jetbrains.kotlin.android' version '1.7.20' apply false id 'org.jetbrains.kotlin.jvm' version '1.8.20' apply false id "org.jlleitschuh.gradle.ktlint" version "11.5.0" diff --git a/data/build.gradle b/data/build.gradle index ca0c456..319f59e 100644 --- a/data/build.gradle +++ b/data/build.gradle @@ -9,11 +9,11 @@ plugins { android { namespace 'com.raghav.data' - compileSdk 33 + compileSdk 34 defaultConfig { minSdk 24 - targetSdk 33 + targetSdk 34 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -47,7 +47,6 @@ ktlint { exclude { it.file.path.contains("$buildDir/generated/") } } } - disabledRules = ["import-ordering", "max-line-length", "argument-list-wrapping"] } dependencies {