πŸŒ“ ThemeHandler Extension made by Glich

πŸŒ“ 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.

:sparkles: Features of ThemeHandler Extension

:fire: Global Theme Support

:fire: Dynamic UI Styling

:fire: Multi-Screen Compatible

:fire: System Theme Detection

:fire: Custom Theme Keys

:fire: Theme List Management

:fire: Minimalist & Lightweight

:small_blue_diamond: Available & Descriptions

:package: RegisterTheme(themeName, dictionary)
Registers a theme by name with a dictionary of key-value pairs. Use it to define background color, text color, etc.

RegisterTheme_Method
:white_check_mark: Example:

RegisterTheme("dark", make a dictionary {"bg":"0#000000", "text":"0#FFFFFF"})
RegisterTheme("light", make a dictionary {"bg":"1#FFFFFF", "text":"1#000000"})

:glowing_star: SetDefaultTheme(themeName)
Sets the fallback theme that will be used if no theme is explicitly changed via ChangeTheme.

SetDefaultTheme_Method
:white_check_mark: Example:

SetDefaultTheme("light")

:counterclockwise_arrows_button: ChangeTheme(themeName)
Changes the currently active theme globally. Use this for dark mode toggles, user-selected themes, etc.
:white_check_mark: Example:
ChangeTheme_Method

ChangeTheme("dark")

:artist_palette: GetThemeColor(key)
Gets a specific color/value from the current theme. It first tries the active theme (via ChangeTheme) and then falls back to the default one.
:white_check_mark: Example:
GetThemeColor_Method

Set Label.BackgroundColor to GetThemeColor("bg")
Set Label.TextColor to GetThemeColor("text")

:name_badge: GetCurrentTheme()
Returns the name of the currently active theme. If no theme is changed, it returns the default one.
:white_check_mark: Example:
GetCurrentTheme_Method

Label.Text = "Current Theme: " + GetCurrentTheme()

:books: GetAllThemes()
Returns a list of all registered theme names as a list.
:white_check_mark: Example:
GetAllThemes_Method

ListView.Elements = GetAllThemes()

:crescent_moon: GetSystemTheme()
Automatically detects the device’s current UI mode and returns "light" or "dark" based on Android system settings.

GetSystemTheme_Method
:white_check_mark: Example:

if GetSystemTheme() = "dark" then ChangeTheme("dark")
else ChangeTheme("light")

:briefcase: How to Use

  1. Register all themes with RegisterTheme

  2. Set a SetDefaultTheme

  3. Use ChangeTheme if user toggles mode or if you want to auto-detect

  4. Use GetThemeColor(key) anywhere to apply dynamic UI


:gear: Designed For

  • Multiple Screens Support :white_check_mark:

  • Dynamic UI Personalization :white_check_mark:

  • Dark/Light Mode Switching :white_check_mark:

:memo: Specifications


:package: Package: com.glich.themehandler
:floppy_disk: Size: 5.20 KB
:mobile_phone: Minimum API Level: 7
:date: Updated On: 2025-07-24T18:00:00Z
:laptop: Built & documented using: FAST-CLI

Download :

com.glich.themehandler.aix (5.2 KB)

If :index_pointing_at_the_viewer: like it ,leave :heart: and comment below

4 Likes

thank you :+1: If possible, you can also make a language translation option for the app

1 Like