Skip to content

Commit

Permalink
🐛 fix(ModalBottomSheet): Remove bottom padding from ModalBottomSheet. F…
Browse files Browse the repository at this point in the history
…ixed #690
  • Loading branch information
maxrave-dev committed Jan 10, 2025
1 parent 2b07362 commit f68b696
Showing 1 changed file with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
Expand Down Expand Up @@ -296,6 +299,7 @@ fun NowPlayingBottomSheet(
contentColor = Color.Transparent,
dragHandle = null,
scrimColor = Color.Black.copy(alpha = .5f),
contentWindowInsets = { WindowInsets(0, 0, 0, 0) }
) {
Card(
modifier =
Expand Down Expand Up @@ -542,6 +546,7 @@ fun NowPlayingBottomSheet(
) {
viewModel.onUIEvent(NowPlayingBottomSheetUIEvent.Share)
}
EndOfModalBottomSheet()
}
}
}
Expand Down Expand Up @@ -714,6 +719,7 @@ fun AddToPlaylistModalBottomSheet(
contentColor = Color.Transparent,
dragHandle = null,
scrimColor = Color.Black.copy(alpha = .5f),
contentWindowInsets = { WindowInsets(0, 0, 0, 0) }
) {
Card(
modifier =
Expand Down Expand Up @@ -786,6 +792,7 @@ fun AddToPlaylistModalBottomSheet(
}
}
}
EndOfModalBottomSheet()
}
}
}
Expand Down Expand Up @@ -814,6 +821,7 @@ fun SleepTimerBottomSheet(
contentColor = Color.Transparent,
dragHandle = null,
scrimColor = Color.Black.copy(alpha = .5f),
contentWindowInsets = { WindowInsets(0, 0, 0, 0) },
) {
Card(
modifier =
Expand Down Expand Up @@ -868,6 +876,7 @@ fun SleepTimerBottomSheet(
Text(text = stringResource(R.string.set), style = typo.labelSmall)
}
Spacer(modifier = Modifier.height(5.dp))
EndOfModalBottomSheet()
}
}
}
Expand Down Expand Up @@ -901,6 +910,7 @@ fun ArtistModalBottomSheet(
contentColor = Color.Transparent,
dragHandle = null,
scrimColor = Color.Black.copy(alpha = .5f),
contentWindowInsets = { WindowInsets(0, 0, 0, 0) },
) {
Card(
modifier =
Expand Down Expand Up @@ -966,6 +976,9 @@ fun ArtistModalBottomSheet(
}
}
}
item {
EndOfModalBottomSheet()
}
}
}
}
Expand Down Expand Up @@ -1047,6 +1060,7 @@ fun LocalPlaylistBottomSheet(
contentColor = Color.Transparent,
dragHandle = null,
scrimColor = Color.Black.copy(alpha = .5f),
contentWindowInsets = { WindowInsets(0, 0, 0, 0) },
) {
Card(
modifier =
Expand Down Expand Up @@ -1101,6 +1115,7 @@ fun LocalPlaylistBottomSheet(
) {
Text(text = stringResource(id = R.string.save))
}
EndOfModalBottomSheet()
}
}
}
Expand All @@ -1113,6 +1128,7 @@ fun LocalPlaylistBottomSheet(
contentColor = Color.Transparent,
dragHandle = null,
scrimColor = Color.Black.copy(alpha = .5f),
contentWindowInsets = { WindowInsets(0, 0, 0, 0) },
) {
Card(
modifier =
Expand Down Expand Up @@ -1178,18 +1194,20 @@ fun LocalPlaylistBottomSheet(
onDelete()
hideModalBottomSheet()
}
EndOfModalBottomSheet()
}
}
}
}
}

@Preview(
uiMode = Configuration.UI_MODE_NIGHT_YES,
showBackground = true,
name = "Dark Mode",
group = "Local Playlist",
)
@Composable
fun LocalPlaylistBottomSheetPreview() {
fun EndOfModalBottomSheet() {
Box(
modifier =
Modifier
.fillMaxWidth()
.height(WindowInsets.navigationBars.asPaddingValues()
.calculateBottomPadding().value.toInt().dp + 8.dp),
) {}
}

0 comments on commit f68b696

Please sign in to comment.