Skip to content

Commit 0f54e73

Browse files
author
Johann Blake
committed
Updated dependency versions. Compiled to run on Android Studio, Bumblebee 2021.1.1 Canary 3
1 parent d648584 commit 0f54e73

File tree

7 files changed

+30
-19
lines changed

7 files changed

+30
-19
lines changed

app/build.gradle

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ android {
3636
}
3737
composeOptions {
3838
kotlinCompilerExtensionVersion compose_version
39-
kotlinCompilerVersion '1.5.0'
39+
kotlinCompilerVersion '1.5.10'
4040
}
4141
}
4242

4343
dependencies {
4444

45-
def lifecycle_version = "2.4.0-alpha01"
46-
def activity_version = "1.3.0-beta01"
45+
def lifecycle_version = "2.4.0-alpha02"
46+
def activity_version = "1.3.0-rc01"
4747
def retrofit_version = "2.9.0"
4848
def paging_version = "3.0.0"
4949

50-
implementation 'androidx.core:core-ktx:1.6.0-beta02'
51-
implementation 'androidx.appcompat:appcompat:1.4.0-alpha02'
52-
implementation 'com.google.android.material:material:1.4.0-rc01'
50+
implementation 'androidx.core:core-ktx:1.6.0'
51+
implementation 'androidx.appcompat:appcompat:1.4.0-alpha03'
52+
implementation 'com.google.android.material:material:1.4.0'
5353
implementation "androidx.activity:activity-ktx:$activity_version"
5454
implementation "androidx.activity:activity-compose:$activity_version"
5555
implementation "androidx.compose.ui:ui:$compose_version"
@@ -60,7 +60,7 @@ dependencies {
6060
implementation "androidx.compose.foundation:foundation:$compose_version"
6161
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
6262
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
63-
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha06'
63+
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha07'
6464
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.1'
6565
implementation project(':navigation')
6666

@@ -72,9 +72,9 @@ dependencies {
7272

7373
// Paging
7474
implementation "androidx.paging:paging-runtime:$paging_version"
75-
implementation "androidx.paging:paging-compose:1.0.0-alpha10"
75+
implementation "androidx.paging:paging-compose:1.0.0-alpha11"
7676

7777
// Coil
7878
implementation "io.coil-kt:coil:1.2.1"
79-
implementation "com.google.accompanist:accompanist-coil:0.11.1"
79+
implementation "com.google.accompanist:accompanist-coil:0.13.0"
8080
}

app/src/main/java/dev/wirespec/adoptme/ui/screens/dummy/DummyUI.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import dev.wirespec.navigation.NavigationManager
2121

2222
@ExperimentalMaterialApi
2323
@Composable
24-
fun DummyHandler(navInfo: NavigationInfo, modifier: Modifier = Modifier) {
24+
fun DummyHandler(navInfo: NavigationInfo, modifier: Modifier = Modifier, screenIsClosing: Boolean = false) {
2525

2626
val screenText = navInfo.screenData as String
2727

app/src/main/java/dev/wirespec/adoptme/ui/screens/main/ScreenFactoryUI.kt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,30 @@ fun ScreenFactory(isVisible: Boolean, navInfo: NavigationInfo?, modifier: Modifi
4444
closeScreen = false
4545

4646
if (navInfo?.screen == Screens.PetsList) {
47-
PetsListHandler(navInfo = navInfo)
47+
PetsListHandler(navInfo = navInfo, screenIsClosing = closeScreen)
4848
return
4949
}
5050

51+
/**
52+
* IMPORTANT: It is strongly recommended that your screen's handler (PetDetailsHandler, DummyHandler,
53+
* SettingsHandler as used below) contain a parameter that is used to indicate when the screen is closing.
54+
* When animation in Compose is executed, the screen gets recomposed even when the screen is being
55+
* animated to exit. This means that any code in your screen handler will get executed when it closes.
56+
* If there is any code in your handler that should only be executed when the screen is being shown
57+
* (and not when it's removed), you should test to see if the screenIsClosing is set to true and not execute
58+
* the code in your handler.
59+
*/
60+
5161
AnimatedVisibility(
5262
visible = isVisible && !closeScreen,
5363
enter = slideInHorizontally(initialOffsetX = { it }),
5464
exit = slideOutHorizontally(targetOffsetX = { it })
5565
) {
5666
if (navInfo?.screen != null) {
5767
when (navInfo.screen) {
58-
Screens.PetDetails -> PetDetailsHandler(navInfo)
59-
Screens.Dummy -> DummyHandler(navInfo)
60-
Screens.Settings -> SettingsHandler(navInfo)
68+
Screens.PetDetails -> PetDetailsHandler(navInfo, screenIsClosing = closeScreen)
69+
Screens.Dummy -> DummyHandler(navInfo, screenIsClosing = closeScreen)
70+
Screens.Settings -> SettingsHandler(navInfo, screenIsClosing = closeScreen)
6171
}
6272
} else {
6373
Surface(modifier = modifier.fillMaxSize()) {}

app/src/main/java/dev/wirespec/adoptme/ui/screens/petdetails/PetDetailsUI.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import dev.wirespec.navigation.NavigationManager
3434
@ExperimentalAnimationApi
3535
@ExperimentalMaterialApi
3636
@Composable
37-
fun PetDetailsHandler(navInfo: NavigationInfo, modifier: Modifier = Modifier) {
37+
fun PetDetailsHandler(navInfo: NavigationInfo, modifier: Modifier = Modifier, screenIsClosing: Boolean = false) {
3838

3939
val vm = navInfo.viewmodel as PetDetailsViewModel
4040

app/src/main/java/dev/wirespec/adoptme/ui/screens/petslist/PetsListUI.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ import kotlin.math.roundToInt
5757

5858
@ExperimentalMaterialApi
5959
@Composable
60-
fun PetsListHandler(navInfo: NavigationInfo, modifier: Modifier = Modifier) {
60+
fun PetsListHandler(navInfo: NavigationInfo, modifier: Modifier = Modifier, screenIsClosing: Boolean = false) {
6161
val vm = navInfo.viewmodel as PetsListViewModel
6262
val vmMain: MainViewModel = viewModel()
6363
val coroutineScope = rememberCoroutineScope()

app/src/main/java/dev/wirespec/adoptme/ui/screens/settings/SettingsUI.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import dev.wirespec.navigation.NavigationManager
2020

2121
@ExperimentalMaterialApi
2222
@Composable
23-
fun SettingsHandler(navInfo: NavigationInfo, modifier: Modifier = Modifier) {
23+
fun SettingsHandler(navInfo: NavigationInfo, modifier: Modifier = Modifier, screenIsClosing: Boolean = false) {
2424

2525
val vm = navInfo.viewmodel as SettingsViewModel
2626
Settings(

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
33
ext {
4-
compose_version = '1.0.0-beta08'
4+
compose_version = '1.0.0-rc01'
55
}
66
repositories {
77
google()
88
mavenCentral()
99
}
1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:7.1.0-alpha02'
11+
classpath 'com.android.tools.build:gradle:7.1.0-alpha03'
1212
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10'
1313

1414
// NOTE: Do not place your application dependencies here; they belong
1515
// in the individual module build.gradle files
1616
}
1717
}
1818

19+
1920
task clean(type: Delete) {
2021
delete rootProject.buildDir
2122
}

0 commit comments

Comments
 (0)