Kaydırma Durumu ve Programlı Kaydırma
Liste kaydırma konumunu okuyun ve denetleyin.
Kaydırma Durumu ve Programlı Kaydırma, 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.
Controlling the Scroll
Sometimes you need to read how far a list has scrolled, or jump it somewhere yourself. That is the job of a scroll state. 🎚️
rememberLazyListState
Create and hold a list state with rememberLazyListState, then pass it to your LazyColumn, LazyRow, or grid.
val listState = rememberLazyListState()
LazyColumn(state = listState) { }Grids Have State Too
A grid uses its own holder, rememberLazyGridState. Wire it the same way to track and drive a LazyVerticalGrid.
val gridState = rememberLazyGridState()
LazyVerticalGrid(state = gridState, columns = GridCells.Fixed(2)) { }Reading the First Item
Ask the state for firstVisibleItemIndex to know which item sits at the top of the viewport right now.
val firstIndex = listState.firstVisibleItemIndexDetecting Scroll Direction
The flag isScrollInProgress tells you whether the user is actively scrolling, handy for hiding a toolbar while they move.
if (listState.isScrollInProgress) hideToolbar()Jump Instantly
To snap straight to an item with no animation, call scrollToItem from a coroutine scope.
scope.launch {
listState.scrollToItem(index = 0)
}Scroll Smoothly
For a gentle glide instead of a jump, use animateScrollToItem. It is great for a back-to-top button.
scope.launch {
listState.animateScrollToItem(0)
}Why a Coroutine Scope
Scrolling is a suspend operation, so it must run in a coroutine. Grab a rememberCoroutineScope to launch it from a click.
val scope = rememberCoroutineScope()
Button(onClick = { scope.launch { listState.animateScrollToItem(0) } }) { }Show a Back-to-Top Button
Combine the two ideas: derive a visibility flag from firstVisibleItemIndex, then animate-scroll to zero on tap.
val showFab by remember {
derivedStateOf { listState.firstVisibleItemIndex > 5 }
}Survives Recomposition
Because the state is remembered, the scroll position survives recomposition. Use rememberSaveable variants to keep it across rotation.
State Drives the UI
The pattern is consistent: hold a scroll state, read it to react to position, and call its scroll functions to move the list yourself.
Quick Check
One on smooth scrolling.
Recap: Scroll Control
You learned to hold a scroll state, read firstVisibleItemIndex, and drive lists with scrollToItem and animateScrollToItem from a coroutine. 🚀
Sıkça Sorulan Sorular
“Kaydırma Durumu ve Programlı Kaydırma” dersi ücretsiz mi?
Evet — “Kaydırma Durumu ve Programlı Kaydırma” 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.
“Kaydırma Durumu ve Programlı Kaydırma” dersinde ne öğreneceğim?
Liste kaydırma konumunu okuyun ve denetleyin. 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.
“Kaydırma Durumu ve Programlı Kaydırma” 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
- LazyVerticalGrid Galerileri
- Carousel'ler için LazyRow
- Uyarlanabilir ve Sabit Izgara Hücreleri
- Kaydırma Durumu ve Programlı Kaydırma