mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-07-29 23:59:32 +00:00
feat: added clear button on search form
This commit is contained in:
parent
a33558cbae
commit
a55012d097
2 changed files with 15 additions and 0 deletions
|
|
@ -293,6 +293,7 @@ fun NuvioInputField(
|
|||
onValueChange: (String) -> Unit,
|
||||
placeholder: String,
|
||||
modifier: Modifier = Modifier,
|
||||
trailingContent: (@Composable (() -> Unit))? = null,
|
||||
) {
|
||||
OutlinedTextField(
|
||||
value = value,
|
||||
|
|
@ -308,6 +309,7 @@ fun NuvioInputField(
|
|||
)
|
||||
},
|
||||
textStyle = MaterialTheme.typography.bodyLarge.copy(color = MaterialTheme.colorScheme.onSurface),
|
||||
trailingIcon = trailingContent,
|
||||
colors = OutlinedTextFieldDefaults.colors(
|
||||
focusedBorderColor = MaterialTheme.colorScheme.outline,
|
||||
unfocusedBorderColor = MaterialTheme.colorScheme.outline,
|
||||
|
|
|
|||
|
|
@ -179,6 +179,19 @@ fun SearchScreen(
|
|||
value = query,
|
||||
onValueChange = { query = it },
|
||||
placeholder = "Search movies, shows...",
|
||||
trailingContent = if (query.isNotBlank()) {
|
||||
{
|
||||
IconButton(onClick = { query = "" }) {
|
||||
Icon(
|
||||
imageVector = Icons.Rounded.Close,
|
||||
contentDescription = "Clear search",
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
null
|
||||
},
|
||||
)
|
||||
}
|
||||
androidx.compose.foundation.layout.Spacer(modifier = Modifier.height(14.dp))
|
||||
|
|
|
|||
Loading…
Reference in a new issue