From 6f6a49ea3c80d7b6f3492667c4f00055406bcc21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Font=C3=A1n?= Date: Sat, 27 Apr 2024 22:34:55 +0200 Subject: [PATCH] feat: Added some elevation to the draggable player MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Fontán --- .../com/bobbyesp/metadator/presentation/Navigation.kt | 8 +++++++- .../presentation/components/others/MediaplayerSheet.kt | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/bobbyesp/metadator/presentation/Navigation.kt b/app/src/main/java/com/bobbyesp/metadator/presentation/Navigation.kt index 7284d6d..3ed993a 100644 --- a/app/src/main/java/com/bobbyesp/metadator/presentation/Navigation.kt +++ b/app/src/main/java/com/bobbyesp/metadator/presentation/Navigation.kt @@ -6,6 +6,8 @@ import androidx.compose.foundation.layout.BoxWithConstraints import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.rounded.Square import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.ModalDrawerSheet @@ -127,6 +129,9 @@ fun Navigator() { return@NavigationDrawerItem } else { navController.navigate(route.route) { + popUpTo(Route.MainHost.route) { + saveState = true + } launchSingleTop = true restoreState = true } @@ -135,7 +140,8 @@ fun Navigator() { } } }, icon = { - Icon(imageVector = route.icon!!, + Icon( + imageVector = route.icon ?: Icons.Rounded.Square, contentDescription = route.title?.let { stringResource(id = it) }) }, badge = { diff --git a/app/src/main/java/com/bobbyesp/metadator/presentation/components/others/MediaplayerSheet.kt b/app/src/main/java/com/bobbyesp/metadator/presentation/components/others/MediaplayerSheet.kt index 3b1cfba..9bcaac3 100644 --- a/app/src/main/java/com/bobbyesp/metadator/presentation/components/others/MediaplayerSheet.kt +++ b/app/src/main/java/com/bobbyesp/metadator/presentation/components/others/MediaplayerSheet.kt @@ -62,7 +62,7 @@ fun MediaplayerSheet( viewModel = viewModel, ) }, - backgroundColor = MaterialTheme.colorScheme.surfaceColorAtElevation(NavigationBarDefaults.Elevation) + backgroundColor = MaterialTheme.colorScheme.surfaceColorAtElevation(NavigationBarDefaults.Elevation + 2.dp) ) { MediaplayerExpandedContent( viewModel = viewModel,