Skip to content

Releases: Ahmad-Hamwi/lazy-pagination-compose

v1.4.0

03 Jan 10:52
cef5130
Compare
Choose a tag to compare

New API:

  • firstPageEmptyIndicator is now available across all lazy composables.

v1.3.7

21 Aug 12:00
73c60af
Compare
Choose a tag to compare

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

15 Aug 12:22
b04b4e2
Compare
Choose a tag to compare
  • You can now use the original grids but paginated! Composables: PaginatedLazyVerticalGrid or PaginatedLazyHorizontalGrid
[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

15 Aug 12:17
b04b4e2
Compare
Choose a tag to compare

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" }