DockedSearchBar
Source set: Common
@Deprecated(
message = "Use SearchBar with SearchBarState, and ExpandedDockedSearchBar to display results."
)
@Composable
public fun DockedSearchBar(
inputField: @Composable () -> Unit,
expanded: Boolean,
onExpandedChange: (Boolean) -> Unit,
modifier: Modifier = Modifier,
shape: Shape = SearchBarDefaults.dockedShape,
colors: SearchBarColors = SearchBarDefaults.colors(),
tonalElevation: Dp = SearchBarDefaults.TonalElevation,
shadowElevation: Dp = SearchBarDefaults.ShadowElevation,
content: @Composable ColumnScope.() -> Unit,
)
Parameters
| inputField | the input field of this search bar that allows entering a query, typically a SearchBarDefaults.InputField. |
| expanded | whether this search bar is expanded and showing search results. |
| onExpandedChange | the callback to be invoked when this search bar's expanded state is changed. |
| modifier | the Modifier to be applied to this search bar. |
| shape | the shape of this search bar. |
| colors | SearchBarColors that will be used to resolve the colors used for this search bar in different states. See SearchBarDefaults.colors. |
| tonalElevation | when SearchBarColors.containerColor is ColorScheme.surface, a translucent primary color overlay is applied on top of the container. A higher tonal elevation value will result in a darker color in light theme and lighter color in dark theme. See also: Surface. |
| shadowElevation | the elevation for the shadow below the search bar. |
| content | the content of this search bar to display search results below the inputField. |
DockedSearchBar
Source set: Common
@Deprecated(
message = "Use overload which takes inputField as a parameter",
replaceWith =
ReplaceWith(
"DockedSearchBar(\n" +
" inputField = {\n" +
" SearchBarDefaults.InputField(\n" +
" textFieldState = textFieldState,\n" +
" searchBarState = searchBarState,\n" +
" onSearch = onSearch,\n" +
" modifier = modifier,\n" +
" enabled = enabled,\n" +
" readOnly = readOnly,\n" +
" textStyle = textStyle,\n" +
" placeholder = placeholder,\n" +
" leadingIcon = leadingIcon,\n" +
" trailingIcon = trailingIcon,\n" +
" prefix = prefix,\n" +
" suffix = suffix,\n" +
" inputTransformation = inputTransformation,\n" +
" outputTransformation = outputTransformation,\n" +
" keyboardOptions = keyboardOptions,\n" +
" lineLimits = lineLimits,\n" +
" scrollState = scrollState,\n" +
" shape = shape,\n" +
" colors = colors,\n" +
" interactionSource = interactionSource,\n" +
" )\n" +
" },\n" +
" expanded = active,\n" +
" onExpandedChange = onActiveChange,\n" +
" modifier = modifier,\n" +
" shape = shape,\n" +
" colors = colors,\n" +
" tonalElevation = tonalElevation,\n" +
" shadowElevation = shadowElevation,\n" +
" content = content,\n" +
")"
),
)
@Composable
public fun DockedSearchBar(
query: String,
onQueryChange: (String) -> Unit,
onSearch: (String) -> Unit,
active: Boolean,
onActiveChange: (Boolean) -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
placeholder: @Composable (() -> Unit)? = null,
leadingIcon: @Composable (() -> Unit)? = null,
trailingIcon: @Composable (() -> Unit)? = null,
shape: Shape = SearchBarDefaults.dockedShape,
colors: SearchBarColors = SearchBarDefaults.colors(),
tonalElevation: Dp = SearchBarDefaults.TonalElevation,
shadowElevation: Dp = SearchBarDefaults.ShadowElevation,
interactionSource: MutableInteractionSource? = null,
content: @Composable ColumnScope.() -> Unit,
): Unit