diff options
| author | Kalle Lindström <karl.lindstrom@mullvad.net> | 2025-07-23 10:56:06 +0200 |
|---|---|---|
| committer | Kalle Lindström <karl.lindstrom@mullvad.net> | 2025-07-23 13:07:49 +0200 |
| commit | 073dd37af956f57ceddcd2f9b1a514b757b7bce3 (patch) | |
| tree | 0eb141a8c1aa185067f53aff4b364fd72c54a628 /android/app | |
| parent | ea9b46fd7cd1585062d79369c0c21434d91635ab (diff) | |
| download | mullvadvpn-073dd37af956f57ceddcd2f9b1a514b757b7bce3.tar.xz mullvadvpn-073dd37af956f57ceddcd2f9b1a514b757b7bce3.zip | |
Enable long press context menu for recents
Diffstat (limited to 'android/app')
| -rw-r--r-- | android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/RelayListContent.kt | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/RelayListContent.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/RelayListContent.kt index 4d7ca43f95..98b553cac1 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/RelayListContent.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/RelayListContent.kt @@ -81,7 +81,13 @@ fun LazyListScope.relayListContent( ) RelayListItem.RecentsListHeader -> RecentsListHeader() - is RelayListItem.RecentListItem -> RecentListItem(listItem, onSelectHop) + is RelayListItem.RecentListItem -> + RecentListItem( + listItem, + onSelectHop = onSelectHop, + onUpdateBottomSheetState = onUpdateBottomSheetState, + customLists = customLists, + ) RelayListItem.RecentsListFooter -> RecentsListFooter() is RelayListItem.EmptyRelayList -> EmptyRelayListText() is RelayListItem.LocationsEmptyText -> LocationsEmptyText(listItem.searchTerm) @@ -121,11 +127,21 @@ private fun GeoLocationItem( } @Composable -private fun RecentListItem(listItem: RelayListItem.RecentListItem, onSelectHop: (Hop) -> Unit) { +private fun RecentListItem( + listItem: RelayListItem.RecentListItem, + onSelectHop: (Hop) -> Unit, + onUpdateBottomSheetState: (LocationBottomSheetState) -> Unit, + customLists: List<RelayItem.CustomList>, +) { SelectableRelayListItem( relayListItem = listItem, onClick = { onSelectHop(listItem.hop) }, - onLongClick = {}, + onLongClick = { + val entry = listItem.hop.entry() + if (listItem.hop is Hop.Single<*> && entry is RelayItem.Location) { + onUpdateBottomSheetState(ShowLocationBottomSheet(customLists, entry)) + } + }, onToggleExpand = { _ -> }, modifier = Modifier.positionalPadding(listItem.itemPosition), ) |
