Skip to content

Commit

Permalink
chore: Update to Jetpack Compose 1.2.0 beta
Browse files Browse the repository at this point in the history
  • Loading branch information
svenjacobs committed May 29, 2022
1 parent cf05246 commit 6899b90
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 51 deletions.
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ dependencies {
implementation(libs.androidx.constraintlayout.compose)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.hilt.navigation.compose)
implementation(libs.google.accompanist.insets)
//endregion

implementation(libs.androidx.startup.runtime)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Léon - The URL Cleaner
* Copyright (C) 2021 Sven Jacobs
* Copyright (C) 2022 Sven Jacobs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -45,9 +45,6 @@ import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
import com.google.accompanist.insets.ProvideWindowInsets
import com.google.accompanist.insets.navigationBarsPadding
import com.google.accompanist.insets.statusBarsPadding
import com.svenjacobs.app.leon.BuildConfig
import com.svenjacobs.app.leon.R
import com.svenjacobs.app.leon.services.model.CleaningResult
Expand Down Expand Up @@ -79,53 +76,51 @@ fun MainScreen(
val isBackVisible by viewModel.isBackVisible.collectAsState()

AppTheme {
ProvideWindowInsets {
Scaffold(
topBar = { MyTopAppBar(isBackVisible, navController) },
bottomBar = { MyBottomBar(navController) },
content = { padding ->
Box(
modifier = Modifier.padding(
start = padding.calculateStartPadding(layoutDirection = LocalLayoutDirection.current),
top = padding.calculateTopPadding(),
end = padding.calculateEndPadding(layoutDirection = LocalLayoutDirection.current),
bottom = padding.calculateBottomPadding(),
)
Scaffold(
topBar = { MyTopAppBar(isBackVisible, navController) },
bottomBar = { MyBottomBar(navController) },
content = { padding ->
Box(
modifier = Modifier.padding(
start = padding.calculateStartPadding(layoutDirection = LocalLayoutDirection.current),
top = padding.calculateTopPadding(),
end = padding.calculateEndPadding(layoutDirection = LocalLayoutDirection.current),
bottom = padding.calculateBottomPadding(),
)
) {
BackgroundImage()

NavHost(
navController = navController,
startDestination = Screen.Home.route,
) {
BackgroundImage()

NavHost(
navController = navController,
startDestination = Screen.Home.route,
) {
composable(Screen.Home.route) {
viewModel.setIsBackVisible(false)
HomeScreen(
result = result,
onShareButtonClick = ::onShareButtonClick,
onVerifyButtonClick = ::onVerifyButtonClick,
)
}
composable(Screen.Home.route) {
viewModel.setIsBackVisible(false)
HomeScreen(
result = result,
onShareButtonClick = ::onShareButtonClick,
onVerifyButtonClick = ::onVerifyButtonClick,
)
}

composable(Screen.Settings.route) {
viewModel.setIsBackVisible(false)
SettingsScreen(
viewModel = hiltViewModel(),
navController = navController,
)
}
composable(Screen.Settings.route) {
viewModel.setIsBackVisible(false)
SettingsScreen(
viewModel = hiltViewModel(),
navController = navController,
)
}

composable(Screen.SettingsParameters.route) {
viewModel.setIsBackVisible(true)
SettingsParametersScreen(
viewModel = hiltViewModel(),
)
}
composable(Screen.SettingsParameters.route) {
viewModel.setIsBackVisible(true)
SettingsParametersScreen(
viewModel = hiltViewModel(),
)
}
}
},
)
}
}
},
)
}
}

Expand Down
7 changes: 3 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[versions]
android-gradle-plugin = "7.2.1"
androidx-activity = "1.4.0"
androidx-compose = "1.1.1"
androidx-compose = "1.2.0-beta02"
androidx-lifecycle = "2.4.1"
androidx-room = "2.4.2"
google-accompanist = "0.23.1"
google-accompanist = "0.24.9-beta"
google-hilt = "2.42"
kotest = "5.3.0"
kotlin = "1.6.10"
kotlin = "1.6.21"
kotlinx-coroutines = "1.6.2"
mikepenz-aboutlibraries = "10.3.0"
mockk = "1.12.4"
Expand All @@ -34,7 +34,6 @@ androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref =
androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "androidx-room" }
androidx-startup-runtime = "androidx.startup:startup-runtime:1.1.1"
facebook-stetho = "com.facebook.stetho:stetho:1.6.0"
google-accompanist-insets = { module = "com.google.accompanist:accompanist-insets", version.ref = "google-accompanist" }
google-hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "google-hilt" }
google-hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "google-hilt" }
google-hilt-android-gradle-plugin = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "google-hilt" }
Expand Down

0 comments on commit 6899b90

Please sign in to comment.