mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-20 03:21:28 +02:00
Simplify RenderRegularWithGallery
Simplify collectConsecutiveImageParagraphs: just return the end index Extracting common signature parameters into a RenderContext data class Extracting GalleryImage helper function
This commit is contained in:
@@ -42,6 +42,26 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
|||||||
import com.vitorpamplona.amethyst.ui.theme.Size5dp
|
import com.vitorpamplona.amethyst.ui.theme.Size5dp
|
||||||
import kotlinx.collections.immutable.ImmutableList
|
import kotlinx.collections.immutable.ImmutableList
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun GalleryImage(
|
||||||
|
image: MediaUrlImage,
|
||||||
|
allImages: ImmutableList<MediaUrlImage>,
|
||||||
|
modifier: Modifier,
|
||||||
|
roundedCorner: Boolean,
|
||||||
|
contentScale: ContentScale,
|
||||||
|
accountViewModel: AccountViewModel,
|
||||||
|
) {
|
||||||
|
Box(modifier = modifier) {
|
||||||
|
ZoomableContentView(
|
||||||
|
content = image,
|
||||||
|
images = allImages,
|
||||||
|
roundedCorner = roundedCorner,
|
||||||
|
contentScale = contentScale,
|
||||||
|
accountViewModel = accountViewModel,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ImageGallery(
|
fun ImageGallery(
|
||||||
images: ImmutableList<MediaUrlImage>,
|
images: ImmutableList<MediaUrlImage>,
|
||||||
@@ -55,15 +75,14 @@ fun ImageGallery(
|
|||||||
}
|
}
|
||||||
images.size == 1 -> {
|
images.size == 1 -> {
|
||||||
// Single image - display full width
|
// Single image - display full width
|
||||||
Box(modifier = modifier.fillMaxWidth()) {
|
GalleryImage(
|
||||||
ZoomableContentView(
|
image = images.first(),
|
||||||
content = images.first(),
|
allImages = images,
|
||||||
images = images,
|
modifier = modifier.fillMaxWidth(),
|
||||||
roundedCorner = roundedCorner,
|
roundedCorner = roundedCorner,
|
||||||
contentScale = ContentScale.FillWidth,
|
contentScale = ContentScale.FillWidth,
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
)
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
images.size == 2 -> {
|
images.size == 2 -> {
|
||||||
// Two images - side by side in 4:3 ratio
|
// Two images - side by side in 4:3 ratio
|
||||||
@@ -116,15 +135,14 @@ private fun TwoImageGallery(
|
|||||||
horizontalArrangement = Arrangement.spacedBy(Size5dp),
|
horizontalArrangement = Arrangement.spacedBy(Size5dp),
|
||||||
) {
|
) {
|
||||||
repeat(2) { index ->
|
repeat(2) { index ->
|
||||||
Box(modifier = Modifier.weight(1f).fillMaxSize()) {
|
GalleryImage(
|
||||||
ZoomableContentView(
|
image = images[index],
|
||||||
content = images[index],
|
allImages = images,
|
||||||
images = images,
|
modifier = Modifier.weight(1f).fillMaxSize(),
|
||||||
roundedCorner = roundedCorner,
|
roundedCorner = roundedCorner,
|
||||||
contentScale = ContentScale.Crop,
|
contentScale = ContentScale.Crop,
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
)
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -141,15 +159,14 @@ private fun ThreeImageGallery(
|
|||||||
horizontalArrangement = Arrangement.spacedBy(Size5dp),
|
horizontalArrangement = Arrangement.spacedBy(Size5dp),
|
||||||
) {
|
) {
|
||||||
// Large image on the left
|
// Large image on the left
|
||||||
Box(modifier = Modifier.weight(2f).fillMaxSize()) {
|
GalleryImage(
|
||||||
ZoomableContentView(
|
image = images[0],
|
||||||
content = images[0],
|
allImages = images,
|
||||||
images = images,
|
modifier = Modifier.weight(2f).fillMaxSize(),
|
||||||
roundedCorner = roundedCorner,
|
roundedCorner = roundedCorner,
|
||||||
contentScale = ContentScale.Crop,
|
contentScale = ContentScale.Crop,
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
// Two smaller images on the right
|
// Two smaller images on the right
|
||||||
Column(
|
Column(
|
||||||
@@ -157,15 +174,14 @@ private fun ThreeImageGallery(
|
|||||||
verticalArrangement = Arrangement.spacedBy(Size5dp),
|
verticalArrangement = Arrangement.spacedBy(Size5dp),
|
||||||
) {
|
) {
|
||||||
repeat(2) { index ->
|
repeat(2) { index ->
|
||||||
Box(modifier = Modifier.weight(1f).fillMaxSize()) {
|
GalleryImage(
|
||||||
ZoomableContentView(
|
image = images[index + 1],
|
||||||
content = images[index + 1],
|
allImages = images,
|
||||||
images = images,
|
modifier = Modifier.weight(1f).fillMaxSize(),
|
||||||
roundedCorner = roundedCorner,
|
roundedCorner = roundedCorner,
|
||||||
contentScale = ContentScale.Crop,
|
contentScale = ContentScale.Crop,
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
)
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -189,15 +205,14 @@ private fun FourImageGallery(
|
|||||||
) {
|
) {
|
||||||
repeat(2) { colIndex ->
|
repeat(2) { colIndex ->
|
||||||
val imageIndex = rowIndex * 2 + colIndex
|
val imageIndex = rowIndex * 2 + colIndex
|
||||||
Box(modifier = Modifier.weight(1f).fillMaxSize()) {
|
GalleryImage(
|
||||||
ZoomableContentView(
|
image = images[imageIndex],
|
||||||
content = images[imageIndex],
|
allImages = images,
|
||||||
images = images,
|
modifier = Modifier.weight(1f).fillMaxSize(),
|
||||||
roundedCorner = roundedCorner,
|
roundedCorner = roundedCorner,
|
||||||
contentScale = ContentScale.Crop,
|
contentScale = ContentScale.Crop,
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
)
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -222,15 +237,14 @@ private fun ManyImageGallery(
|
|||||||
modifier = Modifier.padding(Size5dp),
|
modifier = Modifier.padding(Size5dp),
|
||||||
) {
|
) {
|
||||||
items(images) { image ->
|
items(images) { image ->
|
||||||
Box(modifier = Modifier.aspectRatio(1f)) {
|
GalleryImage(
|
||||||
ZoomableContentView(
|
image = image,
|
||||||
content = image,
|
allImages = images,
|
||||||
images = images,
|
modifier = Modifier.aspectRatio(1f),
|
||||||
roundedCorner = roundedCorner,
|
roundedCorner = roundedCorner,
|
||||||
contentScale = ContentScale.Crop,
|
contentScale = ContentScale.Crop,
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
)
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -114,6 +114,15 @@ import kotlinx.collections.immutable.toImmutableList
|
|||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
data class RenderContext(
|
||||||
|
val state: RichTextViewerState,
|
||||||
|
val backgroundColor: MutableState<Color>,
|
||||||
|
val quotesLeft: Int,
|
||||||
|
val callbackUri: String?,
|
||||||
|
val accountViewModel: AccountViewModel,
|
||||||
|
val nav: INav,
|
||||||
|
)
|
||||||
|
|
||||||
fun isMarkdown(content: String): Boolean =
|
fun isMarkdown(content: String): Boolean =
|
||||||
content.startsWith("> ") ||
|
content.startsWith("> ") ||
|
||||||
content.startsWith("# ") ||
|
content.startsWith("# ") ||
|
||||||
@@ -313,84 +322,78 @@ fun RenderRegularWithGallery(
|
|||||||
) {
|
) {
|
||||||
val state by remember(content, tags) { mutableStateOf(CachedRichTextParser.parseText(content, tags, callbackUri)) }
|
val state by remember(content, tags) { mutableStateOf(CachedRichTextParser.parseText(content, tags, callbackUri)) }
|
||||||
|
|
||||||
|
val context =
|
||||||
|
RenderContext(
|
||||||
|
state = state,
|
||||||
|
backgroundColor = backgroundColor,
|
||||||
|
quotesLeft = quotesLeft,
|
||||||
|
callbackUri = callbackUri,
|
||||||
|
accountViewModel = accountViewModel,
|
||||||
|
nav = nav,
|
||||||
|
)
|
||||||
|
|
||||||
val spaceWidth = measureSpaceWidth(LocalTextStyle.current)
|
val spaceWidth = measureSpaceWidth(LocalTextStyle.current)
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
// Process paragraphs and group consecutive image-only paragraphs
|
// Process each paragraph uniformly
|
||||||
var i = 0
|
var i = 0
|
||||||
while (i < state.paragraphs.size) {
|
while (i < state.paragraphs.size) {
|
||||||
val paragraph = state.paragraphs[i]
|
i =
|
||||||
|
renderParagraphWithFlowRow(
|
||||||
// Check if this paragraph contains only images
|
paragraphs = state.paragraphs,
|
||||||
val isImageOnlyParagraph =
|
paragraphIndex = i,
|
||||||
paragraph.words.all { word ->
|
spaceWidth = spaceWidth,
|
||||||
word is ImageSegment || word is Base64Segment
|
context = context,
|
||||||
}
|
|
||||||
|
|
||||||
if (isImageOnlyParagraph && paragraph.words.isNotEmpty()) {
|
|
||||||
// Collect consecutive image-only paragraphs
|
|
||||||
val (imageParagraphs, totalProcessedCount) = collectConsecutiveImageParagraphs(state.paragraphs, i)
|
|
||||||
|
|
||||||
// Combine all image words from consecutive paragraphs
|
|
||||||
val allImageWords = imageParagraphs.flatMap { it.words }.toImmutableList()
|
|
||||||
|
|
||||||
if (allImageWords.size > 1) {
|
|
||||||
// Multiple images - render as gallery (no FlowRow wrapper needed)
|
|
||||||
RenderWordsWithImageGallery(
|
|
||||||
allImageWords,
|
|
||||||
state,
|
|
||||||
backgroundColor,
|
|
||||||
quotesLeft,
|
|
||||||
callbackUri,
|
|
||||||
accountViewModel,
|
|
||||||
nav,
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
// Single image - render normally
|
|
||||||
RenderParagraphWithFlowRow(
|
|
||||||
paragraph,
|
|
||||||
paragraph.words.toImmutableList(),
|
|
||||||
spaceWidth,
|
|
||||||
state,
|
|
||||||
backgroundColor,
|
|
||||||
quotesLeft,
|
|
||||||
callbackUri,
|
|
||||||
accountViewModel,
|
|
||||||
nav,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
i += totalProcessedCount // Skip processed paragraphs (including empty ones)
|
|
||||||
} else {
|
|
||||||
// Non-image paragraph - render normally
|
|
||||||
RenderParagraphWithFlowRow(
|
|
||||||
paragraph,
|
|
||||||
paragraph.words.toImmutableList(),
|
|
||||||
spaceWidth,
|
|
||||||
state,
|
|
||||||
backgroundColor,
|
|
||||||
quotesLeft,
|
|
||||||
callbackUri,
|
|
||||||
accountViewModel,
|
|
||||||
nav,
|
|
||||||
)
|
)
|
||||||
i++
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun RenderParagraphWithFlowRow(
|
private fun renderParagraphWithFlowRow(
|
||||||
|
paragraphs: ImmutableList<ParagraphState>,
|
||||||
|
paragraphIndex: Int,
|
||||||
|
spaceWidth: Dp,
|
||||||
|
context: RenderContext,
|
||||||
|
): Int {
|
||||||
|
val paragraph = paragraphs[paragraphIndex]
|
||||||
|
|
||||||
|
// Check if this paragraph contains only images
|
||||||
|
val isImageOnlyParagraph =
|
||||||
|
paragraph.words.all { word ->
|
||||||
|
word is ImageSegment || word is Base64Segment
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isImageOnlyParagraph && paragraph.words.isNotEmpty()) {
|
||||||
|
// Collect consecutive image-only paragraphs for gallery
|
||||||
|
val (imageParagraphs, endIndex) = collectConsecutiveImageParagraphs(paragraphs, paragraphIndex)
|
||||||
|
val allImageWords = imageParagraphs.flatMap { it.words }.toImmutableList()
|
||||||
|
|
||||||
|
if (allImageWords.size > 1) {
|
||||||
|
// Multiple images - render as gallery (no FlowRow wrapper needed)
|
||||||
|
RenderWordsWithImageGallery(
|
||||||
|
allImageWords,
|
||||||
|
context,
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
// Single image - render with FlowRow wrapper
|
||||||
|
RenderSingleParagraphWithFlowRow(paragraph, paragraph.words.toImmutableList(), spaceWidth, context)
|
||||||
|
}
|
||||||
|
|
||||||
|
return endIndex // Return next index to process
|
||||||
|
} else {
|
||||||
|
// Non-image paragraph - render normally with FlowRow
|
||||||
|
RenderSingleParagraphWithFlowRow(paragraph, paragraph.words.toImmutableList(), spaceWidth, context)
|
||||||
|
return paragraphIndex + 1 // Return next index to process
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun RenderSingleParagraphWithFlowRow(
|
||||||
paragraph: ParagraphState,
|
paragraph: ParagraphState,
|
||||||
words: ImmutableList<Segment>,
|
words: ImmutableList<Segment>,
|
||||||
spaceWidth: Dp,
|
spaceWidth: Dp,
|
||||||
state: RichTextViewerState,
|
context: RenderContext,
|
||||||
backgroundColor: MutableState<Color>,
|
|
||||||
quotesLeft: Int,
|
|
||||||
callbackUri: String?,
|
|
||||||
accountViewModel: AccountViewModel,
|
|
||||||
nav: INav,
|
|
||||||
) {
|
) {
|
||||||
CompositionLocalProvider(
|
CompositionLocalProvider(
|
||||||
LocalLayoutDirection provides
|
LocalLayoutDirection provides
|
||||||
@@ -406,12 +409,7 @@ private fun RenderParagraphWithFlowRow(
|
|||||||
) {
|
) {
|
||||||
RenderWordsWithImageGallery(
|
RenderWordsWithImageGallery(
|
||||||
words,
|
words,
|
||||||
state,
|
context,
|
||||||
backgroundColor,
|
|
||||||
quotesLeft,
|
|
||||||
callbackUri,
|
|
||||||
accountViewModel,
|
|
||||||
nav,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -453,7 +451,7 @@ private fun collectConsecutiveImageParagraphs(
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Pair(imageParagraphs, j - startIndex) // Return paragraphs and total processed count
|
return Pair(imageParagraphs, j) // Return collected paragraphs and next index to process
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalLayoutApi::class)
|
@OptIn(ExperimentalLayoutApi::class)
|
||||||
@@ -551,12 +549,7 @@ private fun RenderWordWithoutPreview(
|
|||||||
@Composable
|
@Composable
|
||||||
private fun RenderWordsWithImageGallery(
|
private fun RenderWordsWithImageGallery(
|
||||||
words: ImmutableList<Segment>,
|
words: ImmutableList<Segment>,
|
||||||
state: RichTextViewerState,
|
context: RenderContext,
|
||||||
backgroundColor: MutableState<Color>,
|
|
||||||
quotesLeft: Int,
|
|
||||||
callbackUri: String? = null,
|
|
||||||
accountViewModel: AccountViewModel,
|
|
||||||
nav: INav,
|
|
||||||
) {
|
) {
|
||||||
var i = 0
|
var i = 0
|
||||||
while (i < words.size) {
|
while (i < words.size) {
|
||||||
@@ -577,25 +570,25 @@ private fun RenderWordsWithImageGallery(
|
|||||||
imageSegments
|
imageSegments
|
||||||
.mapNotNull { segment ->
|
.mapNotNull { segment ->
|
||||||
val imageUrl = segment.segmentText
|
val imageUrl = segment.segmentText
|
||||||
state.imagesForPager[imageUrl] as? MediaUrlImage
|
context.state.imagesForPager[imageUrl] as? MediaUrlImage
|
||||||
}.toImmutableList()
|
}.toImmutableList()
|
||||||
|
|
||||||
if (imageContents.isNotEmpty()) {
|
if (imageContents.isNotEmpty()) {
|
||||||
ImageGallery(
|
ImageGallery(
|
||||||
images = imageContents,
|
images = imageContents,
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = context.accountViewModel,
|
||||||
roundedCorner = true,
|
roundedCorner = true,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Single image - render normally
|
// Single image - render normally
|
||||||
RenderWordWithPreview(word, state, backgroundColor, quotesLeft, callbackUri, accountViewModel, nav)
|
RenderWordWithPreview(word, context)
|
||||||
}
|
}
|
||||||
|
|
||||||
i = j // Skip processed images
|
i = j // Skip processed images
|
||||||
} else {
|
} else {
|
||||||
// Non-image word - render normally
|
// Non-image word - render normally
|
||||||
RenderWordWithPreview(word, state, backgroundColor, quotesLeft, callbackUri, accountViewModel, nav)
|
RenderWordWithPreview(word, context)
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -604,30 +597,25 @@ private fun RenderWordsWithImageGallery(
|
|||||||
@Composable
|
@Composable
|
||||||
private fun RenderWordWithPreview(
|
private fun RenderWordWithPreview(
|
||||||
word: Segment,
|
word: Segment,
|
||||||
state: RichTextViewerState,
|
context: RenderContext,
|
||||||
backgroundColor: MutableState<Color>,
|
|
||||||
quotesLeft: Int,
|
|
||||||
callbackUri: String? = null,
|
|
||||||
accountViewModel: AccountViewModel,
|
|
||||||
nav: INav,
|
|
||||||
) {
|
) {
|
||||||
when (word) {
|
when (word) {
|
||||||
is ImageSegment -> ZoomableContentView(word.segmentText, state, accountViewModel)
|
is ImageSegment -> ZoomableContentView(word.segmentText, context.state, context.accountViewModel)
|
||||||
is LinkSegment -> LoadUrlPreview(word.segmentText, word.segmentText, callbackUri, accountViewModel)
|
is LinkSegment -> LoadUrlPreview(word.segmentText, word.segmentText, context.callbackUri, context.accountViewModel)
|
||||||
is EmojiSegment -> RenderCustomEmoji(word.segmentText, state)
|
is EmojiSegment -> RenderCustomEmoji(word.segmentText, context.state)
|
||||||
is InvoiceSegment -> MayBeInvoicePreview(word.segmentText, accountViewModel)
|
is InvoiceSegment -> MayBeInvoicePreview(word.segmentText, context.accountViewModel)
|
||||||
is WithdrawSegment -> MayBeWithdrawal(word.segmentText, accountViewModel)
|
is WithdrawSegment -> MayBeWithdrawal(word.segmentText, context.accountViewModel)
|
||||||
is CashuSegment -> CashuPreview(word.segmentText, accountViewModel)
|
is CashuSegment -> CashuPreview(word.segmentText, context.accountViewModel)
|
||||||
is EmailSegment -> ClickableEmail(word.segmentText)
|
is EmailSegment -> ClickableEmail(word.segmentText)
|
||||||
is SecretEmoji -> DisplaySecretEmoji(word, state, callbackUri, true, quotesLeft, backgroundColor, accountViewModel, nav)
|
is SecretEmoji -> DisplaySecretEmoji(word, context.state, context.callbackUri, true, context.quotesLeft, context.backgroundColor, context.accountViewModel, context.nav)
|
||||||
is PhoneSegment -> ClickablePhone(word.segmentText)
|
is PhoneSegment -> ClickablePhone(word.segmentText)
|
||||||
is BechSegment -> BechLink(word.segmentText, true, quotesLeft, backgroundColor, accountViewModel, nav)
|
is BechSegment -> BechLink(word.segmentText, true, context.quotesLeft, context.backgroundColor, context.accountViewModel, context.nav)
|
||||||
is HashTagSegment -> HashTag(word, nav)
|
is HashTagSegment -> HashTag(word, context.nav)
|
||||||
is HashIndexUserSegment -> TagLink(word, accountViewModel, nav)
|
is HashIndexUserSegment -> TagLink(word, context.accountViewModel, context.nav)
|
||||||
is HashIndexEventSegment -> TagLink(word, true, quotesLeft, backgroundColor, accountViewModel, nav)
|
is HashIndexEventSegment -> TagLink(word, true, context.quotesLeft, context.backgroundColor, context.accountViewModel, context.nav)
|
||||||
is SchemelessUrlSegment -> NoProtocolUrlRenderer(word)
|
is SchemelessUrlSegment -> NoProtocolUrlRenderer(word)
|
||||||
is RegularTextSegment -> Text(word.segmentText)
|
is RegularTextSegment -> Text(word.segmentText)
|
||||||
is Base64Segment -> ZoomableContentView(word.segmentText, state, accountViewModel)
|
is Base64Segment -> ZoomableContentView(word.segmentText, context.state, context.accountViewModel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -786,15 +774,20 @@ fun CoreSecretMessage(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
|
val context =
|
||||||
|
RenderContext(
|
||||||
|
state = localSecretContent,
|
||||||
|
backgroundColor = backgroundColor,
|
||||||
|
quotesLeft = quotesLeft,
|
||||||
|
callbackUri = callbackUri,
|
||||||
|
accountViewModel = accountViewModel,
|
||||||
|
nav = nav,
|
||||||
|
)
|
||||||
|
|
||||||
if (localSecretContent.paragraphs.size == 1) {
|
if (localSecretContent.paragraphs.size == 1) {
|
||||||
RenderWordsWithImageGallery(
|
RenderWordsWithImageGallery(
|
||||||
localSecretContent.paragraphs[0].words.toImmutableList(),
|
localSecretContent.paragraphs[0].words.toImmutableList(),
|
||||||
localSecretContent,
|
context,
|
||||||
backgroundColor,
|
|
||||||
quotesLeft,
|
|
||||||
callbackUri,
|
|
||||||
accountViewModel,
|
|
||||||
nav,
|
|
||||||
)
|
)
|
||||||
} else if (localSecretContent.paragraphs.size > 1) {
|
} else if (localSecretContent.paragraphs.size > 1) {
|
||||||
val spaceWidth = measureSpaceWidth(LocalTextStyle.current)
|
val spaceWidth = measureSpaceWidth(LocalTextStyle.current)
|
||||||
@@ -807,12 +800,7 @@ fun CoreSecretMessage(
|
|||||||
) {
|
) {
|
||||||
RenderWordsWithImageGallery(
|
RenderWordsWithImageGallery(
|
||||||
paragraph.words.toImmutableList(),
|
paragraph.words.toImmutableList(),
|
||||||
localSecretContent,
|
context,
|
||||||
backgroundColor,
|
|
||||||
quotesLeft,
|
|
||||||
callbackUri,
|
|
||||||
accountViewModel,
|
|
||||||
nav,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user