veko doc
Self-Contained API Reference • Gradual Types • Capabilities • Wasm Sandbox

ui/android

lib/ui/android.vk

lib/ui/android.vk Pure-Veko Android / Jetpack Compose Material 3 declarative modifier & policy module (ui/android). - Material You dynamic color & contrast theming (MaterialYouTheme, material-you, with-material-you) - Edge-to-edge system bar scrims (EdgeToEdgeSpec, edge-to-edge, with-edge-to-edge) - Predictive back policy (PredictiveBackPolicy, with-predictive-back) & Compose haptics (HapticSpec, with-haptic) - Notification channel descriptors (NotificationChannelSpec, notification-channel, channel-to-map) - Strict offline-safe Android WebView URL policy (validate-url-policy) & platform capability descriptor (capabilities) - Zero top-level mut globals, zero ffi/net imports, and zero host capabilities required

signature
MaterialYouTheme = struct { dynamic_color bool = ..., dark_theme bool = ..., contrast enum = ... }

Material 3 / Material You theming specification (contrast: .standard, .medium, .high).

signature
EdgeToEdgeSpec = struct { status_scrim str = ..., nav_scrim str = ..., light_icons bool = ... }

Android edge-to-edge system bar scrim and icon luminance specification.

signature
PredictiveBackPolicy = struct { enabled bool = ..., confirm_action any = ... }

Android 14+ predictive back gesture policy descriptor.

HapticSpec struct
signature
HapticSpec = struct { kind enum = ... }

Android HapticFeedbackConstants / Compose HapticFeedbackType descriptor.

signature
NotificationChannelSpec = struct { id str, name str, importance enum = ..., description str = ... }

Android NotificationChannel specification (importance: .low, .default, .high, .max).

signature
material-you = fn [dynamic_color bool, dark_theme bool, contrast enum] MaterialYouTheme

Builds a validated MaterialYouTheme (contrast: .standard, .medium, .high).

signature
with-material-you = fn [nd v/Node, theme MaterialYouTheme] v/Node

Attaches android_material_you, android_dark_theme, and android_contrast to nd.props.

signature
edge-to-edge = fn [status_scrim str, nav_scrim str, light_icons bool] EdgeToEdgeSpec

Builds an EdgeToEdgeSpec with normalized ARGB hex scrim defaults (#00000000).

signature
with-edge-to-edge = fn [nd v/Node, spec EdgeToEdgeSpec] v/Node

Attaches android_edge_to_edge, android_status_scrim, android_nav_scrim, and android_light_icons to nd.props.

signature
with-predictive-back = fn [nd v/Node, enabled bool, confirm_action any] v/Node

Attaches android_predictive_back and android_back_action to nd.props.

signature
with-haptic = fn [nd v/Node, kind enum] v/Node

Attaches android_haptic feedback kind (.click, .long_press, .text_handle, .confirm, .reject) to nd.props.

signature
notification-channel = fn [id str, name str, importance enum, description str] NotificationChannelSpec

Builds a validated NotificationChannelSpec (importance: .low, .default, .high, .max).

signature
channel-to-map = fn [ch NotificationChannelSpec] map

Converts a NotificationChannelSpec to a plain serialization-ready map.

signature
validate-url-policy = fn [url str, allow_net bool] map

Validates a navigation URI against Android WebView safety and .net capability policy.

signature
capabilities = fn [] map

Returns static capability metadata for the Veko Android target.