Skip to content

Commit 3c8b283

Browse files
authored
Refactor(SearchBar): Reorder modifier parameter to follow convention (#594)
Moved the modifier parameter in the CustomizableSearchBar composable to be the first optional parameter, adhering to Jetpack Compose API guidelines.
1 parent fcea14b commit 3c8b283

File tree

1 file changed

+1
-1
lines changed
  • compose/snippets/src/main/java/com/example/compose/snippets/components

1 file changed

+1
-1
lines changed

compose/snippets/src/main/java/com/example/compose/snippets/components/SearchBar.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,13 @@ fun CustomizableSearchBar(
178178
onSearch: (String) -> Unit,
179179
searchResults: List<String>,
180180
onResultClick: (String) -> Unit,
181+
modifier: Modifier = Modifier,
181182
// Customization options
182183
placeholder: @Composable () -> Unit = { Text("Search") },
183184
leadingIcon: @Composable (() -> Unit)? = { Icon(Icons.Default.Search, contentDescription = "Search") },
184185
trailingIcon: @Composable (() -> Unit)? = null,
185186
supportingContent: (@Composable (String) -> Unit)? = null,
186187
leadingContent: (@Composable () -> Unit)? = null,
187-
modifier: Modifier = Modifier
188188
) {
189189
// Track expanded state of search bar
190190
var expanded by rememberSaveable { mutableStateOf(false) }

0 commit comments

Comments
 (0)