From 20570bb4455ffcdb8e21e2e39e482fbc467bdc32 Mon Sep 17 00:00:00 2001 From: saber safavi Date: Tue, 24 Oct 2023 13:46:40 +0200 Subject: [PATCH] Add scroll to privacy disclaimer screen --- .../compose/screen/PrivacyDisclaimerScreen.kt | 18 +++++++++++------- .../lib/theme/dimensions/Dimensions.kt | 1 + 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/PrivacyDisclaimerScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/PrivacyDisclaimerScreen.kt index f78b54f9897f..0892eb8d6d7e 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/PrivacyDisclaimerScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/PrivacyDisclaimerScreen.kt @@ -9,7 +9,9 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width +import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.text.ClickableText +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -56,7 +58,7 @@ fun PrivacyDisclaimerScreen( modifier = Modifier.fillMaxHeight() .fillMaxWidth() - .padding(it) +// .padding(it) .background(color = MaterialTheme.colorScheme.background) ) { val (body, actionButtons) = createRefs() @@ -64,12 +66,14 @@ fun PrivacyDisclaimerScreen( Column( modifier = - Modifier.constrainAs(body) { - top.linkTo(parent.top, margin = sideMargin) - start.linkTo(parent.start, margin = sideMargin) - end.linkTo(parent.end, margin = sideMargin) - width = Dimension.fillToConstraints - }, + Modifier.padding(bottom = Dimens.privacyPolicyBottomPadding) + .verticalScroll(rememberScrollState()) + .constrainAs(body) { + top.linkTo(parent.top, margin = sideMargin) + start.linkTo(parent.start, margin = sideMargin) + end.linkTo(parent.end, margin = sideMargin) + width = Dimension.fillToConstraints + }, ) { Text( text = stringResource(id = R.string.privacy_disclaimer_title), diff --git a/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/dimensions/Dimensions.kt b/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/dimensions/Dimensions.kt index 3bb59368f30e..c13201e55919 100644 --- a/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/dimensions/Dimensions.kt +++ b/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/dimensions/Dimensions.kt @@ -41,6 +41,7 @@ data class Dimensions( val notificationBannerStartPadding: Dp = 16.dp, val notificationEndIconPadding: Dp = 4.dp, val notificationStatusIconSize: Dp = 10.dp, + val privacyPolicyBottomPadding: Dp = 120.dp, // val problemReportIconToTitlePadding: Dp = 60.dp, val progressIndicatorSize: Dp = 48.dp, val relayCircleSize: Dp = 16.dp,