diff --git a/app/build.gradle b/app/build.gradle index 1fe3b466..8ccad76f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,7 +1,7 @@ plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' - id 'dev.zacsweers.moshix' version '0.17.1' + id 'dev.zacsweers.moshix' version '0.17.2' id 'dagger.hilt.android.plugin' id 'kotlin-kapt' id "com.google.protobuf" version "0.8.18" @@ -14,8 +14,8 @@ android { applicationId "bruhcollective.itaysonlab.jetispot" minSdk 23 targetSdk 32 - versionCode 5 - versionName "poc_v8" + versionCode 6 + versionName "poc_v9" resConfigs "en" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { @@ -90,7 +90,7 @@ dependencies { implementation "androidx.navigation:navigation-compose:2.4.2" implementation 'androidx.activity:activity-compose:1.4.0' implementation "androidx.compose.ui:ui:$compose_version" - implementation "androidx.compose.material:material:1.2.0-beta02" + implementation "androidx.compose.material:material:$compose_version" implementation "androidx.compose.ui:ui-tooling-preview:$compose_version" implementation "androidx.compose.material3:material3:$compose_m3_version" implementation "androidx.compose.material:material-icons-extended:$compose_version" diff --git a/app/src/main/java/bruhcollective/itaysonlab/jetispot/MainActivity.kt b/app/src/main/java/bruhcollective/itaysonlab/jetispot/MainActivity.kt index 8743ea69..9a75f037 100644 --- a/app/src/main/java/bruhcollective/itaysonlab/jetispot/MainActivity.kt +++ b/app/src/main/java/bruhcollective/itaysonlab/jetispot/MainActivity.kt @@ -36,6 +36,9 @@ import bruhcollective.itaysonlab.jetispot.ui.ext.compositeSurfaceElevation import bruhcollective.itaysonlab.jetispot.ui.screens.Screen import bruhcollective.itaysonlab.jetispot.ui.screens.nowplaying.NowPlayingScreen import bruhcollective.itaysonlab.jetispot.ui.theme.ApplicationTheme +import com.google.accompanist.navigation.material.ExperimentalMaterialNavigationApi +import com.google.accompanist.navigation.material.ModalBottomSheetLayout +import com.google.accompanist.navigation.material.rememberBottomSheetNavigator import com.google.accompanist.systemuicontroller.rememberSystemUiController import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.launch @@ -71,7 +74,7 @@ class MainActivity : ComponentActivity() { super.onBackPressed() } - @OptIn(ExperimentalMaterialApi::class) + @OptIn(ExperimentalMaterialApi::class, ExperimentalMaterialNavigationApi::class) override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -84,7 +87,8 @@ class MainActivity : ComponentActivity() { val sysUiController = rememberSystemUiController() val bsState = rememberBottomSheetScaffoldState() - val navController = rememberNavController() + val bottomSheetNavigator = rememberBottomSheetNavigator() + val navController = rememberNavController(bottomSheetNavigator) val navBackStackEntry by navController.currentBackStackEntryAsState() val lambdaNavController = LambdaNavigationController { navController } @@ -160,21 +164,23 @@ class MainActivity : ComponentActivity() { } } ) { innerPadding -> - BottomSheetScaffold( - sheetContent = { - NowPlayingScreen( - navController = lambdaNavController, - bottomSheetState = bsState.bottomSheetState, - bsOffset = bsOffset - ) - }, - scaffoldState = bsState, - sheetPeekHeight = bsPeek, - backgroundColor = MaterialTheme.colorScheme.surface - ) { innerScaffoldPadding -> - AppNavigation(navController = navController, provideLambdaController = lambdaNavController, sessionManager = sessionManager, authManager = authManager, modifier = Modifier - .padding(innerScaffoldPadding) - .padding(bottom = if (bsVisible) 0.dp else 80.dp + navBarHeightDp)) + ModalBottomSheetLayout(bottomSheetNavigator = bottomSheetNavigator) { + BottomSheetScaffold( + sheetContent = { + NowPlayingScreen( + navController = lambdaNavController, + bottomSheetState = bsState.bottomSheetState, + bsOffset = bsOffset + ) + }, + scaffoldState = bsState, + sheetPeekHeight = bsPeek, + backgroundColor = MaterialTheme.colorScheme.surface + ) { innerScaffoldPadding -> + AppNavigation(navController = navController, provideLambdaController = lambdaNavController, sessionManager = sessionManager, authManager = authManager, modifier = Modifier + .padding(innerScaffoldPadding) + .padding(bottom = if (bsVisible) 0.dp else 80.dp + navBarHeightDp)) + } } } }