Skip to content

Add UI for configuring toggles #3

@osipxd

Description

@osipxd

Currently, the library has UI implemented as a plugin for RedMadRobot/debug-panel-android. It would be great to be able to use this UI separately from the debug-panel. For example, add it to own implementation of debug panel.

All we need to do is to provide API like this:

@Composable
fun KonfeatureConfigurationScreen(
    konfeature: Konfeature,
    settingInterceptor: KonfeatureSettingsInterceptor = /* retrieve the interceptor from the given Konfeature instance */
    modifier: Modifier = Modifier,
)
interface KonfeatureSettingsInterceptor : Interceptor {
    val valuesFlow: StateFlow<Map<String, Any>>

    suspend fun setValue(key: String, value: Any)
    suspend fun resetValue(key: String)
    suspend fun resetAllValues()
}

Where KonfeatureSettingsInterceptor is the entity responsible for changing settings from UI and, probably, storing the changes somewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions