summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJonatan Rhodin <jonatan.rhodin@mullvad.net>2024-04-04 16:44:30 +0200
committerJonatan Rhodin <jonatan.rhodin@mullvad.net>2024-04-04 16:44:30 +0200
commite45f61d0f538f20d594106e0ec9ccecb40678a3b (patch)
treed087e374bc611a3e237ac56c0ddc4dcdacb947f5
parent662a75f0ecd63cd09b8766b258debe1ef642c337 (diff)
parent9441101e93708c10f333318631d3bd9ddd55c381 (diff)
downloadmullvadvpn-e45f61d0f538f20d594106e0ec9ccecb40678a3b.tar.xz
mullvadvpn-e45f61d0f538f20d594106e0ec9ccecb40678a3b.zip
Merge branch 'animations-for-expand-and-contract-items-in-select-locations-droid-828'
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt26
1 files changed, 22 insertions, 4 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt
index a7e802e89c..9144903f63 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt
@@ -197,6 +197,7 @@ fun SelectLocation(
)
}
+@OptIn(ExperimentalFoundationApi::class)
@Suppress("LongMethod")
@Composable
fun SelectLocationScreen(
@@ -331,7 +332,14 @@ fun SelectLocationScreen(
BottomSheetState.ShowEditCustomListBottomSheet(customList)
}
)
- item { Spacer(modifier = Modifier.height(Dimens.mediumPadding)) }
+ item {
+ Spacer(
+ modifier =
+ Modifier.height(Dimens.mediumPadding)
+ .animateItemPlacement()
+ .animateContentSize()
+ )
+ }
}
if (state.countries.isNotEmpty()) {
relayList(
@@ -377,7 +385,10 @@ private fun LazyListScope.customLists(
ThreeDotCell(
text = stringResource(R.string.custom_lists),
onClickDots = onShowCustomListBottomSheet,
- modifier = Modifier.testTag(SELECT_LOCATION_CUSTOM_LIST_HEADER_TEST_TAG)
+ modifier =
+ Modifier.testTag(SELECT_LOCATION_CUSTOM_LIST_HEADER_TEST_TAG)
+ .animateItemPlacement()
+ .animateContentSize()
)
}
if (customLists.isNotEmpty()) {
@@ -400,11 +411,17 @@ private fun LazyListScope.customLists(
)
}
item {
- SwitchComposeSubtitleCell(text = stringResource(R.string.to_add_locations_to_a_list))
+ SwitchComposeSubtitleCell(
+ text = stringResource(R.string.to_add_locations_to_a_list),
+ modifier = Modifier.animateItemPlacement().animateContentSize()
+ )
}
} else {
item(contentType = ContentType.EMPTY_TEXT) {
- SwitchComposeSubtitleCell(text = stringResource(R.string.to_create_a_custom_list))
+ SwitchComposeSubtitleCell(
+ text = stringResource(R.string.to_create_a_custom_list),
+ modifier = Modifier.animateItemPlacement().animateContentSize()
+ )
}
}
}
@@ -421,6 +438,7 @@ private fun LazyListScope.relayList(
) {
HeaderCell(
text = stringResource(R.string.all_locations),
+ modifier = Modifier.animateItemPlacement().animateContentSize()
)
}
items(