History log of /frameworks/support/paging/integration-tests/testapp/src/main/java/android/arch/paging/integration/testapp/ItemDataSource.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f0d13608aae3b4700d84c1c4532abbea56ea7a28 08-Sep-2017 Chris Craik <ccraik@google.com> Paging doc codesample improvements, api cleanup

Added detail to several docs:
- Both DataSources, added invalidation code.
- All Adapters/AdapterHelpers, added DiffCallback samples
- Simplified samples by removing @NonNull/@Nullable in specific cases

Also rename loadCount -> countItems, to match with the KeyedDataSource
counting APIs.

Avoid need for LiveListAdapterUtil by using a weak reference from the
PagedList to the data presentation layer (Adapter/AdapterHelper)

Bug: 64809611
Test: ./gradlew createFlatfootDocsArchive -PofflineDocs=true

Change-Id: I2df5a9891a96e96f009a311100d7ff4b48a01d3f
/frameworks/support/paging/integration-tests/testapp/src/main/java/android/arch/paging/integration/testapp/ItemDataSource.java
ef346ae131affbba6345e00d833103acc5743c8a 29-Aug-2017 Chris Craik <ccraik@google.com> Paging API refinements, and package name rework

Bug: 64809611
Test: tests in paging-runtime, paging-common, room-integration-tests

Change-Id: I1e26f130d95b31494f9a0ef734fd87594de9ddd1
/frameworks/support/paging/integration-tests/testapp/src/main/java/android/arch/paging/integration/testapp/ItemDataSource.java
114bdca94b6571ef9f45ea6e826715141741d49e 25-Aug-2017 Chris Craik <ccraik@google.com> AdapterHelper cleanups, and ContigPagedList fixes

Test: ContiguousPagedListTest
Bug: 64809611

- fixes off-by-one in ContiguousPagedList prepend
- fixes prefetch load when data already loaded
- misc doc updates

Change-Id: I27cac2dcf9689b26572c4ef0ff8b3604bb46775c
/frameworks/support/paging/integration-tests/testapp/src/main/java/android/arch/paging/integration/testapp/ItemDataSource.java
24418e9aafa6ae3128ae47cf7087eda46dae4f5d 18-Aug-2017 Chris Craik <ccraik@google.com> Revert "Revert "Paging refactor to unify list/data source types, and simplify mutability""

bug:64838013

Fixed build breakage.

This reverts commit c051b0691f4363110fb3d62193a114b04a8ef344.

Change-Id: I4fd2442d185b4b107e2db45c402f79ed9948bc38
/frameworks/support/paging/integration-tests/testapp/src/main/java/android/arch/paging/integration/testapp/ItemDataSource.java
c051b0691f4363110fb3d62193a114b04a8ef344 18-Aug-2017 Chris Craik <ccraik@google.com> Revert "Paging refactor to unify list/data source types, and simplify mutability"

bug:64838013 Fix build breakage

This reverts commit 1cb45e73a41f91534febb7e5d799e1f703fb3763.

Change-Id: I88d2c954f48f1c6693ccfc31b3b62a37c5abac9a
/frameworks/support/paging/integration-tests/testapp/src/main/java/android/arch/paging/integration/testapp/ItemDataSource.java
1cb45e73a41f91534febb7e5d799e1f703fb3763 15-Jul-2017 Chris Craik <ccraik@google.com> Paging refactor to unify list/data source types, and simplify mutability

Bug: 64809611
Test: new tests passing

- Unified list type for contiguous data sources - null padding is created at initialization, and
consumed as items are loaded. Infinite unpadded, and counted padded lists use same list type
entirely.

- New list and DataSource type for tiled data sources, which can access data at any location.

- Split data source based on keyed vs tiled based implementations. This massively simplified the
few existing data sources, and allowed us to specialize further, making the trivial test (and
limit-offset) code much simpler (and avoiding code that was extremely prone to off by one errors)

- Added PagedListAdapter, which provides convenience wrapper for the AdapterHelper, saving users a
few extra lines of code.

- Uncountable positioning - rework also has relative data source position stored at initialization
so that countable items can use position, without being required to count their dataset. This
supports cases with simple position IDs, but where you: 1) don't want nulls in the data, 2) don't
care about count/scrollbars, 3) can't easily compute the total number.

- PagedList requires data to initialize - Removes need for weird warmup API, avoids showing a list
of nulls to user in countable case, and unifies initialization codepaths.

- PagedList has a snapshot() method that enables DiffUtil to run safely on a background thread on
immutable data, and snapshot-aware diffing that allows a new list to load content while it's being
used in diffing on a background thread.

Not done:

- Parameterized initialization (both init from key, storing key, passing key when creating LiveData<PagedList>)

Change-Id: I7cb945afe37e68aad44cde45277afd7a27416e52
/frameworks/support/paging/integration-tests/testapp/src/main/java/android/arch/paging/integration/testapp/ItemDataSource.java
9fd8e6171bbdc37f5516fe15b2d96f4ae926ef1a 23-Jun-2017 Chris Craik <ccraik@google.com> Initial commit of paging component.

This commit introduces a paging component to enable gradual, lazy
loading from large data sources, including Room queries.

The primary entry points are:

1) CountedDataSource, the base class for defining a countable (i.e.
fixed, known size) source of items, such as a Database query.

2) LazyList, the lazy-loading List-like component which pages content
in on a background thread from a CountedDataSource.

3) LiveLazyListProvider, the class which produces DataSources, and
presents a LiveData<LazyList<T>>.

4) LazyListAdapterHelper, which takes a LiveData<LazyList>, and
presents the data simply to an adapter. It computes differences
between versions with DiffUtil, and signalling updates to the adapter.

Currently, Room only presents a limit-offset query as an easy means to
get a LiveData of a LazyList, but it's possible to write a custom data
source to page in data from keyed (including composite-keyed) queries.

Test: new tests
Change-Id: I415879a032d83786d734c26c429828da3b8bc76a
/frameworks/support/paging/integration-tests/testapp/src/main/java/android/arch/paging/integration/testapp/ItemDataSource.java