Skip to content
Merged
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
12 changes: 10 additions & 2 deletions shared/src/commonMain/kotlin/dev/johnoreilly/galwaybus/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,7 @@ private fun FavouritesPanel(
viewModel.toggleFavourite(stop)
onShowMessage(if (wasFavourite) removedMessage else savedMessage)
},
onStopClick = { viewModel.selectMapStop(it) },
modifier = Modifier.weight(1f).fillMaxWidth()
)
}
Expand Down Expand Up @@ -1560,12 +1561,16 @@ private fun FavouritesPanel(
}
}

/** Search hits across every stop in the network, each with a star to favourite it directly. */
/**
* Search hits across every stop in the network. Tapping one opens its departures (the same sheet a
* stop on the map opens); its star favourites it directly without opening anything.
*/
@Composable
private fun StopSearchResults(
results: List<Stop>,
favouriteRefs: Set<String>,
onToggleFavourite: (Stop) -> Unit,
onStopClick: (Stop) -> Unit,
modifier: Modifier = Modifier
) {
if (results.isEmpty()) {
Expand All @@ -1581,7 +1586,10 @@ private fun StopSearchResults(
LazyColumn(modifier) {
items(results, key = { it.stop_ref }) { stop ->
Row(
Modifier.fillMaxWidth().padding(start = 16.dp, end = 4.dp, top = 6.dp, bottom = 6.dp),
Modifier
.fillMaxWidth()
.clickable { onStopClick(stop) }
.padding(start = 16.dp, end = 4.dp, top = 6.dp, bottom = 6.dp),
verticalAlignment = Alignment.CenterVertically
) {
Icon(
Expand Down
Loading