Theming (UI Layer)#

Every prebuilt screen ships with sensible defaults — Roboto on iOS, the Curity color palette, sane spacing — but most apps want their brand. Theming lets you override colors, images, fonts, and component-level styles without touching framework code. Each platform uses its native theming mechanism: a plist on iOS, XML styles on Android. When you can’t reach what you need by overriding styles, drop down to UI Extensibility and swap the view controller / fragment outright.

Overview#

Four theming surfaces, with native mechanisms on each platform. Pick the surface that matches what you want to change.

SurfaceWhat it controlsiOS mechanismAndroid mechanism
ColorsBackground, primary, accent, per-component color attributesAsset-Catalog color sets named after the framework keycolorPrimary / colorAccent and hui*Color styleables in themes.xml
Images / IconsAuthenticator icons, illustrations, drawables embedded in componentsAsset-Catalog image sets named after the framework keyDrawables in res/drawable/ referenced via hui* styleables
FontsBody, heading, button, callout typographyfontName key in a custom plist; system or bundled .ttfandroid:fontFamily on the app theme, per-component TextAppearance
Component-Level StylingPer-component sizing, corner radii, padding, bordersComponent-keyed dictionaries in the plistCustom style definitions extending the framework’s component styleables

Configuration#

Pick your platform; each section lists the surface, the code, and the per-key conventions.

Colors#

IdsvrHaapiUIKit reads colors from the application’s Asset Catalog by name. Declare a color with the same name as a framework key (for example, hui_background) and IdsvrHaapiUIKit picks yours up automatically — no builder call required.

  1. In your app’s Assets.xcassets, add a Color Set.
  2. Name it the same as the framework key you want to override (hui_background, hui_primary, etc.).
  3. Configure the color values (Any Appearance / Dark Appearance).

Images and Icons#

Same pattern as colors. Add an Image Set in your Asset Catalog named identically to the framework key (for example, hui_ic_authenticator_user). The framework picks up the app-side asset at runtime.

Fonts#

The default font is Roboto. Override it by supplying a plist and naming it on HaapiUIKitApplicationBuilder:

<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
    <key>fontName</key>
    <string>Baskerville</string>
</dict>
</plist>
HaapiUIKitApplicationBuilder(haapiUIKitConfiguration: haapiUIKitConfiguration)
    .setThemingPlistFileName("MyCustom") // refers to MyCustom.plist
    .build()

For a system font, set fontName to any iOS-supported font name. For a custom font, ship the .ttf files in your target and set fontName to the title-case family name (for example, "IBM Plex Mono" for files prefixed IBMPlexMono). Launch logs confirm whether the custom font registered.

Component-Level Styling#

Each themable component (e.g., ActionableButton.Primary, InputTextField.Curity, MessageView.Error) reads a typed style definition from the same plist used for fontName. Add a top-level dictionary keyed by the component name and supply the supported keys:

<plist version="1.0">
<dict>
    <key>fontName</key>
    <string>IBM Plex Mono</string>

    <key>ActionableButton.Primary</key>
    <dict>
        <key>backgroundColorName</key>
        <string>my_primary_button_background</string>
        <key>cornerRadius</key>
        <integer>12</integer>
    </dict>
</dict>
</plist>

Each component’s supported keys are documented in its theming reference page in the IdsvrHaapiUIKit autodoc. Misspelled keys or wrong value types cause a runtime crash with a descriptive log message — keep the console open the first time you test a new override.

Localizable Strings#

The framework ships English strings keyed by short identifiers (hui_back, hui_webauth_passkeys_not_supported, etc.). Override any string by declaring the same key in your app’s localization resources.

  • iOS — add the key/value pair to your Localizable.strings for each locale you support.
  • Android — add the key/value pair to your res/values/strings.xml (and locale-suffixed variants for each locale).

Theming errors are validated at runtime, not at compile time, and the failure modes differ by platform:

  • iOS — plist parsing happens at app launch. A malformed plist or a key/value type mismatch crashes the app before the configuration is consumed. After every plist change, run on a clean device once and check the launch logs for theming-related warnings before shipping.
  • Android — style and styleable references are resolved when the framework inflates each screen. A missing drawable, a wrong parent class, or a misspelled hui* attribute crashes the activity the first time the user reaches the affected screen (login screen, BankID screen, polling screen). Test every flow path that uses the customized components, not just the first one you can reach.

Was this helpful?