From 3f671350ce6e676848c01f287b61f71969079f4f Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 13 Feb 2023 16:48:42 -0500 Subject: [PATCH] Adjusting the New Post screen to show Search and Images (cropped if necessary) together with the keyboard and the text. --- .../amethyst/ui/actions/NewPostView.kt | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewPostView.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewPostView.kt index b2163dfa3..d6bef07ec 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewPostView.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewPostView.kt @@ -71,16 +71,10 @@ fun NewPostView(onClose: () -> Unit, baseReplyTo: Note? = null, account: Account decorFitsSystemWindows = false ) ) { - Surface( - modifier = Modifier - .fillMaxWidth().fillMaxHeight() - ) { - Column( - modifier = Modifier.padding(10.dp) - ) { + Surface(modifier = Modifier.fillMaxWidth().fillMaxHeight()) { + Column(modifier = Modifier.padding(10.dp).imePadding()) { Row( - modifier = Modifier - .fillMaxWidth(), + modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically ) { @@ -120,7 +114,7 @@ fun NewPostView(onClose: () -> Unit, baseReplyTo: Note? = null, account: Account capitalization = KeyboardCapitalization.Sentences ), modifier = Modifier - .fillMaxWidth() + .fillMaxWidth().weight(1f) .border( width = 1.dp, color = MaterialTheme.colors.surface, @@ -131,7 +125,7 @@ fun NewPostView(onClose: () -> Unit, baseReplyTo: Note? = null, account: Account if (it.isFocused) { keyboardController?.show() } - }.imePadding(), + }, placeholder = { Text( text = "What's on your mind?", @@ -165,7 +159,7 @@ fun NewPostView(onClose: () -> Unit, baseReplyTo: Note? = null, account: Account val myUrlPreview = postViewModel.urlPreview if (myUrlPreview != null) { - Column(modifier = Modifier.padding(top = 5.dp)) { + Row(modifier = Modifier.padding(top = 5.dp).heightIn(0.dp, 200.dp)) { if (isValidURL(myUrlPreview)) { val removedParamsFromUrl = myUrlPreview.split("?")[0].toLowerCase() if (imageExtension.matcher(removedParamsFromUrl).matches()) {