Skip to content

Commit

Permalink
Merge pull request #23 from avidraghav/chore/update_compose
Browse files Browse the repository at this point in the history
Update Compose and Navigation to latest Stable versions
  • Loading branch information
avidraghav authored Aug 10, 2023
2 parents 424dd57 + 7f13396 commit a97fd7e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
9 changes: 4 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -65,7 +65,6 @@ ktlint {
exclude { it.file.path.contains("$buildDir/generated/") }
}
}
disabledRules = ["import-ordering", "max-line-length", "argument-list-wrapping"]
}

dependencies {
Expand All @@ -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'
Expand Down Expand Up @@ -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
Expand Down
21 changes: 19 additions & 2 deletions app/src/main/java/com/raghav/spacedawnv2/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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) },
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
5 changes: 2 additions & 3 deletions data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -47,7 +47,6 @@ ktlint {
exclude { it.file.path.contains("$buildDir/generated/") }
}
}
disabledRules = ["import-ordering", "max-line-length", "argument-list-wrapping"]
}

dependencies {
Expand Down

0 comments on commit a97fd7e

Please sign in to comment.