Skip to content

Commit a97fd7e

Browse files
authored
Merge pull request #23 from avidraghav/chore/update_compose
Update Compose and Navigation to latest Stable versions
2 parents 424dd57 + 7f13396 commit a97fd7e

File tree

4 files changed

+27
-12
lines changed

4 files changed

+27
-12
lines changed

app/build.gradle

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ plugins {
99

1010
android {
1111
namespace 'com.raghav.spacedawnv2'
12-
compileSdk 33
12+
compileSdk 34
1313

1414
defaultConfig {
1515
applicationId "com.raghav.spacedawnv2"
1616
minSdk 24
17-
targetSdk 33
17+
targetSdk 34
1818
versionCode 1
1919
versionName "1.0"
2020

@@ -65,7 +65,6 @@ ktlint {
6565
exclude { it.file.path.contains("$buildDir/generated/") }
6666
}
6767
}
68-
disabledRules = ["import-ordering", "max-line-length", "argument-list-wrapping"]
6968
}
7069

7170
dependencies {
@@ -78,7 +77,7 @@ dependencies {
7877
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
7978

8079
implementation 'androidx.activity:activity-compose:1.5.1'
81-
implementation platform('androidx.compose:compose-bom:2022.10.00')
80+
implementation platform('androidx.compose:compose-bom:2023.08.00')
8281
implementation 'androidx.compose.ui:ui'
8382
implementation 'androidx.compose.ui:ui-graphics'
8483
implementation 'androidx.compose.ui:ui-tooling-preview'
@@ -118,7 +117,7 @@ dependencies {
118117
implementation("io.coil-kt:coil-compose:$coil_version")
119118

120119
// Navigation
121-
def nav_version = "2.5.3"
120+
def nav_version = "2.7.0"
122121
implementation "androidx.navigation:navigation-compose:$nav_version"
123122

124123
// Room

app/src/main/java/com/raghav/spacedawnv2/ui/MainActivity.kt

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.app.Activity
44
import android.os.Bundle
55
import androidx.activity.ComponentActivity
66
import androidx.activity.compose.setContent
7+
import androidx.compose.animation.AnimatedContentTransitionScope
78
import androidx.compose.foundation.layout.RowScope
89
import androidx.compose.foundation.layout.fillMaxSize
910
import androidx.compose.foundation.layout.padding
@@ -85,7 +86,15 @@ fun SpaceDawnApp(modifier: Modifier = Modifier) {
8586
startDestination = LaunchesScreen.route,
8687
modifier = Modifier.padding(innerPadding)
8788
) {
88-
composable(LaunchesScreen.route) {
89+
composable(
90+
LaunchesScreen.route,
91+
enterTransition = {
92+
slideIntoContainer(AnimatedContentTransitionScope.SlideDirection.Right)
93+
},
94+
exitTransition = {
95+
slideOutOfContainer(AnimatedContentTransitionScope.SlideDirection.Left)
96+
}
97+
) {
8998
val activity = (LocalContext.current as? Activity)
9099
val actionLabel by rememberUpdatedState(newValue = stringResource(id = R.string.reminders))
91100
LaunchesScreen(
@@ -117,7 +126,15 @@ fun SpaceDawnApp(modifier: Modifier = Modifier) {
117126
}
118127
)
119128
}
120-
composable(RemindersScreen.route) {
129+
composable(
130+
RemindersScreen.route,
131+
enterTransition = {
132+
slideIntoContainer(AnimatedContentTransitionScope.SlideDirection.Left)
133+
},
134+
exitTransition = {
135+
slideOutOfContainer(AnimatedContentTransitionScope.SlideDirection.Right)
136+
}
137+
) {
121138
val snackBarMessage by rememberUpdatedState(newValue = stringResource(R.string.reminder_cancelled_successfully))
122139
RemindersScreen(
123140
onBackPressed = { navController.navigateSingleTopTo(LaunchesScreen.route) },

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
3-
id 'com.android.application' version '8.0.2' apply false
4-
id 'com.android.library' version '8.0.2' apply false
3+
id 'com.android.application' version '8.1.0' apply false
4+
id 'com.android.library' version '8.1.0' apply false
55
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
66
id 'org.jetbrains.kotlin.jvm' version '1.8.20' apply false
77
id "org.jlleitschuh.gradle.ktlint" version "11.5.0"

data/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ plugins {
99

1010
android {
1111
namespace 'com.raghav.data'
12-
compileSdk 33
12+
compileSdk 34
1313

1414
defaultConfig {
1515
minSdk 24
16-
targetSdk 33
16+
targetSdk 34
1717

1818
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1919
consumerProguardFiles "consumer-rules.pro"
@@ -47,7 +47,6 @@ ktlint {
4747
exclude { it.file.path.contains("$buildDir/generated/") }
4848
}
4949
}
50-
disabledRules = ["import-ordering", "max-line-length", "argument-list-wrapping"]
5150
}
5251

5352
dependencies {

0 commit comments

Comments
 (0)