0Pricing
Jetpack Compose Academy · Lesson

Adaptive vs Fixed Grid Cells

Make grids responsive to screen width.

Adaptive vs Fixed Grid Cells is a free Jetpack Compose Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Jetpack Compose Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Two Ways to Size Cells

A grid needs to know how wide its columns are. Compose offers two strategies: Fixed column counts and Adaptive minimum widths. 📐

Fixed Recap

You already met GridCells.Fixed(n). It always shows n columns, so cells grow or shrink to fit the screen width.

columns = GridCells.Fixed(3)

The Problem With Fixed

On a phone, 3 columns look great. On a tablet, those same 3 columns become awkwardly wide. Fixed does not adapt to bigger screens.

Enter Adaptive

With GridCells.Adaptive(minSize), you specify a minimum cell width. Compose fits as many columns as possible, then stretches them to fill.

columns = GridCells.Adaptive(minSize = 120.dp)

How Adaptive Counts

Compose divides the available width by your minSize to decide the column count. A wider screen simply gets more columns, automatically.

Responsive by Default

Adaptive grids look right on phones, foldables, and tablets without any extra code. One minSize value handles every screen. 📱

Choosing a minSize

Pick a minSize that keeps content readable at its smallest. Too tiny and cells feel cramped; too large and small phones show one column.

GridCells.Adaptive(minSize = 96.dp)

When Fixed Still Wins

Use Fixed when the design demands an exact count, like a 7-day calendar week that must always be 7 columns wide.

GridCells.Fixed(7)

Mixing With Spacing

Both strategies pair with arrangements. The minSize in Adaptive is measured before spacing, so leave room for your gaps.

LazyVerticalGrid(
    columns = GridCells.Adaptive(120.dp),
    horizontalArrangement = Arrangement.spacedBy(8.dp)
) { }

LazyHorizontalGrid Too

The same Fixed and Adaptive cells work in LazyHorizontalGrid, which scrolls sideways and fills rows top to bottom.

LazyHorizontalGrid(rows = GridCells.Adaptive(80.dp)) { }

A Simple Rule

Default to Adaptive for content galleries so they scale across devices. Reserve Fixed for layouts that need a precise, meaningful column count.

Quick Check

Pick the responsive choice.

Recap: Sizing Cells

You compared Fixed exact counts with Adaptive minimum widths. Adaptive scales across devices; Fixed locks an intentional column count. 🎯

Frequently asked questions

Is the “Adaptive vs Fixed Grid Cells” lesson free?

Yes — the full text of “Adaptive vs Fixed Grid Cells” is free to read here on the web, and the Jetpack Compose Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Jetpack Compose Academy course, upgrade to CoddyKit PRO.

What will I learn in “Adaptive vs Fixed Grid Cells”?

Make grids responsive to screen width. You practise Jetpack Compose Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Jetpack Compose Academy?

No prior experience is required. Jetpack Compose Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Adaptive vs Fixed Grid Cells” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Jetpack Compose Academy lesson?

Yes. Every Jetpack Compose Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. LazyVerticalGrid Galleries
  2. LazyRow for Carousels
  3. Adaptive vs Fixed Grid Cells
  4. Scroll State & Programmatic Scrolling
← Back to Jetpack Compose Academy