Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 33 additions & 27 deletions app/src/main/java/ru/spbu/depnav/ui/component/MainMenuSheet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
Loading