-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca338ce
commit ceb6387
Showing
5 changed files
with
60 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
package com.frogobox.recycler.compose | ||
|
||
import androidx.compose.foundation.ExperimentalFoundationApi | ||
import androidx.compose.foundation.gestures.FlingBehavior | ||
import androidx.compose.foundation.gestures.ScrollableDefaults | ||
import androidx.compose.foundation.layout.Arrangement | ||
|
@@ -9,10 +8,9 @@ import androidx.compose.foundation.lazy.* | |
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
import com.frogobox.recycler.util.FLog | ||
import com.frogobox.recycler.core.FrogoRvConstant.FROGO_RV_COMPOSE_TAG | ||
import com.frogobox.recycler.util.FLog | ||
|
||
/* | ||
* Created by faisalamir on 21/08/21 | ||
|
@@ -90,54 +88,54 @@ fun <T> FrogoLazyRow( | |
} | ||
} | ||
|
||
@ExperimentalFoundationApi | ||
@Composable | ||
fun <T> FrogoLazyFixedGrid( | ||
data: List<T>, | ||
spanCount: Int, | ||
modifier: Modifier = Modifier, | ||
state: LazyListState = rememberLazyListState(), | ||
contentPadding: PaddingValues = PaddingValues(0.dp), | ||
content: @Composable() LazyGridScope.(data: T) -> Unit | ||
) { | ||
FLog.d("$FROGO_RV_COMPOSE_TAG - FrogoLazyFixedGrid") | ||
FLog.d("$FROGO_RV_COMPOSE_TAG - sum data : ${data.size}") | ||
LazyVerticalGrid( | ||
modifier = modifier, | ||
contentPadding = contentPadding, | ||
state = state, | ||
cells = GridCells.Fixed(spanCount), | ||
) { | ||
items(data.size) { index -> | ||
FLog.d("$FROGO_RV_COMPOSE_TAG - list data : ${data[index]}") | ||
this@LazyVerticalGrid.content(data[index]) | ||
} | ||
} | ||
} | ||
|
||
@ExperimentalFoundationApi | ||
@Composable | ||
fun <T> FrogoLazyAdaptiveGrid( | ||
data: List<T>, | ||
minSize: Dp, | ||
modifier: Modifier = Modifier, | ||
state: LazyListState = rememberLazyListState(), | ||
contentPadding: PaddingValues = PaddingValues(0.dp), | ||
content: @Composable() LazyGridScope.(data: T) -> Unit | ||
) { | ||
FLog.d("$FROGO_RV_COMPOSE_TAG - FrogoLazyAdaptiveGrid") | ||
FLog.d("$FROGO_RV_COMPOSE_TAG - sum data : ${data.size}") | ||
|
||
LazyVerticalGrid( | ||
modifier = modifier, | ||
contentPadding = contentPadding, | ||
state = state, | ||
cells = GridCells.Adaptive(minSize), | ||
) { | ||
items(data.size) { index -> | ||
FLog.d("$FROGO_RV_COMPOSE_TAG - list data : ${data[index]}") | ||
this@LazyVerticalGrid.content(data[index]) | ||
} | ||
} | ||
|
||
} | ||
//@ExperimentalFoundationApi | ||
//@Composable | ||
//fun <T> FrogoLazyFixedGrid( | ||
// data: List<T>, | ||
// spanCount: Int, | ||
// modifier: Modifier = Modifier, | ||
// state: LazyListState = rememberLazyListState(), | ||
// contentPadding: PaddingValues = PaddingValues(0.dp), | ||
// content: @Composable() LazyGridScope.(data: T) -> Unit | ||
//) { | ||
// FLog.d("$FROGO_RV_COMPOSE_TAG - FrogoLazyFixedGrid") | ||
// FLog.d("$FROGO_RV_COMPOSE_TAG - sum data : ${data.size}") | ||
// LazyVerticalGrid( | ||
// modifier = modifier, | ||
// contentPadding = contentPadding, | ||
// state = state, | ||
// cells = GridCells.Fixed(spanCount), | ||
// ) { | ||
// items(data.size) { index -> | ||
// FLog.d("$FROGO_RV_COMPOSE_TAG - list data : ${data[index]}") | ||
// [email protected](data[index]) | ||
// } | ||
// } | ||
//} | ||
// | ||
//@ExperimentalFoundationApi | ||
//@Composable | ||
//fun <T> FrogoLazyAdaptiveGrid( | ||
// data: List<T>, | ||
// minSize: Dp, | ||
// modifier: Modifier = Modifier, | ||
// state: LazyListState = rememberLazyListState(), | ||
// contentPadding: PaddingValues = PaddingValues(0.dp), | ||
// content: @Composable() LazyGridScope.(data: T) -> Unit | ||
//) { | ||
// FLog.d("$FROGO_RV_COMPOSE_TAG - FrogoLazyAdaptiveGrid") | ||
// FLog.d("$FROGO_RV_COMPOSE_TAG - sum data : ${data.size}") | ||
// | ||
// LazyVerticalGrid( | ||
// modifier = modifier, | ||
// contentPadding = contentPadding, | ||
// state = state, | ||
// cells = GridCells.Adaptive(minSize), | ||
// ) { | ||
// items(data.size) { index -> | ||
// FLog.d("$FROGO_RV_COMPOSE_TAG - list data : ${data[index]}") | ||
// [email protected](data[index]) | ||
// } | ||
// } | ||
// | ||
//} |