Package-level declarations

Types

Link copied to clipboard
data class SettingsCategory(val title: String? = null, val preferences: List<SettingsPreference> = emptyList())
Link copied to clipboard
data class SettingsConfig(val title: String = "Settings", val categories: List<SettingsCategory> = emptyList())
Link copied to clipboard
data class SettingsPreference(val key: String? = null, val icon: ToolkitIcon? = null, val useIconContainer: Boolean = false, val iconColor: Color? = null, val iconContainerColor: Color? = null, val title: String? = null, val summary: String? = null, val destination: NavKey? = null, val action: () -> Boolean? = null)

One row of a settings list.

Link copied to clipboard
class SettingsSearchContext(val graph: ShellGraph, val capabilities: ShellCapabilities = ShellCapabilities.of(graph))

What a SettingsSearchProvider decides its rows from: the app's graph and what its declared shell can do. The settings search builds it from the same ShellHost locals the settings pages read, so a page and its search rows follow the same rules.

Link copied to clipboard
annotation class SettingsSearchDsl

Marks the settings search builder, so a nested block cannot reach an outer page's scope.

Link copied to clipboard
data class SettingsSearchEntry(@StringRes val title: Int, @StringRes val section: Int, val destination: NavKey, @StringRes val summary: Int? = null)

A setting the settings search can find: a row on one of the settings pages, rather than the page itself.

Link copied to clipboard

The searchable rows one settings page contributes. Each page's module binds one in Koin, and the settings list collects them all with getAll, so the list depends on none of the pages. settingsSearchProvider builds one with the page's section and destination given once.

Link copied to clipboard

The rows of one settings page, as settingsSearchProvider declares them: each row takes the page's section and destination unless it names its own destination.

Functions

Link copied to clipboard
fun settingsSearchProvider(@StringRes section: Int, destination: NavKey, preferences: SettingsSearchScope.() -> Unit): SettingsSearchProvider

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.

Link copied to clipboard

The destinations of this provider's rows in context that its graph does not register. The search leaves such rows out; a test asserts this is empty to catch a page missing from the graph.