diff options
Diffstat (limited to 'android')
| -rw-r--r-- | android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/FilterRow.kt | 4 | ||||
| -rw-r--r-- | android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/SelectLocationScreen.kt | 20 |
2 files changed, 16 insertions, 8 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/FilterRow.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/FilterRow.kt index ab708e77d1..23bbd38b2f 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/FilterRow.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/FilterRow.kt @@ -35,6 +35,7 @@ private fun PreviewFilterCell() { @Composable fun FilterRow( filters: List<FilterChip>, + modifier: Modifier = Modifier, showTitle: Boolean = true, onRemoveOwnershipFilter: () -> Unit, onRemoveProviderFilter: () -> Unit, @@ -43,7 +44,8 @@ fun FilterRow( Row( verticalAlignment = Alignment.CenterVertically, modifier = - Modifier.padding(horizontal = Dimens.searchFieldHorizontalPadding) + modifier + .padding(horizontal = Dimens.searchFieldHorizontalPadding) .fillMaxWidth() .horizontalScroll(scrollState), horizontalArrangement = Arrangement.spacedBy(Dimens.chipSpace), diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/SelectLocationScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/SelectLocationScreen.kt index d6d3742162..797f460de2 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/SelectLocationScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/SelectLocationScreen.kt @@ -316,12 +316,17 @@ fun SelectLocationScreen( Loading() } is Lc.Content -> { + if (state.value.multihopEnabled) { + MultihopBar(state.value.relayListType, onSelectRelayList) + } + AnimatedContent( targetState = state.value.filterChips, label = "Select location top bar", ) { filterChips -> if (filterChips.isNotEmpty()) { FilterRow( + modifier = Modifier.padding(bottom = Dimens.smallPadding), filters = filterChips, onRemoveOwnershipFilter = removeOwnershipFilter, onRemoveProviderFilter = removeProviderFilter, @@ -329,12 +334,8 @@ fun SelectLocationScreen( } } - if (state.value.multihopEnabled) { - MultihopBar(state.value.relayListType, onSelectRelayList) - } - - if (state.value.filterChips.isNotEmpty() || state.value.multihopEnabled) { - Spacer(modifier = Modifier.height(height = Dimens.verticalSpace)) + if (state.value.multihopEnabled && state.value.filterChips.isEmpty()) { + Spacer(modifier = Modifier.height(Dimens.smallPadding)) } RelayLists( @@ -356,7 +357,12 @@ fun SelectLocationScreen( private fun MultihopBar(relayListType: RelayListType, onSelectRelayList: (RelayListType) -> Unit) { SingleChoiceSegmentedButtonRow( modifier = - Modifier.fillMaxWidth().padding(start = Dimens.sideMargin, end = Dimens.sideMargin) + Modifier.fillMaxWidth() + .padding( + start = Dimens.sideMargin, + end = Dimens.sideMargin, + bottom = Dimens.smallPadding, + ) ) { MullvadSegmentedStartButton( selected = relayListType == RelayListType.ENTRY, |
