Releases: Ahmad-Hamwi/lazy-pagination-compose
Releases · Ahmad-Hamwi/lazy-pagination-compose
v1.4.0
v1.3.7
Breaking:
allItems
field:
Before:allItems
was non-nullable and accessing it with no pages appended before would result in an exception.
After:allItems
field is now nullable, and you can safely assert the field as non-nullable in the pagianted composables loaded scope or when you're sure that you have appended your first page.
New API:
appendPageWithUpdates
function allows you to append a page while still editing your existing one in one shot.
[versions]
lazy-pagination-compose = "1.3.7"
[libraries]
lazyPaginationCompose = { module = "io.github.ahmad-hamwi:lazy-pagination-compose", version.ref = "lazy-pagination-compose" }
PaginatedLazyVerticalGrid
PaginatedLazyVerticalGrid(
paginationState = paginationState,
firstPageProgressIndicator = { ... },
newPageProgressIndicator = { ... },
firstPageErrorIndicator = { e -> // from setError
... e.message ...
... onRetry = { paginationState.retryLastFailedRequest() } ...
},
newPageErrorIndicator = { e -> ... },
... // The rest of LazyVerticalGrid params
) {
itemsIndexed(
paginationState.allItems!!, // safe to access here [NEW]
) { _, item ->
Item(value = item)
}
}
PaginatedLazyHorizontalGrid
PaginatedLazyHorizontalGrid(
paginationState = paginationState,
firstPageProgressIndicator = { ... },
newPageProgressIndicator = { ... },
firstPageErrorIndicator = { e -> // from setError
... e.message ...
... onRetry = { paginationState.retryLastFailedRequest() } ...
},
newPageErrorIndicator = { e -> ... },
... // The rest of LazyHorizontalGrid params
) {
itemsIndexed(
paginationState.allItems!!, // safe to access here [NEW]
) { _, item ->
Item(value = item)
}
}
v1.3.5: Added support for Grids
- You can now use the original grids but paginated! Composables:
PaginatedLazyVerticalGrid
orPaginatedLazyHorizontalGrid
[versions]
lazy-pagination-compose = "1.3.5"
[libraries]
lazyPaginationCompose = { module = "io.github.ahmad-hamwi:lazy-pagination-compose", version.ref = "lazy-pagination-compose" }
PaginatedLazyVerticalGrid
PaginatedLazyVerticalGrid(
paginationState = paginationState,
firstPageProgressIndicator = { ... },
newPageProgressIndicator = { ... },
firstPageErrorIndicator = { e -> // from setError
... e.message ...
... onRetry = { paginationState.retryLastFailedRequest() } ...
},
newPageErrorIndicator = { e -> ... },
... // The rest of LazyVerticalGrid params
) {
itemsIndexed(
paginationState.allItems,
) { _, item ->
Item(value = item)
}
}
PaginatedLazyHorizontalGrid
PaginatedLazyHorizontalGrid(
paginationState = paginationState,
firstPageProgressIndicator = { ... },
newPageProgressIndicator = { ... },
firstPageErrorIndicator = { e -> // from setError
... e.message ...
... onRetry = { paginationState.retryLastFailedRequest() } ...
},
newPageErrorIndicator = { e -> ... },
... // The rest of LazyHorizontalGrid params
) {
itemsIndexed(
paginationState.allItems,
) { _, item ->
Item(value = item)
}
}
v1.2.5
v1.2.5: Added support for JS and wasm JS targets
- You can now use the paginated composables on the web!
[versions]
lazy-pagination-compose = "1.2.5"
[libraries]
lazyPaginationCompose = { module = "io.github.ahmad-hamwi:lazy-pagination-compose", version.ref = "lazy-pagination-compose" }