From f4861482f130c09600b56e5474866ba2219626ca Mon Sep 17 00:00:00 2001 From: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Date: Tue, 23 May 2023 14:31:43 +0400 Subject: [PATCH] mobile: group welcome message to fill max width (#2480) * mobile: group welcome message to fill max width * not limiting preview height * min height, no scroll --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> --- .../simplex/app/views/chat/group/WelcomeMessageView.kt | 8 ++------ apps/ios/Shared/Views/Chat/Group/GroupWelcomeView.swift | 9 ++++----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/apps/android/app/src/main/java/chat/simplex/app/views/chat/group/WelcomeMessageView.kt b/apps/android/app/src/main/java/chat/simplex/app/views/chat/group/WelcomeMessageView.kt index 5ae99cd4fa..db3fd4daa1 100644 --- a/apps/android/app/src/main/java/chat/simplex/app/views/chat/group/WelcomeMessageView.kt +++ b/apps/android/app/src/main/java/chat/simplex/app/views/chat/group/WelcomeMessageView.kt @@ -114,12 +114,8 @@ private fun GroupWelcomeLayout( @Composable private fun TextPreview(text: String, linkMode: SimplexLinkMode, markdown: Boolean = true) { - Column( - Modifier.height(140.dp) - ) { - SelectionContainer( - Modifier.verticalScroll(rememberScrollState()) - ) { + Column { + SelectionContainer(Modifier.fillMaxWidth()) { MarkdownText( text, formattedText = if (markdown) remember(text) { parseToMarkdown(text) } else null, diff --git a/apps/ios/Shared/Views/Chat/Group/GroupWelcomeView.swift b/apps/ios/Shared/Views/Chat/Group/GroupWelcomeView.swift index 75873131be..0e47d9dddf 100644 --- a/apps/ios/Shared/Views/Chat/Group/GroupWelcomeView.swift +++ b/apps/ios/Shared/Views/Chat/Group/GroupWelcomeView.swift @@ -53,10 +53,10 @@ struct GroupWelcomeView: View { } private func textPreview() -> some View { - ScrollView { - messageText(welcomeText, parseSimpleXMarkdown(welcomeText), nil) - .allowsHitTesting(false) - } + messageText(welcomeText, parseSimpleXMarkdown(welcomeText), nil) + .allowsHitTesting(false) + .frame(minHeight: 140, alignment: .topLeading) + .frame(maxWidth: .infinity, alignment: .leading) } private func editorView() -> some View { @@ -80,7 +80,6 @@ struct GroupWelcomeView: View { } } else { textPreview() - .frame(height: 140, alignment: .topLeading) } Button {