From e5581e19e549efd9e3a376fe31213bdf47a99aff Mon Sep 17 00:00:00 2001 From: Josh Holtz Date: Mon, 26 Aug 2024 11:27:41 -0500 Subject: [PATCH 1/2] Add spacing between paragraphs and make text go full width so text align applies --- .../purchases/ui/revenuecatui/composables/Markdown.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/revenuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/composables/Markdown.kt b/ui/revenuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/composables/Markdown.kt index 28eeb9d187..9ae42c936d 100644 --- a/ui/revenuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/composables/Markdown.kt +++ b/ui/revenuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/composables/Markdown.kt @@ -3,8 +3,10 @@ package com.revenuecat.purchases.ui.revenuecatui.composables import androidx.compose.foundation.gestures.detectTapGestures +import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text @@ -16,6 +18,7 @@ import androidx.compose.ui.draw.drawBehind import androidx.compose.ui.geometry.Offset import androidx.compose.ui.graphics.Color import androidx.compose.ui.input.pointer.pointerInput +import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.LocalUriHandler import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.text.SpanStyle @@ -69,7 +72,12 @@ internal fun Markdown( ) { val root = parser.parse(text) as Document - Column { + val density = LocalDensity.current + val paragraphPadding = with(density) { style.lineHeight.toDp() } + + Column( + verticalArrangement = Arrangement.spacedBy(paragraphPadding), + ) { MDDocument(root, color, style, fontWeight, textAlign, allowLinks, modifier) } } @@ -375,6 +383,7 @@ private fun MarkdownText( fontWeight = fontWeight, textAlign = textAlign, modifier = modifier + .fillMaxWidth() .conditional(allowLinks) { pointerInput(Unit) { detectTapGestures { offset -> From 0f2e1a4cb0b1995844c92d216e4d0cec9498a2cf Mon Sep 17 00:00:00 2001 From: Josh Holtz Date: Mon, 26 Aug 2024 15:23:36 -0500 Subject: [PATCH 2/2] Update snaptshots --- fastlane/.purchases-android-snapshots-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/.purchases-android-snapshots-commit b/fastlane/.purchases-android-snapshots-commit index 121bfac065..c16a5b2cec 100644 --- a/fastlane/.purchases-android-snapshots-commit +++ b/fastlane/.purchases-android-snapshots-commit @@ -1 +1 @@ -86ca6a1231c3e7dcbc34924f8cea83322029adb9 +02ef696e3beddcdbc6791eb3c9a9140ec4e58c8f