0Pricing
Jetpack Compose Academy · Ders

Bir @Composable İşlevinin Anatomisi

Bir Composable'ı okuyun ve onu özel kılan özellikleri fark edin.

Bir @Composable İşlevinin Anatomisi, CoddyKit'te ücretsiz bir Jetpack Compose Academy dersidir. Bu, 4 dersinin 3. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Jetpack Compose Academy öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Jetpack Compose Academy kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

What Is a Composable?

A Composable is just a Kotlin function that describes a piece of UI. Call it, and Compose draws that UI on screen. It is the building block of everything. 🧱

The @Composable Annotation

The magic marker is @Composable above the function. It tells the Compose compiler this function can emit UI and may be recomposed when data changes.

@Composable
fun Greeting() {
    Text("Hello!")
}

Name It Like a UI Piece

By convention, Composable names use PascalCase nouns like Greeting or ProfileCard, not verbs. The name describes the thing on screen, not an action.

It Returns Unit

A Composable usually returns nothing (Unit). Instead of returning UI, it emits it by calling other Composables inside its body. The side effect is the drawing.

Built-In Composables

Compose ships ready-made Composables like Text, Button, Image, and Icon. You combine these to build your own, so you rarely start from a blank canvas.

@Composable
fun Welcome() {
    Text("Welcome to Compose")
}

Parameters Pass In Data

Composables take parameters just like any function. Pass data in, and the UI reflects it. This is how the same component shows different content.

@Composable
fun Greeting(name: String) {
    Text("Hello, " + name)
}

The Modifier Parameter

Most Composables accept a modifier to control size, padding, and layout. By convention it is the first optional parameter, ready for you to customize.

Composables Call Composables

A Composable can only be called from another Composable. This rule lets Compose track the tree of UI and recompose the right parts when state changes.

Keep Them Small

Aim for small, focused Composables that do one thing. Tiny pieces are easier to reuse, preview, and combine into bigger screens later on.

Prefer No Side Effects

A good Composable is predictable: same inputs, same UI. Avoid surprises like network calls in the body, since Compose may run it many times.

Compose Builds a Tree

As Composables call each other, they form a UI tree. Compose walks this tree to draw the screen and to update only the branches that changed.

Quick Check

Let's verify what marks a function as a UI builder.

Recap: The Composable

A Composable is a Kotlin function with @Composable that emits UI, takes parameters, accepts a modifier, and calls other Composables to build a tree.

Sıkça Sorulan Sorular

“Bir @Composable İşlevinin Anatomisi” dersi ücretsiz mi?

Evet — “Bir @Composable İşlevinin Anatomisi” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Jetpack Compose Academy kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Jetpack Compose Academy kursu toplamda 4 dersten oluşur.

“Bir @Composable İşlevinin Anatomisi” dersinde ne öğreneceğim?

Bir Composable'ı okuyun ve onu özel kılan özellikleri fark edin. Jetpack Compose Academy ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

Jetpack Compose Academy öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te Jetpack Compose Academy, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 3. dersidir.

“Bir @Composable İşlevinin Anatomisi” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu Jetpack Compose Academy dersinde kod yazıp çalıştırabilir miyim?

Evet. Her Jetpack Compose Academy dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Compose'un Yerine Geçtikleri: XML'e Elveda
  2. Android Studio'yu Compose için Kurma
  3. Bir @Composable İşlevinin Anatomisi
  4. İlk Uygulamanızı Emülatörde Çalıştırma
← Jetpack Compose Academy Sayfasına Dön