0Pricing
Jetpack Compose Academy · Ders

Chip'leri Saran Bir FlowRow

Sıfırdan gerçek bir sarmalayan düzen oluşturun.

Chip'leri Saran Bir FlowRow, CoddyKit'te ücretsiz bir Jetpack Compose Academy dersidir. Bu, 4 dersinin 4. 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 a Flow Row Does

A flow row places children left to right, then wraps to a new line when it runs out of width. Perfect for tag chips and filters. 🏷️

Start From the Layout Composable

You already know the tool: the Layout composable. The wrapping logic lives entirely in how you measure and place children.

Layout(content, modifier) { measurables, constraints ->
}

Measure Children Loosely

Measure each chip with the parent's maxWidth but no minimum, so chips size to their content rather than stretching full width.

val placeables = measurables.map {
  it.measure(constraints.copy(minWidth = 0))
}

Track the Current Row Width

Walk the placeables and keep a running row width. Each chip you add increases it by the chip's own width.

Wrap When the Row Overflows

If adding the next chip would exceed maxWidth, reset the row width and move down by the tallest chip in the finished row.

if (rowWidth + placeable.width > maxWidth) {
  y += rowHeight
  rowWidth = 0
}

Remember Each Chip's Position

As you scan, store the chosen x and y for every chip in a list. You will replay these positions during the placement step.

Compute the Total Height

After the last row, the layout's height is the final y plus that row's height. The width is simply the constraint's maxWidth.

Report Size and Place Chips

Call layout with your total width and height, then loop through the stored positions, calling placeRelative on each placeable.

layout(maxWidth, totalHeight) {
  placeables.forEachIndexed { i, p ->
    p.placeRelative(positions[i])
  }
}

Add Horizontal Spacing

Insert a small gap between chips by adding a spacing value to the row width after each chip. Vertical gaps work the same way.

Compose Ships FlowRow Too

The official FlowRow from the layout library does all this for you. Building it yourself shows exactly how that magic works under the hood. ✨

FlowRow { Chip("Kotlin"); Chip("Compose") }

You Built a Real Layout

You measured children, wrapped rows by width, and placed each chip by hand. That is a production-grade custom layout built from first principles. 🎉

Quick Check

What triggers the flow row to start a new line?

Recap: A FlowRow That Wraps Chips

You measured chips loosely, tracked row width, and wrapped to a new line on overflow, then placed each one. That is FlowRow from scratch. ✅

Sıkça Sorulan Sorular

“Chip'leri Saran Bir FlowRow” dersi ücretsiz mi?

Evet — “Chip'leri Saran Bir FlowRow” 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.

“Chip'leri Saran Bir FlowRow” dersinde ne öğreneceğim?

Sıfırdan gerçek bir sarmalayan düzen oluşturun. 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 4. dersidir.

“Chip'leri Saran Bir FlowRow” 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. Ölç ve Yerleştir Modeli
  2. Layout Composable'ı Yazma
  3. Kısıtlamalar ve Doğal Ölçümler
  4. Chip'leri Saran Bir FlowRow
← Jetpack Compose Academy Sayfasına Dön