adjust search component width

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2025-05-26 12:14:43 +02:00 committed by Marcel Hibbe
parent ebe374c9cb
commit e689e4f7f8
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
2 changed files with 14 additions and 3 deletions

View File

@ -86,7 +86,8 @@ fun AppBar(
onUpdateSearchQuery(searchQuery)
onUpdateAutocompleteUsers()
},
onDisableSearch = onDisableSearch
onDisableSearch = onDisableSearch,
isAddParticipants = isAddParticipants
)
if (searchQuery.isNotEmpty() && isAddParticipants) {
@ -99,6 +100,7 @@ fun AppBar(
) {
Text(text = context.getString(R.string.add_participants))
}
} else {
}
}
}

View File

@ -34,12 +34,21 @@ import androidx.compose.ui.unit.sp
import com.nextcloud.talk.R
@Composable
fun SearchComponent(text: String, onTextChange: (String) -> Unit, onDisableSearch: () -> Unit) {
fun SearchComponent(
text: String,
onTextChange: (String) -> Unit,
onDisableSearch: () -> Unit,
isAddParticipants: Boolean
) {
var width_ratio = 0.85f
if (!isAddParticipants) {
width_ratio = 1.0f
}
val keyboardController = LocalSoftwareKeyboardController.current
TextField(
modifier = Modifier
.background(MaterialTheme.colorScheme.background)
.fillMaxWidth(SearchComponentCompanionClass.WIDTH_RATIO)
.fillMaxWidth(width_ratio)
.height(60.dp),
value = text,
onValueChange = { onTextChange(it) },