summaryrefslogtreecommitdiffhomepage
path: root/android/app/src
diff options
context:
space:
mode:
authorAlbin <albin@mullvad.net>2022-12-12 17:14:04 +0100
committerAlbin <albin@mullvad.net>2022-12-13 12:03:50 +0100
commit2321238eda29869d5e193aa6ddf9ea3b66570a22 (patch)
tree6c4177a95a557ffc405fce81ed1468c0c1cf5aa1 /android/app/src
parent347757faf6e796b6b4fbc021e6564e0126fbc0a2 (diff)
downloadmullvadvpn-2321238eda29869d5e193aa6ddf9ea3b66570a22.tar.xz
mullvadvpn-2321238eda29869d5e193aa6ddf9ea3b66570a22.zip
Add changelog dialog preview
Diffstat (limited to 'android/app/src')
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/ChangelogDialog.kt46
1 files changed, 46 insertions, 0 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/ChangelogDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/ChangelogDialog.kt
index 976abc5364..9f2dabae5f 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/ChangelogDialog.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/ChangelogDialog.kt
@@ -17,6 +17,7 @@ import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.text.style.TextAlign
+import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.sp
import androidx.compose.ui.window.DialogProperties
import net.mullvad.mullvadvpn.R
@@ -93,3 +94,48 @@ fun ChangelogDialog(
backgroundColor = colorResource(id = R.color.darkBlue)
)
}
+
+@Preview
+@Composable
+private fun PreviewChangelogDialogWithSingleShortItem() {
+ ChangelogDialog(
+ changesList = listOf("Item 1"),
+ version = "1111.1",
+ onDismiss = {}
+ )
+}
+
+@Preview
+@Composable
+private fun PreviewChangelogDialogWithTwoLongItems() {
+ val longPreviewText = "This is a sample changelog item of a Compose Preview visualization. " +
+ "The purpose of this specific sample text is to visualize a long text that will result " +
+ "in multiple lines in the changelog dialog."
+
+ ChangelogDialog(
+ changesList = listOf(longPreviewText, longPreviewText),
+ version = "1111.1",
+ onDismiss = {}
+ )
+}
+
+@Preview
+@Composable
+private fun PreviewChangelogDialogWithTenShortItems() {
+ ChangelogDialog(
+ changesList = listOf(
+ "Item 1",
+ "Item 2",
+ "Item 3",
+ "Item 4",
+ "Item 5",
+ "Item 6",
+ "Item 7",
+ "Item 8",
+ "Item 9",
+ "Item 10"
+ ),
+ version = "1111.1",
+ onDismiss = {}
+ )
+}