π ThemeHandler
An extension for MIT App Inventor 2.Theme Handler Extension to register, change and access themes globally.
Easily register and manage global themes (light, dark, custom) for your Kodular apps with support for multiple screens, system theme detection, and dynamic value switching.
Features of ThemeHandler Extension
Global Theme Support
Dynamic UI Styling
Multi-Screen Compatible
System Theme Detection
Custom Theme Keys
Theme List Management
Minimalist & Lightweight
Available & Descriptions
RegisterTheme(themeName, dictionary)
Registers a theme by name with a dictionary of key-value pairs. Use it to define background color, text color, etc.
Example:
RegisterTheme("dark", make a dictionary {"bg":"0#000000", "text":"0#FFFFFF"}) RegisterTheme("light", make a dictionary {"bg":"1#FFFFFF", "text":"1#000000"})
SetDefaultTheme(themeName)
Sets the fallback theme that will be used if no theme is explicitly changed viaChangeTheme
.
Example:
SetDefaultTheme("light")
ChangeTheme(themeName)
Changes the currently active theme globally. Use this for dark mode toggles, user-selected themes, etc.
Example:
ChangeTheme("dark")
GetThemeColor(key)
Gets a specific color/value from the current theme. It first tries the active theme (viaChangeTheme
) and then falls back to the default one.
Example:
Set Label.BackgroundColor to GetThemeColor("bg") Set Label.TextColor to GetThemeColor("text")
GetCurrentTheme()
Returns the name of the currently active theme. If no theme is changed, it returns the default one.
Example:
Label.Text = "Current Theme: " + GetCurrentTheme()
GetAllThemes()
Returns a list of all registered theme names as a list.
Example:
ListView.Elements = GetAllThemes()
GetSystemTheme()
Automatically detects the deviceβs current UI mode and returns"light"
or"dark"
based on Android system settings.
Example:
if GetSystemTheme() = "dark" then ChangeTheme("dark") else ChangeTheme("light")
How to Use
-
Register all themes with
RegisterTheme
-
Set a
SetDefaultTheme
-
Use
ChangeTheme
if user toggles mode or if you want to auto-detect -
Use
GetThemeColor(key)
anywhere to apply dynamic UI
Designed For
-
Multiple Screens Support
-
Dynamic UI Personalization
-
Dark/Light Mode Switching
Specifications
Package: com.glich.themehandler
Size: 5.20 KB
Minimum API Level: 7
Updated On: 2025-07-24T18:00:00Z
Built & documented using: FAST-CLI
Download :
com.glich.themehandler.aix (5.2 KB)
If like it ,leave
and comment below