Skip to content

Commit

Permalink
remember lists / app demo
Browse files Browse the repository at this point in the history
  • Loading branch information
nanihadesuka committed Aug 11, 2024
1 parent 349e8f4 commit 04ced5b
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
Expand Down Expand Up @@ -105,7 +106,7 @@ fun MainView() {
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun LazyColumnView() {
val listData = (0..100).toList()
val listData = remember { (0..100).toList() }
val listState = rememberLazyListState()

Box(
Expand Down Expand Up @@ -160,7 +161,7 @@ fun LazyColumnView() {
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun LazyRowView() {
val listData = (0..100).toList()
val listData = remember { (0..100).toList() }
val listState = rememberLazyListState()

Box(
Expand Down Expand Up @@ -314,7 +315,7 @@ fun LazyHorizontalGridView() {

@Composable
fun ColumnView() {
val listData = (0..18).toList()
val listData = remember { (0..18).toList() }
val listState = rememberScrollState()
val indicatorContent = @Composable { normalizedOffset: Float, isThumbSelected: Boolean ->
Indicator(
Expand Down Expand Up @@ -357,7 +358,7 @@ fun ColumnView() {

@Composable
fun RowView() {
val listData = (0..100).toList()
val listData = remember { (0..100).toList() }
val listState = rememberScrollState()
val indicatorContent = @Composable { normalizedOffset: Float, isThumbSelected: Boolean ->
Indicator(
Expand Down

0 comments on commit 04ced5b

Please sign in to comment.