Make CombinedLoadState helpers more useful.
Since source and mediator LoadStates now directly represent the runtime
of .load() calls, mediator's load state no longer represented the common
use-case scenario of waiting for remote load to finish + invalidate to
be applied before setting loadstate to NotLoading.
This CL re-models the helpers in CombinedLoadStates as stateful
representations, which follow the behavior described above to provide a
more usable default.
Relnote: "Updated the convenience properties,
`CombinedLoadStates.refresh`, `CombinedLoadStates.prepend`,
`CombinedLoadStates.append` to only transition from `Loading` to `NotLoading`
after both mediator and source load states are `NotLoading` to ensure the
remote update has been applied."
Test: ./gradlew paging:paging-common:test
Change-Id: I656192632c4ce073ac8e54a3f1c597bbbae77002
diff --git a/paging/common/api/current.txt b/paging/common/api/current.txt
index dfb2f53..b31c71f 100644
--- a/paging/common/api/current.txt
+++ b/paging/common/api/current.txt
@@ -9,10 +9,7 @@
}
public final class CombinedLoadStates {
- ctor public CombinedLoadStates(androidx.paging.LoadStates source, androidx.paging.LoadStates? mediator);
- method public androidx.paging.LoadStates component1();
- method public androidx.paging.LoadStates? component2();
- method public androidx.paging.CombinedLoadStates copy(androidx.paging.LoadStates source, androidx.paging.LoadStates? mediator);
+ ctor public CombinedLoadStates(androidx.paging.LoadState refresh, androidx.paging.LoadState prepend, androidx.paging.LoadState append, androidx.paging.LoadStates source, androidx.paging.LoadStates? mediator);
method public androidx.paging.LoadState getAppend();
method public androidx.paging.LoadStates? getMediator();
method public androidx.paging.LoadState getPrepend();