mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-01 01:19:59 +01:00
Add clear search button
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
cc270848b5
commit
84d09d0e58
@ -14,6 +14,7 @@ import androidx.compose.foundation.text.KeyboardActions
|
|||||||
import androidx.compose.foundation.text.KeyboardOptions
|
import androidx.compose.foundation.text.KeyboardOptions
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||||
|
import androidx.compose.material.icons.filled.Close
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
@ -51,8 +52,7 @@ fun ContactsSearchAppBar(
|
|||||||
) {
|
) {
|
||||||
VerticallyCenteredRow {
|
VerticallyCenteredRow {
|
||||||
IconButton(
|
IconButton(
|
||||||
modifier = Modifier
|
modifier = Modifier.padding(start = 4.dp),
|
||||||
.padding(start = 4.dp),
|
|
||||||
onClick = onCloseSearch
|
onClick = onCloseSearch
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
@ -68,7 +68,17 @@ fun ContactsSearchAppBar(
|
|||||||
singleLine = true,
|
singleLine = true,
|
||||||
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Search),
|
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Search),
|
||||||
keyboardActions = searchKeyboardActions(searchQuery, keyboardController),
|
keyboardActions = searchKeyboardActions(searchQuery, keyboardController),
|
||||||
colors = searchTextFieldColors()
|
colors = searchTextFieldColors(),
|
||||||
|
trailingIcon = {
|
||||||
|
if (searchQuery.isNotEmpty()) {
|
||||||
|
IconButton(onClick = { onTextChange("") }) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Close,
|
||||||
|
contentDescription = stringResource(R.string.nc_search_clear)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (isAddParticipants) {
|
if (isAddParticipants) {
|
||||||
|
@ -73,6 +73,7 @@ How to translate with transifex:
|
|||||||
<string name="nc_push_notification_fetch_error">Sorry something went wrong, cannot fetch test push message</string>
|
<string name="nc_push_notification_fetch_error">Sorry something went wrong, cannot fetch test push message</string>
|
||||||
|
|
||||||
<string name="nc_search">Search</string>
|
<string name="nc_search">Search</string>
|
||||||
|
<string name="nc_search_clear">Clear search</string>
|
||||||
|
|
||||||
<string name="nc_certificate_dialog_title">Check out the certificate</string>
|
<string name="nc_certificate_dialog_title">Check out the certificate</string>
|
||||||
<string name="nc_certificate_dialog_text">Do you trust the until now unknown SSL certificate, issued by %1$s for %2$s, valid from %3$s to %4$s?</string>
|
<string name="nc_certificate_dialog_text">Do you trust the until now unknown SSL certificate, issued by %1$s for %2$s, valid from %3$s to %4$s?</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user