Merge "Check in paging beta API files, adapted from release branch" into androidx-master-dev
diff --git a/paging/common/api/2.1.0-beta01.txt b/paging/common/api/2.1.0-beta01.txt
new file mode 100644
index 0000000..c8e0be1
--- /dev/null
+++ b/paging/common/api/2.1.0-beta01.txt
@@ -0,0 +1,182 @@
+// Signature format: 2.0
+package androidx.paging {
+
+  public abstract class DataSource<Key, Value> {
+    method @AnyThread public void addInvalidatedCallback(androidx.paging.DataSource.InvalidatedCallback);
+    method @AnyThread public void invalidate();
+    method @WorkerThread public boolean isInvalid();
+    method public abstract <ToValue> androidx.paging.DataSource<Key,ToValue> map(androidx.arch.core.util.Function<Value,ToValue>);
+    method public abstract <ToValue> androidx.paging.DataSource<Key,ToValue> mapByPage(androidx.arch.core.util.Function<java.util.List<Value>,java.util.List<ToValue>>);
+    method @AnyThread public void removeInvalidatedCallback(androidx.paging.DataSource.InvalidatedCallback);
+  }
+
+  public abstract static class DataSource.Factory<Key, Value> {
+    ctor public DataSource.Factory();
+    method public abstract androidx.paging.DataSource<Key,Value> create();
+    method public <ToValue> androidx.paging.DataSource.Factory<Key,ToValue> map(androidx.arch.core.util.Function<Value,ToValue>);
+    method public <ToValue> androidx.paging.DataSource.Factory<Key,ToValue> mapByPage(androidx.arch.core.util.Function<java.util.List<Value>,java.util.List<ToValue>>);
+  }
+
+  public static interface DataSource.InvalidatedCallback {
+    method @AnyThread public void onInvalidated();
+  }
+
+  public abstract class ItemKeyedDataSource<Key, Value> extends androidx.paging.DataSource<Key,Value> {
+    method public abstract Key getKey(Value);
+    method public abstract void loadAfter(androidx.paging.ItemKeyedDataSource.LoadParams<Key>, androidx.paging.ItemKeyedDataSource.LoadCallback<Value>);
+    method public abstract void loadBefore(androidx.paging.ItemKeyedDataSource.LoadParams<Key>, androidx.paging.ItemKeyedDataSource.LoadCallback<Value>);
+    method public abstract void loadInitial(androidx.paging.ItemKeyedDataSource.LoadInitialParams<Key>, androidx.paging.ItemKeyedDataSource.LoadInitialCallback<Value>);
+    method public final <ToValue> androidx.paging.ItemKeyedDataSource<Key,ToValue> map(androidx.arch.core.util.Function<Value,ToValue>);
+    method public final <ToValue> androidx.paging.ItemKeyedDataSource<Key,ToValue> mapByPage(androidx.arch.core.util.Function<java.util.List<Value>,java.util.List<ToValue>>);
+  }
+
+  public abstract static class ItemKeyedDataSource.LoadCallback<Value> {
+    ctor public ItemKeyedDataSource.LoadCallback();
+    method public abstract void onResult(java.util.List<Value>);
+  }
+
+  public abstract static class ItemKeyedDataSource.LoadInitialCallback<Value> extends androidx.paging.ItemKeyedDataSource.LoadCallback<Value> {
+    ctor public ItemKeyedDataSource.LoadInitialCallback();
+    method public abstract void onResult(java.util.List<Value>, int, int);
+  }
+
+  public static class ItemKeyedDataSource.LoadInitialParams<Key> {
+    ctor public ItemKeyedDataSource.LoadInitialParams(Key?, int, boolean);
+    field public final boolean placeholdersEnabled;
+    field public final Key? requestedInitialKey;
+    field public final int requestedLoadSize;
+  }
+
+  public static class ItemKeyedDataSource.LoadParams<Key> {
+    ctor public ItemKeyedDataSource.LoadParams(Key, int);
+    field public final Key key;
+    field public final int requestedLoadSize;
+  }
+
+  public abstract class PageKeyedDataSource<Key, Value> extends androidx.paging.DataSource<Key,Value> {
+    method public abstract void loadAfter(androidx.paging.PageKeyedDataSource.LoadParams<Key>, androidx.paging.PageKeyedDataSource.LoadCallback<Key,Value>);
+    method public abstract void loadBefore(androidx.paging.PageKeyedDataSource.LoadParams<Key>, androidx.paging.PageKeyedDataSource.LoadCallback<Key,Value>);
+    method public abstract void loadInitial(androidx.paging.PageKeyedDataSource.LoadInitialParams<Key>, androidx.paging.PageKeyedDataSource.LoadInitialCallback<Key,Value>);
+    method public final <ToValue> androidx.paging.PageKeyedDataSource<Key,ToValue> map(androidx.arch.core.util.Function<Value,ToValue>);
+    method public final <ToValue> androidx.paging.PageKeyedDataSource<Key,ToValue> mapByPage(androidx.arch.core.util.Function<java.util.List<Value>,java.util.List<ToValue>>);
+  }
+
+  public abstract static class PageKeyedDataSource.LoadCallback<Key, Value> {
+    ctor public PageKeyedDataSource.LoadCallback();
+    method public abstract void onResult(java.util.List<Value>, Key?);
+  }
+
+  public abstract static class PageKeyedDataSource.LoadInitialCallback<Key, Value> {
+    ctor public PageKeyedDataSource.LoadInitialCallback();
+    method public abstract void onResult(java.util.List<Value>, int, int, Key?, Key?);
+    method public abstract void onResult(java.util.List<Value>, Key?, Key?);
+  }
+
+  public static class PageKeyedDataSource.LoadInitialParams<Key> {
+    ctor public PageKeyedDataSource.LoadInitialParams(int, boolean);
+    field public final boolean placeholdersEnabled;
+    field public final int requestedLoadSize;
+  }
+
+  public static class PageKeyedDataSource.LoadParams<Key> {
+    ctor public PageKeyedDataSource.LoadParams(Key, int);
+    field public final Key key;
+    field public final int requestedLoadSize;
+  }
+
+  public abstract class PagedList<T> extends java.util.AbstractList<T> {
+    method public void addWeakCallback(java.util.List<T>?, androidx.paging.PagedList.Callback);
+    method public void detach();
+    method public T? get(int);
+    method public androidx.paging.PagedList.Config getConfig();
+    method public abstract androidx.paging.DataSource<?,T> getDataSource();
+    method public abstract Object? getLastKey();
+    method public int getLoadedCount();
+    method public int getPositionOffset();
+    method public boolean isDetached();
+    method public boolean isImmutable();
+    method public void loadAround(int);
+    method public void removeWeakCallback(androidx.paging.PagedList.Callback);
+    method public int size();
+    method public java.util.List<T> snapshot();
+  }
+
+  @MainThread public abstract static class PagedList.BoundaryCallback<T> {
+    ctor public PagedList.BoundaryCallback();
+    method public void onItemAtEndLoaded(T);
+    method public void onItemAtFrontLoaded(T);
+    method public void onZeroItemsLoaded();
+  }
+
+  public static final class PagedList.Builder<Key, Value> {
+    ctor public PagedList.Builder(androidx.paging.DataSource<Key,Value>, androidx.paging.PagedList.Config);
+    ctor public PagedList.Builder(androidx.paging.DataSource<Key,Value>, int);
+    method @WorkerThread public androidx.paging.PagedList<Value> build();
+    method public androidx.paging.PagedList.Builder<Key,Value> setBoundaryCallback(androidx.paging.PagedList.BoundaryCallback?);
+    method public androidx.paging.PagedList.Builder<Key,Value> setFetchExecutor(java.util.concurrent.Executor);
+    method public androidx.paging.PagedList.Builder<Key,Value> setInitialKey(Key?);
+    method public androidx.paging.PagedList.Builder<Key,Value> setNotifyExecutor(java.util.concurrent.Executor);
+  }
+
+  public abstract static class PagedList.Callback {
+    ctor public PagedList.Callback();
+    method public abstract void onChanged(int, int);
+    method public abstract void onInserted(int, int);
+    method public abstract void onRemoved(int, int);
+  }
+
+  public static class PagedList.Config {
+    field public static final int MAX_SIZE_UNBOUNDED = 2147483647; // 0x7fffffff
+    field public final boolean enablePlaceholders;
+    field public final int initialLoadSizeHint;
+    field public final int maxSize;
+    field public final int pageSize;
+    field public final int prefetchDistance;
+  }
+
+  public static final class PagedList.Config.Builder {
+    ctor public PagedList.Config.Builder();
+    method public androidx.paging.PagedList.Config build();
+    method public androidx.paging.PagedList.Config.Builder setEnablePlaceholders(boolean);
+    method public androidx.paging.PagedList.Config.Builder setInitialLoadSizeHint(@IntRange(from=1) int);
+    method public androidx.paging.PagedList.Config.Builder setMaxSize(@IntRange(from=2) int);
+    method public androidx.paging.PagedList.Config.Builder setPageSize(@IntRange(from=1) int);
+    method public androidx.paging.PagedList.Config.Builder setPrefetchDistance(@IntRange(from=0) int);
+  }
+
+  public abstract class PositionalDataSource<T> extends androidx.paging.DataSource<java.lang.Integer,T> {
+    method public static int computeInitialLoadPosition(androidx.paging.PositionalDataSource.LoadInitialParams, int);
+    method public static int computeInitialLoadSize(androidx.paging.PositionalDataSource.LoadInitialParams, int, int);
+    method @WorkerThread public abstract void loadInitial(androidx.paging.PositionalDataSource.LoadInitialParams, androidx.paging.PositionalDataSource.LoadInitialCallback<T>);
+    method @WorkerThread public abstract void loadRange(androidx.paging.PositionalDataSource.LoadRangeParams, androidx.paging.PositionalDataSource.LoadRangeCallback<T>);
+    method public final <V> androidx.paging.PositionalDataSource<V> map(androidx.arch.core.util.Function<T,V>);
+    method public final <V> androidx.paging.PositionalDataSource<V> mapByPage(androidx.arch.core.util.Function<java.util.List<T>,java.util.List<V>>);
+  }
+
+  public abstract static class PositionalDataSource.LoadInitialCallback<T> {
+    ctor public PositionalDataSource.LoadInitialCallback();
+    method public abstract void onResult(java.util.List<T>, int, int);
+    method public abstract void onResult(java.util.List<T>, int);
+  }
+
+  public static class PositionalDataSource.LoadInitialParams {
+    ctor public PositionalDataSource.LoadInitialParams(int, int, int, boolean);
+    field public final int pageSize;
+    field public final boolean placeholdersEnabled;
+    field public final int requestedLoadSize;
+    field public final int requestedStartPosition;
+  }
+
+  public abstract static class PositionalDataSource.LoadRangeCallback<T> {
+    ctor public PositionalDataSource.LoadRangeCallback();
+    method public abstract void onResult(java.util.List<T>);
+  }
+
+  public static class PositionalDataSource.LoadRangeParams {
+    ctor public PositionalDataSource.LoadRangeParams(int, int);
+    field public final int loadSize;
+    field public final int startPosition;
+  }
+
+}
+
diff --git a/paging/common/ktx/api/2.1.0-beta01.txt b/paging/common/ktx/api/2.1.0-beta01.txt
new file mode 100644
index 0000000..0f070c2
--- /dev/null
+++ b/paging/common/ktx/api/2.1.0-beta01.txt
@@ -0,0 +1,15 @@
+// Signature format: 2.0
+package androidx.paging {
+
+  public final class PagedListConfigKt {
+    ctor public PagedListConfigKt();
+    method public static androidx.paging.PagedList.Config Config(int pageSize, int prefetchDistance = pageSize, boolean enablePlaceholders = true, int initialLoadSizeHint = pageSize * androidx.paging.PagedList.Config.Builder.DEFAULT_INITIAL_PAGE_MULTIPLIER, int maxSize = 2147483647);
+  }
+
+  public final class PagedListKt {
+    ctor public PagedListKt();
+    method public static <Key, Value> androidx.paging.PagedList<Value> PagedList(androidx.paging.DataSource<Key,Value> dataSource, androidx.paging.PagedList.Config config, java.util.concurrent.Executor notifyExecutor, java.util.concurrent.Executor fetchExecutor, androidx.paging.PagedList.BoundaryCallback<Value>? boundaryCallback = null, Key? initialKey = null);
+  }
+
+}
+
diff --git a/paging/runtime/api/2.1.0-beta01.txt b/paging/runtime/api/2.1.0-beta01.txt
new file mode 100644
index 0000000..0f658df
--- /dev/null
+++ b/paging/runtime/api/2.1.0-beta01.txt
@@ -0,0 +1,42 @@
+// Signature format: 2.0
+package androidx.paging {
+
+  public class AsyncPagedListDiffer<T> {
+    ctor public AsyncPagedListDiffer(androidx.recyclerview.widget.RecyclerView.Adapter, androidx.recyclerview.widget.DiffUtil.ItemCallback<T>);
+    ctor public AsyncPagedListDiffer(androidx.recyclerview.widget.ListUpdateCallback, androidx.recyclerview.widget.AsyncDifferConfig<T>);
+    method public void addPagedListListener(androidx.paging.AsyncPagedListDiffer.PagedListListener<T>);
+    method public androidx.paging.PagedList<T>? getCurrentList();
+    method public T? getItem(int);
+    method public int getItemCount();
+    method public void removePagedListListener(androidx.paging.AsyncPagedListDiffer.PagedListListener<T>);
+    method public void submitList(androidx.paging.PagedList<T>?);
+    method public void submitList(androidx.paging.PagedList<T>?, Runnable?);
+  }
+
+  public static interface AsyncPagedListDiffer.PagedListListener<T> {
+    method public void onCurrentListChanged(androidx.paging.PagedList<T>?, androidx.paging.PagedList<T>?);
+  }
+
+  public final class LivePagedListBuilder<Key, Value> {
+    ctor public LivePagedListBuilder(androidx.paging.DataSource.Factory<Key,Value>, androidx.paging.PagedList.Config);
+    ctor public LivePagedListBuilder(androidx.paging.DataSource.Factory<Key,Value>, int);
+    method public androidx.lifecycle.LiveData<androidx.paging.PagedList<Value>> build();
+    method public androidx.paging.LivePagedListBuilder<Key,Value> setBoundaryCallback(androidx.paging.PagedList.BoundaryCallback<Value>?);
+    method public androidx.paging.LivePagedListBuilder<Key,Value> setFetchExecutor(java.util.concurrent.Executor);
+    method public androidx.paging.LivePagedListBuilder<Key,Value> setInitialLoadKey(Key?);
+  }
+
+  public abstract class PagedListAdapter<T, VH extends androidx.recyclerview.widget.RecyclerView.ViewHolder> extends androidx.recyclerview.widget.RecyclerView.Adapter<VH> {
+    ctor protected PagedListAdapter(androidx.recyclerview.widget.DiffUtil.ItemCallback<T>);
+    ctor protected PagedListAdapter(androidx.recyclerview.widget.AsyncDifferConfig<T>);
+    method public androidx.paging.PagedList<T>? getCurrentList();
+    method protected T? getItem(int);
+    method public int getItemCount();
+    method @Deprecated public void onCurrentListChanged(androidx.paging.PagedList<T>?);
+    method public void onCurrentListChanged(androidx.paging.PagedList<T>?, androidx.paging.PagedList<T>?);
+    method public void submitList(androidx.paging.PagedList<T>?);
+    method public void submitList(androidx.paging.PagedList<T>?, Runnable?);
+  }
+
+}
+
diff --git a/paging/runtime/ktx/api/2.1.0-beta01.txt b/paging/runtime/ktx/api/2.1.0-beta01.txt
new file mode 100644
index 0000000..b7750be
--- /dev/null
+++ b/paging/runtime/ktx/api/2.1.0-beta01.txt
@@ -0,0 +1,11 @@
+// Signature format: 2.0
+package androidx.paging {
+
+  public final class LivePagedListKt {
+    ctor public LivePagedListKt();
+    method public static <Key, Value> androidx.lifecycle.LiveData<androidx.paging.PagedList<Value>> toLiveData(androidx.paging.DataSource.Factory<Key,Value>, androidx.paging.PagedList.Config config, Key? initialLoadKey = null, androidx.paging.PagedList.BoundaryCallback<Value>? boundaryCallback = null, java.util.concurrent.Executor fetchExecutor = ArchTaskExecutor.getIOThreadExecutor());
+    method public static <Key, Value> androidx.lifecycle.LiveData<androidx.paging.PagedList<Value>> toLiveData(androidx.paging.DataSource.Factory<Key,Value>, int pageSize, Key? initialLoadKey = null, androidx.paging.PagedList.BoundaryCallback<Value>? boundaryCallback = null, java.util.concurrent.Executor fetchExecutor = ArchTaskExecutor.getIOThreadExecutor());
+  }
+
+}
+
diff --git a/paging/rxjava2/api/2.1.0-beta01.txt b/paging/rxjava2/api/2.1.0-beta01.txt
new file mode 100644
index 0000000..067f422
--- /dev/null
+++ b/paging/rxjava2/api/2.1.0-beta01.txt
@@ -0,0 +1,16 @@
+// Signature format: 2.0
+package androidx.paging {
+
+  public final class RxPagedListBuilder<Key, Value> {
+    ctor public RxPagedListBuilder(androidx.paging.DataSource.Factory<Key,Value>, androidx.paging.PagedList.Config);
+    ctor public RxPagedListBuilder(androidx.paging.DataSource.Factory<Key,Value>, int);
+    method public io.reactivex.Flowable<androidx.paging.PagedList<Value>> buildFlowable(io.reactivex.BackpressureStrategy);
+    method public io.reactivex.Observable<androidx.paging.PagedList<Value>> buildObservable();
+    method public androidx.paging.RxPagedListBuilder<Key,Value> setBoundaryCallback(androidx.paging.PagedList.BoundaryCallback<Value>?);
+    method public androidx.paging.RxPagedListBuilder<Key,Value> setFetchScheduler(io.reactivex.Scheduler);
+    method public androidx.paging.RxPagedListBuilder<Key,Value> setInitialLoadKey(Key?);
+    method public androidx.paging.RxPagedListBuilder<Key,Value> setNotifyScheduler(io.reactivex.Scheduler);
+  }
+
+}
+
diff --git a/paging/rxjava2/ktx/api/2.1.0-beta01.txt b/paging/rxjava2/ktx/api/2.1.0-beta01.txt
new file mode 100644
index 0000000..6b573b4
--- /dev/null
+++ b/paging/rxjava2/ktx/api/2.1.0-beta01.txt
@@ -0,0 +1,13 @@
+// Signature format: 2.0
+package androidx.paging {
+
+  public final class RxPagedListKt {
+    ctor public RxPagedListKt();
+    method public static <Key, Value> io.reactivex.Flowable<androidx.paging.PagedList<Value>> toFlowable(androidx.paging.DataSource.Factory<Key,Value>, androidx.paging.PagedList.Config config, Key? initialLoadKey = null, androidx.paging.PagedList.BoundaryCallback<Value>? boundaryCallback = null, io.reactivex.Scheduler? fetchScheduler = null, io.reactivex.Scheduler? notifyScheduler = null, io.reactivex.BackpressureStrategy backpressureStrategy = io.reactivex.BackpressureStrategy.LATEST);
+    method public static <Key, Value> io.reactivex.Flowable<androidx.paging.PagedList<Value>> toFlowable(androidx.paging.DataSource.Factory<Key,Value>, int pageSize, Key? initialLoadKey = null, androidx.paging.PagedList.BoundaryCallback<Value>? boundaryCallback = null, io.reactivex.Scheduler? fetchScheduler = null, io.reactivex.Scheduler? notifyScheduler = null, io.reactivex.BackpressureStrategy backpressureStrategy = io.reactivex.BackpressureStrategy.LATEST);
+    method public static <Key, Value> io.reactivex.Observable<androidx.paging.PagedList<Value>> toObservable(androidx.paging.DataSource.Factory<Key,Value>, androidx.paging.PagedList.Config config, Key? initialLoadKey = null, androidx.paging.PagedList.BoundaryCallback<Value>? boundaryCallback = null, io.reactivex.Scheduler? fetchScheduler = null, io.reactivex.Scheduler? notifyScheduler = null);
+    method public static <Key, Value> io.reactivex.Observable<androidx.paging.PagedList<Value>> toObservable(androidx.paging.DataSource.Factory<Key,Value>, int pageSize, Key? initialLoadKey = null, androidx.paging.PagedList.BoundaryCallback<Value>? boundaryCallback = null, io.reactivex.Scheduler? fetchScheduler = null, io.reactivex.Scheduler? notifyScheduler = null);
+  }
+
+}
+