Internal Engineering Document
v1.0.0 · Internal
Bahrain · Android · Design System

Welcome to the
stc pay UI Kit

The shared design system the app is built on — and, just as importantly, the composite-build setup you need before the main app will even compile.

Created by Mian Sarim Hameed

Document type
Onboarding Guide
Audience
Android Team
version
8.7.8
Branch
Develop
01
Start Here

Welcome & Why This Guide Exists

If you just tried to sync the main app and it failed — or you can’t find StcPayTheme anywhere in the codebase — you’re in the right place.

The stc pay app is built on a shared UI Kit: the theme, the brand colours, the language engine and a library of Compose components all live in a separate repo (stcpay-bh-android-ui-kit). The main app pulls it in as a composite build — and until you set that up, the app won’t even sync. This short guide gets you past that and explains what the kit gives you.

If you’re just trying to build Jump straight to §05 (link it) and §06 (the one sync error everyone hits). Five minutes and you’ll be building.

This guide pairs with the main Developer Knowledge Transfer; keep both open, and walk through the setup with your lead the first time.

02
Start Here

Contents

03
Start Here

What the UI Kit Is & Why It’s Required

The UI Kit is stc pay’s shared design system and component library, packaged as the Gradle module :stcpay-ui-kit (namespace com.stcpay.uikit). It’s bigger than it sounds — it holds almost everything the app is built from:

Put simply: if you’ve tapped a button, typed in a field, or seen a bottom sheet in the app, it came from here.

The main app depends on it as the artifact com.stcpay:stcpay-ui-kit (declared once in the :util module). That artifact isn’t published to a repository you can reach, so you supply it from source via a composite build.

This is not optional No UI Kit, no build. If stcPayUiKitProjectPath isn’t set (§05), Gradle can’t resolve com.stcpay:stcpay-ui-kit and the app fails to sync. Setting it up is part of first-time setup, not an extra.

So the first job is simply to point the app at a local copy of this repo. Here’s the kit itself, then how to link it.

04
Getting It Building

Inside the Kit — Structure & Packages

It’s a single Gradle module — a Compose Android library on JDK 17 (compileSdk 36, minSdk 23, Hilt) — but don’t mistake “one module” for “small”: it’s around 90 source files plus the fonts, strings and icons. The module is :stcpay-ui-kit under rootProject.name = "stcpay_ui_kit" (that name matters in §06).

Packages (under com.stcpay.uikit)

PackageWhat’s inside
themeStcPayTheme, the colour palette (Color.kt), CustomColorsScheme, typography (STC Forward), Dimensions. (§07)
viewsThe bulk of the component library — ~50 files: buttons, text, text fields, app bars, OTP, lists, cards & more. (§08)
bottomsheetThe bottom-sheet system: BottomSheetHost, the global BottomSheetManager, standard / menu / list sheets. (§08)
pickersDate & date-range pickers. (§08)
languageThe locale engine: LocaleManager, LocaleWrapper, LanguageViewModel. (§09)
utilsFormatting, dates, validation, QR, copy & screen-capture helpers. (§09)
keyboardguardSecure-keyboard guard. (§09)
cashbackplus · dataCashback-plus UI, plus shared models & enums (incl. the Language enum).
It ships resources too — not just code Beyond Kotlin, the kit bundles the STC Forward fonts, the app’s string resources in 7 languages (values, -ar, -bn, -hi, -ml, -tl, -ur) and a large shared icon set. So shared strings and the brand fonts live here, not in the app repo.

Coordinates

Repostcpay-bh-android-ui-kit
Module:stcpay-ui-kit · namespace com.stcpay.uikit
Consumed ascom.stcpay:stcpay-ui-kit
Published ascom.github.stcpay:stcpay-uikit-android
05
Getting It Building

Link It — the Composite Build

This is the step that makes the main app sync. You’re telling the app “use this local folder as the UI Kit”.

  1. Clone stcpay-bh-android-ui-kit somewhere on your machine.
  2. In the main app’s root local.properties, add the path to that clone:
properties — stcpay-bh-android/local.properties
stcPayUiKitProjectPath=/Users/you/claude/stcpay-bh-android-ui-kit

That’s it. The app’s settings.gradle.kts picks up the key and wires the kit in as a composite build — includeBuild pulls in your local source, and dependencySubstitution swaps the published artifact for it:

kotlin — app settings.gradle.kts (already there)
localProperties?.getProperty("stcPayUiKitProjectPath")?.let { path ->
    includeBuild(path) {
        name = "stcpay-uikit"
        dependencySubstitution {
            substitute(module("com.stcpay:stcpay-ui-kit")).using(project(":stcpay-ui-kit"))
        }
    }
}
Point at the repo root stcPayUiKitProjectPath must be the folder that contains the kit’s settings.gradle.kts — the repo root, not the inner stcpay-ui-kit/ module.

Sync now. If it works — great. If you hit a duplicate-class error, that’s the next section (and it’s expected).

06
Getting It Building

The Sync Gotcha — “Class Already Exists”

Almost everyone hits this on first sync after linking the kit: a duplicate-class / “class already exists” error. It happens because the composite build’s name and the kit’s own project name don’t line up. The fix is quick.

The fix: make the two names match, sync, then revert

By default the names differ — the kit calls itself stcpay_ui_kit, while the app includes it as stcpay-uikit:

FileDefault value
UI Kit — settings.gradle.ktsrootProject.name = "stcpay_ui_kit"
App — settings.gradle.kts (includeBuild)name = "stcpay-uikit"
  1. Set both names to the same value (e.g. make both "stcpay-uikit").
  2. Sync the project — it should now complete.
  3. Once the sync succeeds, revert both names to their originals.
Remember to revert — and don’t commit it The matched-name trick is only needed to get past the sync. Change it back afterwards, and never commit the temporary rename in either repo.

Once you’re synced, the rest is just knowing what the kit offers.

07
What’s Inside

Theme & Design Tokens

This is the app’s visual language in one place — and the reason StcPayTheme isn’t in the app repo.

PieceWhat it is
StcPayTheme { }The theme wrapper. Handles light/dark (and Material You dynamic colour) and provides the typography + custom colours to everything inside it. (theme/Theme.kt)
customColorsSchemeThe brand semantic colours beyond Material — e.g. textColorPrimary, primaryToWhite — read via MaterialTheme.customColorsScheme (a CustomColorsScheme).
Color.ktThe raw palette: PrimaryColor #4F008C, SecondaryColor #00C48C, eKeyColor, plus text / border / background tokens (light & dark).
TypographystcPayTypography() on the STC Forward font family (shipped by the kit), with an Urdu fallback. (theme/Type.kt)
DimensionsShared spacing / size tokens. (theme/Dimensions.kt)
Status barSetStatusBarColor + LocalStatusBarColor for per-screen status-bar colour.
Theme through these, don’t hard-code Use MaterialTheme.customColorsScheme and the typography styles instead of literal colours or text styles — that’s what keeps light/dark and Arabic looking right.
08
What’s Inside

The Component Library

This is the heart of the kit and what you’ll use every day. Nearly every shared UI building block in the app lives here — reach for these before writing your own.

CategoryComponents (& file)
ButtonsPrimaryButton, PrimaryButtonSmall, SecondaryButton, FullWidthButtonBordered, DoubleTextWithArrowButton, IconAndTextBorderButtonviews/ButtonComponents.kt
TextTitleSubtitle, OutlinedTextRow, CopyableTextRow, ResponsiveText, DateTextviews/TextComponents.kt
Text fields & inputsTextFieldComponents, NumberInputField, CurrencyLabelInputField, SearchViewField, ClickableSearchView
Selection controlsCheckboxComponents, RadioButtonComponents, SwitchComponents, DropdownComponents
App barsBaseAppBar, CommonAppBar, LoginAppBar, HistoryAppBar, RemittanceAppBar & more — views/AppBarComponents.kt
OTPOtpView, OtpTimerButtonsView
Bottom sheetsBottomSheetHost, StandardBottomSheet, MenuBottomSheet, ListBottomSheet — raised via the global BottomSheetManager
PickersDatePickerSheet, DateRangePickerSheet, DateRangeRowWithPicker
Feedback & stateCustomLoadingIndicator, Shimmer, EmptyListView, HomeErrorView, StepProgressIndicator, PagerComponents
Lists, rows & cardsListItemComponents, LabeledActionRow, AccountOverviewCard, ReviewTansactionView, Note, image & gradient helpers
Layout helpersBaseScreen (screen scaffold), CustomModifiers, CustomEdgeToEdge, LtrLayout
Reach for the kit first There are also feature-flavoured views here (Gulf Air, remittance, marketplace, send-money tabs, Tinbo, LMRA salary…). Before building any common control, check the kit — it’s almost certainly already there.
09
What’s Inside

Language, Utilities & Security

Language & locale

The kit owns the whole localization engine: LocaleManager (init, setLocale, localizedString, getPersistedLanguage), the LocaleWrapper composable that provides language context, LanguageViewModel, and the Language enum (which carries each language’s LayoutDirection for RTL). It also ships the app’s strings in 7 languages and the STC Forward fonts.

Utilities

utils/ holds shared helpers you’ll reuse constantly: FormattingUtils (prices / currency), DateTimeUtils, Validations, QRCodeUtils, CopyUtils, SendMessageUtils, ContextUtil.

Security

KeyboardSecurityManager (a secure-keyboard guard) and ScreenCaptureUtils (screenshot control) — small but important for a banking app.

Yes, the strings live here too A common surprise: the app’s shared strings.xml (en + ar / bn / hi / ml / tl / ur) and the brand fonts are in the kit, not the app. Adding a shared string, or can’t find one? Look here.
10
Reference

How the App Uses It

You almost never add the dependency yourself — it’s declared once and flows everywhere. The :util module pulls it in with api(...), and because :util sits low in the dependency chain, the whole app gets the kit transitively.

The main app wires the kit’s big pieces in at startup (see the main guide’s §12 and §16):

11
Reference

Quick Reference

Everything on one card

Repostcpay-bh-android-ui-kit
Module · namespace:stcpay-ui-kit · com.stcpay.uikit
Consumed ascom.stcpay:stcpay-ui-kit
Link key (local.properties)stcPayUiKitProjectPath
Kit project namestcpay_ui_kit
App includeBuild namestcpay-uikit
Also shipsSTC Forward fonts · strings ×7 languages · shared icons

Get it building, in three steps

  1. Clone the kit; set stcPayUiKitProjectPath in the app’s local.properties (§05).
  2. If sync errors with a duplicate class, match the two project names, sync, then revert (§06).
  3. Done — the kit’s theme, components, language and resources are now available app-wide.
That’s the kit With this linked, the main app will sync and run — and you now know where the buttons, fields, sheets, theme and strings come from. For everything else (architecture, modules, flows), head back to the main Developer Knowledge Transfer guide.