Skip to content

Debug UI

kirich1409 edited this page May 18, 2026 · 2 revisions

Debug UI

Featured ships a Compose-based debug screen that lets developers and QA override flag values at runtime without recompiling. It is built from two modules that must only be included in debug builds.

Dependencies

// build.gradle.kts
debugImplementation("dev.androidbroadcast.featured:featured-registry")
debugImplementation("dev.androidbroadcast.featured:featured-debug-ui")

Never include these in implementation or releaseImplementation — they are intended exclusively for debug builds.

Step 1 — Register flags

Call FlagRegistry.register(…) once at app startup (e.g., in Application.onCreate) inside a debug-only guard:

import dev.androidbroadcast.featured.registry.FlagRegistry

if (BuildConfig.DEBUG) {
    FlagRegistry.register(GeneratedLocalFlags.newCheckout)
    FlagRegistry.register(GeneratedLocalFlags.maxCartItems)
}

Register every flag you want visible in the debug screen. Flags not registered here will not appear.

Step 2 — Show the debug screen

Navigate to FeatureFlagsDebugScreen from your in-app debug menu (a drawer, a shake gesture, a long-press shortcut, or a dedicated debug activity):

import dev.androidbroadcast.featured.debugui.FeatureFlagsDebugScreen

@Composable
fun DebugMenuScreen(configValues: ConfigValues) {
    FeatureFlagsDebugScreen(configValues = configValues)
}

The screen lists all registered flags with their current values and sources. Tapping a flag opens an inline editor to set an override. The override is written through configValues.override(…) and persists until configValues.resetOverride(…) or configValues.clearOverrides() is called.

Screenshots

Flag list

All 5 registered flags grouped by category (ui, Other, promotions, checkout). Boolean flags show a toggle with their source badge (LOCAL or DEFAULT).

Feature Flags debug screen — full list

Overriding a flag

main_button_red toggled to OFF. The toggle turns grey, the LOCAL badge stays, and a Reset link appears below to restore the default.

Feature Flags debug screen — main_button_red overridden to false

Clone this wiki locally