mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-09 22:04:24 +01:00
adjust search component width
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
ebe374c9cb
commit
e689e4f7f8
@ -86,7 +86,8 @@ fun AppBar(
|
|||||||
onUpdateSearchQuery(searchQuery)
|
onUpdateSearchQuery(searchQuery)
|
||||||
onUpdateAutocompleteUsers()
|
onUpdateAutocompleteUsers()
|
||||||
},
|
},
|
||||||
onDisableSearch = onDisableSearch
|
onDisableSearch = onDisableSearch,
|
||||||
|
isAddParticipants = isAddParticipants
|
||||||
)
|
)
|
||||||
|
|
||||||
if (searchQuery.isNotEmpty() && isAddParticipants) {
|
if (searchQuery.isNotEmpty() && isAddParticipants) {
|
||||||
@ -99,6 +100,7 @@ fun AppBar(
|
|||||||
) {
|
) {
|
||||||
Text(text = context.getString(R.string.add_participants))
|
Text(text = context.getString(R.string.add_participants))
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,12 +34,21 @@ import androidx.compose.ui.unit.sp
|
|||||||
import com.nextcloud.talk.R
|
import com.nextcloud.talk.R
|
||||||
|
|
||||||
@Composable
|
@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
|
val keyboardController = LocalSoftwareKeyboardController.current
|
||||||
TextField(
|
TextField(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.background(MaterialTheme.colorScheme.background)
|
.background(MaterialTheme.colorScheme.background)
|
||||||
.fillMaxWidth(SearchComponentCompanionClass.WIDTH_RATIO)
|
.fillMaxWidth(width_ratio)
|
||||||
.height(60.dp),
|
.height(60.dp),
|
||||||
value = text,
|
value = text,
|
||||||
onValueChange = { onTextChange(it) },
|
onValueChange = { onTextChange(it) },
|
||||||
|
Loading…
Reference in New Issue
Block a user