diff --git a/app/src/main/java/ru/spbu/depnav/ui/component/MainMenuSheet.kt b/app/src/main/java/ru/spbu/depnav/ui/component/MainMenuSheet.kt index 6ddbcff..91124a0 100644 --- a/app/src/main/java/ru/spbu/depnav/ui/component/MainMenuSheet.kt +++ b/app/src/main/java/ru/spbu/depnav/ui/component/MainMenuSheet.kt @@ -26,6 +26,8 @@ import androidx.compose.foundation.layout.ColumnScope import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme @@ -60,38 +62,42 @@ fun MainMenuSheet( onMapLegendClick: () -> Unit ) { ModalDrawerSheet { - AppTitle() + // Applying the modifier to ModalDrawerSheet itself stops it from occupying whole height of + // the window + Column(Modifier.verticalScroll(rememberScrollState())) { + AppTitle() - MapItems(selectedMapId, availableMaps, onMapSelected) + MapItems(selectedMapId, availableMaps, onMapSelected) - HorizontalDivider( - modifier = Modifier.padding( - horizontal = ITEM_HORIZONTAL_PADDING, - vertical = DIVIDER_VERTICAL_PADDING + HorizontalDivider( + modifier = Modifier.padding( + horizontal = ITEM_HORIZONTAL_PADDING, + vertical = DIVIDER_VERTICAL_PADDING + ) ) - ) - MiscItem( - icon = { - Icon( - painterResource(R.drawable.ic_settings), - contentDescription = stringResource(R.string.label_open_settings) - ) - }, - labelText = stringResource(R.string.settings), - onClick = onSettingsClick - ) + MiscItem( + icon = { + Icon( + painterResource(R.drawable.ic_settings), + contentDescription = stringResource(R.string.label_open_settings) + ) + }, + labelText = stringResource(R.string.settings), + onClick = onSettingsClick + ) - MiscItem( - icon = { - Icon( - painterResource(R.drawable.ic_info), - contentDescription = stringResource(R.string.label_open_map_legend) - ) - }, - labelText = stringResource(R.string.map_legend), - onClick = onMapLegendClick - ) + MiscItem( + icon = { + Icon( + painterResource(R.drawable.ic_info), + contentDescription = stringResource(R.string.label_open_map_legend) + ) + }, + labelText = stringResource(R.string.map_legend), + onClick = onMapLegendClick + ) + } } } diff --git a/app/src/main/java/ru/spbu/depnav/ui/component/MapSearchBar.kt b/app/src/main/java/ru/spbu/depnav/ui/component/MapSearchBar.kt index 084dbaf..cb3f348 100644 --- a/app/src/main/java/ru/spbu/depnav/ui/component/MapSearchBar.kt +++ b/app/src/main/java/ru/spbu/depnav/ui/component/MapSearchBar.kt @@ -54,6 +54,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.util.lerp import ru.spbu.depnav.R +import ru.spbu.depnav.ui.theme.DEFAULT_PADDING import ru.spbu.depnav.ui.theme.MAP_OVERLAY_ALPHA import ru.spbu.depnav.ui.viewmodel.SearchResults @@ -142,7 +143,7 @@ fun MapSearchBar( }, expanded = expanded, onExpandedChange = onExpandedChange, - modifier = modifier, + modifier = modifier.padding(horizontal = DEFAULT_PADDING * (1 - expansionProgress)), colors = SearchBarDefaults.colors( containerColor = SearchBarDefaults.colors().containerColor.copy( alpha = lerp(MAP_OVERLAY_ALPHA, 1f, expansionProgress)