Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Remove tonalElevation for ModalBottomSheet
Browse files Browse the repository at this point in the history
  • Loading branch information
SanmerDev committed Jun 29, 2024
1 parent 8f67599 commit 517f30d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ fun VersionItemBottomSheet(
sheetState = state,
shape = BottomSheetDefaults.expandedShape(15.dp),
windowInsets = WindowInsets.navigationBars,
containerColor = MaterialTheme.colorScheme.surface,
tonalElevation = 0.dp,
dragHandle = {
if (hasChangelog) {
BottomSheetDefaults.DragHandle()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand Down Expand Up @@ -47,7 +47,7 @@ internal fun ModulesMenu(
setHomepage: () -> Unit,
) {
val userPreferences = LocalUserPreferences.current
var open by rememberSaveable { mutableStateOf(false) }
var open by remember { mutableStateOf(false) }

IconButton(
onClick = { open = true }
Expand Down Expand Up @@ -80,7 +80,9 @@ private fun BottomSheet(
onDismissRequest = onClose,
sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true),
shape = BottomSheetDefaults.expandedShape(15.dp),
windowInsets = WindowInsets.navigationBars
windowInsets = WindowInsets.navigationBars,
containerColor = MaterialTheme.colorScheme.surface,
tonalElevation = 0.dp
) {
Text(
text = stringResource(id = R.string.menu_advanced_menu),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand Down Expand Up @@ -52,7 +52,7 @@ internal fun RepositoryMenu(
setHomepage: () -> Unit,
) {
val userPreferences = LocalUserPreferences.current
var open by rememberSaveable { mutableStateOf(false) }
var open by remember { mutableStateOf(false) }

IconButton(
onClick = { open = true }
Expand Down Expand Up @@ -85,7 +85,9 @@ private fun BottomSheet(
onDismissRequest = onClose,
sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true),
shape = BottomSheetDefaults.expandedShape(15.dp),
windowInsets = WindowInsets.navigationBars
windowInsets = WindowInsets.navigationBars,
containerColor = MaterialTheme.colorScheme.surface,
tonalElevation = 0.dp
) {
Text(
text = stringResource(id = R.string.menu_advanced_menu),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -25,12 +25,14 @@ import dev.sanmer.mrepo.ui.utils.expandedShape
internal fun LicenseItem(
licenseId: String
) = Box {
var open by rememberSaveable { mutableStateOf(false) }
var open by remember { mutableStateOf(false) }
if (open) {
ModalBottomSheet(
onDismissRequest = { open = false },
shape = BottomSheetDefaults.expandedShape(15.dp),
windowInsets = WindowInsets.navigationBars
windowInsets = WindowInsets.navigationBars,
containerColor = MaterialTheme.colorScheme.surface,
tonalElevation = 0.dp
) {
Text(
text = stringResource(id = R.string.license_title),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -30,7 +30,7 @@ internal fun AppThemeItem(
onThemeColorChange: (Int) -> Unit,
onDarkModeChange: (DarkMode) -> Unit
) {
var open by rememberSaveable { mutableStateOf(false) }
var open by remember { mutableStateOf(false) }
if (open) {
BottomSheet(
onClose = { open = false },
Expand Down Expand Up @@ -62,7 +62,9 @@ private fun BottomSheet(
onDismissRequest = onClose,
sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true),
shape = BottomSheetDefaults.expandedShape(15.dp),
windowInsets = WindowInsets.navigationBars
windowInsets = WindowInsets.navigationBars,
containerColor = MaterialTheme.colorScheme.surface,
tonalElevation = 0.dp
) {
Text(
text = stringResource(id = R.string.settings_app_theme),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package dev.sanmer.mrepo.ui.screens.settings.app.items

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -83,11 +84,11 @@ private fun ThemeColorItem(
modifier = Modifier
.clip(RoundedCornerShape(15.dp))
.clickable(
onClick = { onChange(id) }
)
.background(
color = colorScheme.surfaceColorAtElevation(3.dp)
onClick = { onChange(id) },
indication = null,
interactionSource = remember { MutableInteractionSource() }
)
.background(color = colorScheme.surfaceColorAtElevation(6.dp))
.size(60.dp),
contentAlignment = Alignment.Center
) {
Expand Down

0 comments on commit 517f30d

Please sign in to comment.