Tipografi & Token Bentuk
Pusatkan font dan gaya sudut.
Tipografi & Token Bentuk adalah pelajaran Jetpack Compose Academy gratis di CoddyKit. Ini adalah pelajaran 2 dari 4. Kamu bisa membaca pelajaran lengkapnya di bawah secara gratis — lalu praktikkan langsung di browser dengan editor kode bawaan dan tutor AI 24/7. Ini adalah bagian dari jalur belajar Jetpack Compose Academy, dan progresmu tersinkronisasi di web dan aplikasi CoddyKit. Kursus Jetpack Compose Academy mencakup 4 pelajaran total.
Bagian dari pelajaran ini belum diterjemahkan dan ditampilkan dalam bahasa Inggris.
Fonts Get a Theme Too
Just like colors, your text styles live in the theme. The typography slot of MaterialTheme defines every font size, weight, and spacing in one place. 🔤
A Type Scale
Material gives you a ready-made type scale: named roles like headline, title, body, and label that keep your text consistent across screens.
Named Text Styles
You reach a style by name, so a headlineLarge looks the same everywhere and updates app-wide when you tweak the theme once.
Text(
"Welcome",
style = MaterialTheme.typography.headlineLarge
)Body vs Title
Use bodyMedium for paragraphs and titleLarge for headers; picking the right role gives clear hierarchy without hand-tuning every size.
Customize a Style
You override a role with a copy, changing only what you need; here titleLarge keeps its size but gets a bolder weight.
val type = Typography(
titleLarge = TextStyle(fontWeight = FontWeight.Bold)
)Plug In a Font Family
Swap the default font by setting a fontFamily on your styles, so your brand typeface flows through every Text in the app.
TextStyle(fontFamily = brandFont)Shapes Are Tokens Too
Corners are themeable as well. The shapes slot defines how rounded your cards, buttons, and sheets look across the app.
Small, Medium, Large
Material 3 groups shapes into small, medium, and large tokens, and components automatically pick the size that fits them.
Define Your Corners
You set corner radii once in a Shapes object, and every component that uses that token instantly adopts the new roundness.
val shapes = Shapes(
medium = RoundedCornerShape(12.dp)
)Read a Shape Token
Apply a token directly to a Composable so it matches the theme; here a Surface clips itself with MaterialTheme.shapes.medium.
Surface(shape = MaterialTheme.shapes.medium) { /* card */ }Consistency by Default
Centralizing type and shape tokens means new screens look on-brand automatically, and a single edit restyles them all. ✨
Quick Check
You want every card to share the same corner radius app-wide. Where do you set it?
Recap: Type & Shape, Centralized
You styled text through the typography scale and rounded corners through shape tokens, so one theme keeps fonts and shapes consistent. 🎉
Pertanyaan yang Sering Diajukan
Apakah pelajaran “Tipografi & Token Bentuk” gratis?
Ya — teks lengkap “Tipografi & Token Bentuk” gratis dibaca di sini di web. Untuk praktiknya secara interaktif (editor kode bawaan dan tutor AI 24/7) dan buka sisa kursus Jetpack Compose Academy, upgrade ke CoddyKit PRO. Kursus Jetpack Compose Academy mencakup 4 pelajaran total.
Apa yang akan aku pelajari di “Tipografi & Token Bentuk”?
Pusatkan font dan gaya sudut. Kamu berlatih Jetpack Compose Academy dengan kode praktik yang langsung kamu jalankan di browser, dan tutor AI 24/7 menjawab pertanyaanmu saat kamu mengerjakan pelajaran ini.
Apakah aku perlu pengalaman untuk memulai Jetpack Compose Academy?
Tidak diperlukan pengalaman sebelumnya. Jetpack Compose Academy di CoddyKit dirancang untuk pemula hingga pelajar tingkat lanjut, jadi kamu bisa memulai di sini atau dari awal dan belajar sesuai kecepatan kamu sendiri. Ini adalah pelajaran 2 dari 4.
Berapa lama pelajaran “Tipografi & Token Bentuk” memakan waktu?
Sebagian besar pelajaran CoddyKit memakan waktu sekitar 5–10 menit. Setiap pelajaran ringkas dan interaktif, jadi kamu membuat kemajuan stabil dan melanjutkan dari tempat kamu tinggalkan di web dan aplikasi.
Bisakah aku menulis dan menjalankan kode dalam pelajaran Jetpack Compose Academy ini?
Ya. Setiap pelajaran Jetpack Compose Academy menyertakan editor kode bawaan, jadi kamu menulis dan menjalankan kode nyata langsung di browser dan mendapatkan umpan balik AI instan — tidak diperlukan penyiapan lokal.
Semua pelajaran dalam kursus ini
- MaterialTheme & Skema Warna
- Tipografi & Token Bentuk
- Mode Gelap & Warna Dinamis
- Membangun Sistem Design Kustom