Skip to content

Commit

Permalink
show close icon when text is present
Browse files Browse the repository at this point in the history
Signed-off-by: sowjanyakch <[email protected]>
  • Loading branch information
sowjanyakch committed Jul 12, 2024
1 parent 49606a2 commit 4c12816
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions app/src/main/java/com/nextcloud/talk/contacts/SearchComponent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,18 @@ fun DisplaySearch(text: String, onTextChange: (String) -> Unit, contactsViewMode
},

trailingIcon = {
IconButton(
onClick = {
if (text.isNotEmpty()) {
if (text.isNotEmpty()) {
IconButton(
onClick = {
onTextChange("")
} else {
contactsViewModel.updateSearchState(false)
}
) {
Icon(
imageVector = Icons.Default.Close,
contentDescription = stringResource(R.string.close_icon),
tint = Color.Black
)
}
) {
Icon(
imageVector = Icons.Default.Close,
contentDescription = stringResource(R.string.close_icon),
tint = Color.Black
)
}
},

Expand Down

0 comments on commit 4c12816

Please sign in to comment.