Skip to content

Commit

Permalink
Add missing parameter in samples and update README
Browse files Browse the repository at this point in the history
  • Loading branch information
wingio committed Jan 29, 2024
1 parent 2447cad commit 2780ab9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 39 deletions.
56 changes: 17 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,17 @@ materii-pullrefresh = { group = "dev.materii.pullrefresh", name = "pullrefresh",
```kt
@Composable
fun Test() {
var isRefreshing by remember {
mutableStateOf(false)
}
var pullRefreshState = rememberPullRefreshState(refreshing = isRefreshing, onRefresh = { /* Refresh some data here */ })

Scaffold(
modifier = Modifier.pullRefresh(pullRefreshState)
) {
Box(
contentAlignment = Alignment.Center,
modifier = Modifier
.padding(it)
.fillMaxSize()
.verticalScroll(rememberScrollState())
var isRefreshing by remember {
mutableStateOf(false)
}
var pullRefreshState = rememberPullRefreshState(refreshing = isRefreshing, onRefresh = { /* Refresh some data here */ })

PullRefreshLayout(
modifier = modifier,
state = pullRefreshState
) {
PullRefreshIndicator(
refreshing = isRefreshing,
state = pullRefreshState,
modifier = Modifier.align(Alignment.TopCenter)
)
}
Text("Some content")
}
}
```

Expand All @@ -70,28 +60,16 @@ fun Test() {
```kt
@Composable
fun Test() {
var isRefreshing by remember {
mutableStateOf(false)
}
var pullRefreshState = rememberPullRefreshState(refreshing = isRefreshing, onRefresh = { /* Refresh some data here */ })

Scaffold(
modifier = Modifier.pullRefresh(pullRefreshState)
) {
var isRefreshing by remember {
mutableStateOf(false)
}
var pullRefreshState = rememberPullRefreshState(refreshing = isRefreshing, onRefresh = { /* Refresh some data here */ })

DragRefreshLayout(
state = pullRefreshState
modifier = modifier
.padding(it)
.fillMaxSize()
modifier = modifier,
state = pullRefreshState
) {
Box(
contentAlignment = Alignment.Center,
modifier = Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
) {
Text("Some content")
}
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ fun DragRefreshSample(
DragRefreshLayout(
modifier = modifier,
state = pullRefreshState,
flipped = flipped,
indicator = {
DragRefreshIndicator(
state = pullRefreshState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ fun PullRefreshSample(
PullRefreshLayout(
modifier = modifier,
state = pullRefreshState,
flipped = flipped,
indicator = {
PullRefreshIndicator(
state = pullRefreshState,
Expand Down

0 comments on commit 2780ab9

Please sign in to comment.