Overview
Suduxu themes define the visual and interaction layer of a connected device using XML or HTML-based layouts.
Suduxu supports a theme system that defines how connected device interfaces are rendered and how user interactions are structured, with themes being translated into runtime-native UI representations based on their format rather than acting as purely visual templates.
Theme types
Suduxu supports two theme formats:
XML Themes
- Structured declarative layout format
- Converted into native UI components
- Used for performance-optimized rendering
At runtime, XML themes are transformed into native Jetpack Compose components.
HTML Themes
- Web-based layout format
- Supports full HTML, CSS, and JavaScript
- Loaded and rendered inside a WebView
HTML themes are used when flexible or web-like UI behavior is required.
Runtime Behavior
XML themes are parsed and compiled into native UI structures.
Runtime pipeline:
XML File
↓
Parser
↓
Layout Validation
↓
Native Widget Mapping
↓
Jetpack Compose Tree
↓
Native UI RenderingAdvantages:
| Feature | Description |
|---|---|
| Performance | Native rendering with low overhead |
| Input handling | Tight integration with the input system |
| Rendering | Low latency UI updates |
HTML themes are executed inside an embedded WebView.
Runtime pipeline:
HTML File
↓
Asset & Script Resolution
↓
WebView Rendering
↓
JavaScript Runtime
↓
Suduxu Bridge Integration
↓
Custom Controller UIAdvantages:
| Feature | Description |
|---|---|
| Flexibility | Full web rendering capabilities |
| Design | Advanced UI customization |
| Integration | JavaScript access through the Suduxu bridge |
| Trade-off | Slightly higher runtime overhead than XML |
Selection criteria
Choose theme type based on requirements:
- Use XML when performance and native integration are required
- Use HTML when UI flexibility and web tooling are preferred
Lifecycle integration
Themes are loaded after runtime initialization and are bound to a connected client session. Changes can be pushed dynamically during runtime depending on server configuration.
Key constraint
Themes are not static assets. They are runtime-driven UI definitions tied to active client sessions.