settingsSearchProvider
fun settingsSearchProvider(@StringRes section: Int, destination: NavKey, preferences: SettingsSearchScope.() -> Unit): SettingsSearchProvider(source)
The searchable rows of one settings page, for the settings search: bind the result in Koin as a SettingsSearchProvider with a name of its own.
val readerSettingsSearch = settingsSearchProvider(R.string.reader_settings, ReaderSettingsRoute) {
preference(R.string.font_size, summary = R.string.font_size_summary)
if (capabilities.hasMultipleTabs) preference(R.string.start_tab)
preference(R.string.reader_theme, destination = ReaderThemeRoute)
}Content copied to clipboard
preferences runs each time the search builds its index, with the app's SettingsSearchContext, so a row is left out with plain Kotlin conditions over SettingsSearchScope.capabilities or SettingsSearchScope.graph. Rows whose destination the graph does not register are left out of the results.
Parameters
section
The page's title, shown under each result.
destination
The page itself, where results go unless a row names another destination.