Adjusting the New Post screen to show Search and Images (cropped if necessary) together with the keyboard and the text.

This commit is contained in:
Vitor Pamplona
2023-02-13 16:48:42 -05:00
parent b89a8e5f8f
commit 3f671350ce
@@ -71,16 +71,10 @@ fun NewPostView(onClose: () -> Unit, baseReplyTo: Note? = null, account: Account
decorFitsSystemWindows = false decorFitsSystemWindows = false
) )
) { ) {
Surface( Surface(modifier = Modifier.fillMaxWidth().fillMaxHeight()) {
modifier = Modifier Column(modifier = Modifier.padding(10.dp).imePadding()) {
.fillMaxWidth().fillMaxHeight()
) {
Column(
modifier = Modifier.padding(10.dp)
) {
Row( Row(
modifier = Modifier modifier = Modifier.fillMaxWidth(),
.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween, horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically verticalAlignment = Alignment.CenterVertically
) { ) {
@@ -120,7 +114,7 @@ fun NewPostView(onClose: () -> Unit, baseReplyTo: Note? = null, account: Account
capitalization = KeyboardCapitalization.Sentences capitalization = KeyboardCapitalization.Sentences
), ),
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth().weight(1f)
.border( .border(
width = 1.dp, width = 1.dp,
color = MaterialTheme.colors.surface, color = MaterialTheme.colors.surface,
@@ -131,7 +125,7 @@ fun NewPostView(onClose: () -> Unit, baseReplyTo: Note? = null, account: Account
if (it.isFocused) { if (it.isFocused) {
keyboardController?.show() keyboardController?.show()
} }
}.imePadding(), },
placeholder = { placeholder = {
Text( Text(
text = "What's on your mind?", text = "What's on your mind?",
@@ -165,7 +159,7 @@ fun NewPostView(onClose: () -> Unit, baseReplyTo: Note? = null, account: Account
val myUrlPreview = postViewModel.urlPreview val myUrlPreview = postViewModel.urlPreview
if (myUrlPreview != null) { 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)) { if (isValidURL(myUrlPreview)) {
val removedParamsFromUrl = myUrlPreview.split("?")[0].toLowerCase() val removedParamsFromUrl = myUrlPreview.split("?")[0].toLowerCase()
if (imageExtension.matcher(removedParamsFromUrl).matches()) { if (imageExtension.matcher(removedParamsFromUrl).matches()) {