Getting Started¶
CortenaUI is a Kotlin Multiplatform design system library specifically designed to build user interfaces for the Cortena operating system (an AOSP-based custom ROM) and its app ecosystem.
Project Structure¶
CortenaUI ships as four publishable modules. Each one is independently consumable from Maven Central, and ui transitively pulls the other three.
ui-foundation— pure Kotlin design tokens and framework-agnostic shape geometry. Zero external dependencies. Holds raw colors (LongARGB), sizes (Float), typography (Floatsp), motion durations (Longms), and easing curves. Consumable from Compose, Android View system, and AOSP / Android.bp builds without modification.ui-shape— Compose-aware shape system. Bridges the squircle math fromui-foundationto the ComposeShapeAPI. ProvidesCapsuleShape,RoundedShape,UnevenShape, and theComponentShapehierarchy.ui-motion— spring presets, duration tiers, and easing curves used across CortenaUI. Components read motion specs throughLocalMotionrather than constructingspring(...)ortween(...)calls inline.ui— Compose component layer (Button,Slider,Toggle,Text,Icon,ScrollView,Theme, etc.). Transitively pulls the three modules above.
There are no dependencies on Material / Material3. Cortena builds its own design language entirely from scratch.
Prerequisites¶
CortenaUI is published to Maven Central under io.github.cortenaui. Maven Central is enabled by default in modern Gradle setups; if you have customised your repositories, make sure it is declared:
Add the dependency to your application module's build.gradle.kts. The recommended pattern uses a Gradle version catalog so the version stays in one place:
# gradle/libs.versions.toml
[versions]
cortenaui = "0.2.0-alpha"
[libraries]
cortena-ui = { module = "io.github.cortenaui:ui", version.ref = "cortenaui" }
If you don't use a version catalog, the inline form works too:
Build configuration¶
CortenaUI's ui module targets modern Android. Your application module must compile against API 37 or newer:
android {
compileSdk = 37 // minimum, newer is fine
defaultConfig {
minSdk = 35 // required for the ui module
}
}
For details on what each module requires and on cherry-picking individual modules, see INSTALLATION.
A note on Material¶
CortenaUI is a complete design system. Mixing it with Material 3 in the same screen produces inconsistent visuals — Material's components have their own typography, motion, and shape language that fights with Cortena's. Use one or the other within a screen. The catalog uses Material icons under androidx.compose.material.icons purely as a vector source for Icon; that is the only Material touchpoint we recommend.
How to Use¶
- Start your user interface at the root of your
ActivityusingContentView. ContentViewautomatically:- Calls
enableEdgeToEdge()for transparent system bars. - Wraps content in
Themewith the requestedthemeMode, palette, typography, fontFamily, sizeToken, and motion. - Manages status bar icon contrast (
StatusBarIconMode). - Renders an optional status bar color overlay and an
appBarslot above the main content. - Inside
ContentView, compose your screen withBody(edge-to-edge background container),ScrollView(when content can overflow),SafeArea(system insets padding), and the rest of the components.
Minimal Android example¶
The shape below mirrors the catalog's own MainActivity. It is the smallest possible app that uses every layout primitive correctly:
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import framework.cortena.ui.components.Button
import framework.cortena.ui.components.Text
import framework.cortena.ui.components.TextRole
import framework.cortena.ui.layout.Body
import framework.cortena.ui.layout.ContentView
import framework.cortena.ui.layout.SafeArea
import framework.cortena.ui.layout.ScrollView
import framework.cortena.ui.theme.LocalColors
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
ContentView {
Body {
ScrollView {
SafeArea {
Column(
modifier = Modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(16.dp),
) {
val colors = LocalColors.current
Text(
"Hello CortenaUI",
color = Color(colors.primary),
role = TextRole.TitleMedium,
)
Button(onClick = { /* ... */ }) {
Text("Get started")
}
}
}
}
}
}
}
}
ContentView accepts themeMode as a state-producer lambda (() -> ThemeMode) so a parent can flip the theme without recomposing the entire tree.
Adding a custom font¶
Drop a font file into app/src/main/res/font/ and pass it via ContentView:
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
ContentView(
themeMode = { themeMode.value },
fontFamily = FontFamily(Font(R.font.your_font)),
) {
// ...
}
Every Text component in the tree picks up the new family automatically.
References¶
Layout primitives — docs/layout/:
Components — docs/components/:
Design language — docs/extra/:
For installation details, modular adoption, and version policy, see INSTALLATION.