mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-09 05:50:15 +01:00
bug with search view alignment
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
6d4e5d2774
commit
05815ebeae
@ -13,6 +13,8 @@ import android.app.Activity
|
||||
import android.content.Intent
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.wrapContentWidth
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||
import androidx.compose.material.icons.filled.Search
|
||||
@ -48,9 +50,13 @@ fun AppBar(
|
||||
clickAddButton: (Boolean) -> Unit
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
|
||||
val appTitle = if(!isSearchActive){
|
||||
title
|
||||
}else{
|
||||
""
|
||||
}
|
||||
TopAppBar(
|
||||
title = { Text(text = title) },
|
||||
title = { Text(text = appTitle) },
|
||||
navigationIcon = {
|
||||
IconButton(onClick = {
|
||||
(context as? Activity)?.finish()
|
||||
@ -82,19 +88,19 @@ fun AppBar(
|
||||
}
|
||||
)
|
||||
if (isSearchActive) {
|
||||
Row {
|
||||
Row (modifier = Modifier.fillMaxWidth()) {
|
||||
SearchComponent(
|
||||
text = searchQuery,
|
||||
onTextChange = { searchQuery ->
|
||||
onUpdateSearchQuery(searchQuery)
|
||||
onUpdateAutocompleteUsers()
|
||||
},
|
||||
onDisableSearch = onDisableSearch
|
||||
onDisableSearch = onDisableSearch,
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
|
||||
if (isAddParticipants) {
|
||||
TextButton(
|
||||
modifier = Modifier.align(Alignment.CenterVertically),
|
||||
modifier = Modifier.align(Alignment.CenterVertically).wrapContentWidth(),
|
||||
onClick = {
|
||||
onDisableSearch()
|
||||
onUpdateSearchQuery("")
|
||||
|
@ -8,7 +8,6 @@
|
||||
package com.nextcloud.talk.contacts.components
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.text.KeyboardActions
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
@ -38,15 +37,15 @@ fun SearchComponent(
|
||||
text: String,
|
||||
onTextChange: (String) -> Unit,
|
||||
onDisableSearch: () -> Unit,
|
||||
modifier:Modifier = Modifier
|
||||
) {
|
||||
val keyboardController = LocalSoftwareKeyboardController.current
|
||||
TextField(
|
||||
modifier = Modifier
|
||||
.background(MaterialTheme.colorScheme.background)
|
||||
.fillMaxWidth()
|
||||
.height(60.dp),
|
||||
value = text,
|
||||
onValueChange = { onTextChange(it) },
|
||||
modifier = modifier
|
||||
.background(MaterialTheme.colorScheme.background)
|
||||
.height(60.dp),
|
||||
placeholder = { Text(text = stringResource(R.string.nc_search)) },
|
||||
textStyle = TextStyle(fontSize = 16.sp),
|
||||
singleLine = true,
|
||||
|
Loading…
Reference in New Issue
Block a user