0Pricing
Jetpack Compose Academy · Lekcja

Typografia i tokeny kształtów

Scentralizuj czcionki i style narożników

Typografia i tokeny kształtów to bezpłatna lekcja Jetpack Compose Academy na CoddyKit. To lekcja 2 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej Jetpack Compose Academy, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs Jetpack Compose Academy zawiera 4 lekcji w sumie.

Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.

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. 🎉

Często zadawane pytania

Czy lekcja „Typografia i tokeny kształtów” jest bezpłatna?

Tak — pełny tekst „Typografia i tokeny kształtów” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu Jetpack Compose Academy, przejdź na CoddyKit PRO. Kurs Jetpack Compose Academy zawiera 4 lekcji w sumie.

Co nauczysz się w „Typografia i tokeny kształtów”?

Scentralizuj czcionki i style narożników Ćwiczysz Jetpack Compose Academy z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.

Czy potrzebuję doświadczenia, aby zacząć Jetpack Compose Academy?

Nie wymagamy żadnego doświadczenia. Jetpack Compose Academy w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 2 z 4.

Ile czasu zajmuje lekcja „Typografia i tokeny kształtów”?

Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.

Czy mogę pisać i uruchamiać kod w tej lekcji Jetpack Compose Academy?

Tak. Każda lekcja Jetpack Compose Academy zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.

Wszystkie lekcje w tym kursie

  1. MaterialTheme i schematy kolorów
  2. Typografia i tokeny kształtów
  3. Tryb ciemny i dynamiczny kolor
  4. Tworzenie niestandardowego systemu projektowego
← Powrót do Jetpack Compose Academy