Jeff Gaston | 5d65a6a | 2019-01-23 13:44:15 -0500 | [diff] [blame] | 1 | // Signature format: 3.0 |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 2 | package androidx.paging { |
| 3 | |
| 4 | public abstract class DataSource<Key, Value> { |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 5 | method @AnyThread public void addInvalidatedCallback(androidx.paging.DataSource.InvalidatedCallback onInvalidatedCallback); |
| 6 | method protected final java.util.concurrent.Executor getExecutor(); |
Jeff Gaston | c21caf9 | 2018-10-16 13:24:41 -0400 | [diff] [blame] | 7 | method @AnyThread public void invalidate(); |
| 8 | method @WorkerThread public boolean isInvalid(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 9 | method public boolean isRetryableError(Throwable error); |
| 10 | method public <ToValue> androidx.paging.DataSource<Key,ToValue> map(androidx.arch.core.util.Function<Value,ToValue> function); |
| 11 | method public <ToValue> androidx.paging.DataSource<Key,ToValue> mapByPage(androidx.arch.core.util.Function<java.util.List<Value>,java.util.List<ToValue>> function); |
| 12 | method @AnyThread public void removeInvalidatedCallback(androidx.paging.DataSource.InvalidatedCallback onInvalidatedCallback); |
| 13 | property protected final java.util.concurrent.Executor executor; |
| 14 | property @WorkerThread public boolean isInvalid; |
| 15 | } |
| 16 | |
| 17 | public static class DataSource.BaseResult<Value> { |
| 18 | ctor protected DataSource.BaseResult(java.util.List<? extends Value> data, Object? prevKey, Object? nextKey, int leadingNulls, int trailingNulls, int offset, boolean counted); |
| 19 | method public final boolean getCounted(); |
| 20 | method public final int getLeadingNulls(); |
| 21 | method public final Object? getNextKey(); |
| 22 | method public final int getOffset(); |
| 23 | method public final Object? getPrevKey(); |
| 24 | method public final int getTrailingNulls(); |
| 25 | field public final java.util.List<Value> data; |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 26 | } |
| 27 | |
Jeff Gaston | c21caf9 | 2018-10-16 13:24:41 -0400 | [diff] [blame] | 28 | public abstract static class DataSource.Factory<Key, Value> { |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 29 | ctor public DataSource.Factory(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 30 | method public abstract androidx.paging.DataSource<Key,Value> create(); |
| 31 | method public <ToValue> androidx.paging.DataSource.Factory<Key,ToValue> map(androidx.arch.core.util.Function<Value,ToValue> function); |
| 32 | method public <ToValue> androidx.paging.DataSource.Factory<Key,ToValue> mapByPage(androidx.arch.core.util.Function<java.util.List<Value>,java.util.List<ToValue>> function); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 33 | } |
| 34 | |
Jeff Gaston | c21caf9 | 2018-10-16 13:24:41 -0400 | [diff] [blame] | 35 | public static interface DataSource.InvalidatedCallback { |
| 36 | method @AnyThread public void onInvalidated(); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 37 | } |
| 38 | |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 39 | public abstract class ItemKeyedDataSource<Key, Value> extends androidx.paging.ListenableItemKeyedDataSource<Key,Value> { |
| 40 | ctor public ItemKeyedDataSource(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 41 | method public final com.google.common.util.concurrent.ListenableFuture<androidx.paging.ListenableItemKeyedDataSource.Result<Value>> loadAfter(androidx.paging.ListenableItemKeyedDataSource.LoadParams<Key> params); |
| 42 | method public abstract void loadAfter(androidx.paging.ItemKeyedDataSource.LoadParams<Key> params, androidx.paging.ItemKeyedDataSource.LoadCallback<Value> callback); |
| 43 | method public final com.google.common.util.concurrent.ListenableFuture<androidx.paging.ListenableItemKeyedDataSource.Result<Value>> loadBefore(androidx.paging.ListenableItemKeyedDataSource.LoadParams<Key> params); |
| 44 | method public abstract void loadBefore(androidx.paging.ItemKeyedDataSource.LoadParams<Key> params, androidx.paging.ItemKeyedDataSource.LoadCallback<Value> callback); |
| 45 | method public final com.google.common.util.concurrent.ListenableFuture<androidx.paging.ListenableItemKeyedDataSource.InitialResult<Value>> loadInitial(androidx.paging.ListenableItemKeyedDataSource.LoadInitialParams<Key> params); |
| 46 | method public abstract void loadInitial(androidx.paging.ItemKeyedDataSource.LoadInitialParams<Key> params, androidx.paging.ItemKeyedDataSource.LoadInitialCallback<Value> callback); |
| 47 | method public final <ToValue> androidx.paging.ItemKeyedDataSource<Key,ToValue> map(androidx.arch.core.util.Function<Value,ToValue> function); |
| 48 | method public final <ToValue> androidx.paging.ItemKeyedDataSource<Key,ToValue> mapByPage(androidx.arch.core.util.Function<java.util.List<Value>,java.util.List<ToValue>> function); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 49 | } |
| 50 | |
Jeff Gaston | c21caf9 | 2018-10-16 13:24:41 -0400 | [diff] [blame] | 51 | public abstract static class ItemKeyedDataSource.LoadCallback<Value> { |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 52 | ctor public ItemKeyedDataSource.LoadCallback(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 53 | method public void onError(Throwable error); |
| 54 | method public abstract void onResult(java.util.List<? extends Value> data); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 55 | } |
| 56 | |
Jeff Gaston | c21caf9 | 2018-10-16 13:24:41 -0400 | [diff] [blame] | 57 | public abstract static class ItemKeyedDataSource.LoadInitialCallback<Value> extends androidx.paging.ItemKeyedDataSource.LoadCallback<Value> { |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 58 | ctor public ItemKeyedDataSource.LoadInitialCallback(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 59 | method public abstract void onResult(java.util.List<? extends Value> data, int position, int totalCount); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 60 | } |
| 61 | |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 62 | public static class ItemKeyedDataSource.LoadInitialParams<Key> extends androidx.paging.ListenableItemKeyedDataSource.LoadInitialParams<Key> { |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 63 | ctor public ItemKeyedDataSource.LoadInitialParams(Key? requestedInitialKey, int requestedLoadSize, boolean placeholdersEnabled); |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | public static class ItemKeyedDataSource.LoadParams<Key> extends androidx.paging.ListenableItemKeyedDataSource.LoadParams<Key> { |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 67 | ctor public ItemKeyedDataSource.LoadParams(Key key, int requestedLoadSize); |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | public abstract class ListenableItemKeyedDataSource<Key, Value> extends androidx.paging.DataSource<Key,Value> { |
| 71 | ctor public ListenableItemKeyedDataSource(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 72 | method public abstract Key getKey(Value item); |
| 73 | method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.paging.ListenableItemKeyedDataSource.Result<Value>> loadAfter(androidx.paging.ListenableItemKeyedDataSource.LoadParams<Key> params); |
| 74 | method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.paging.ListenableItemKeyedDataSource.Result<Value>> loadBefore(androidx.paging.ListenableItemKeyedDataSource.LoadParams<Key> params); |
| 75 | method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.paging.ListenableItemKeyedDataSource.InitialResult<Value>> loadInitial(androidx.paging.ListenableItemKeyedDataSource.LoadInitialParams<Key> params); |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 76 | } |
| 77 | |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 78 | public static class ListenableItemKeyedDataSource.InitialResult<V> extends androidx.paging.DataSource.BaseResult<V> { |
| 79 | ctor public ListenableItemKeyedDataSource.InitialResult(java.util.List<? extends V> data, int position, int totalCount); |
| 80 | ctor public ListenableItemKeyedDataSource.InitialResult(java.util.List<? extends V> data); |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | public static class ListenableItemKeyedDataSource.LoadInitialParams<Key> { |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 84 | ctor public ListenableItemKeyedDataSource.LoadInitialParams(Key? requestedInitialKey, int requestedLoadSize, boolean placeholdersEnabled); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 85 | field public final boolean placeholdersEnabled; |
Jeff Gaston | c21caf9 | 2018-10-16 13:24:41 -0400 | [diff] [blame] | 86 | field public final Key? requestedInitialKey; |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 87 | field public final int requestedLoadSize; |
| 88 | } |
| 89 | |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 90 | public static class ListenableItemKeyedDataSource.LoadParams<Key> { |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 91 | ctor public ListenableItemKeyedDataSource.LoadParams(Key key, int requestedLoadSize); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 92 | field public final Key key; |
| 93 | field public final int requestedLoadSize; |
| 94 | } |
| 95 | |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 96 | public static class ListenableItemKeyedDataSource.Result<V> extends androidx.paging.DataSource.BaseResult<V> { |
| 97 | ctor public ListenableItemKeyedDataSource.Result(java.util.List<? extends V> data); |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | public abstract class ListenablePageKeyedDataSource<Key, Value> extends androidx.paging.DataSource<Key,Value> { |
| 101 | ctor public ListenablePageKeyedDataSource(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 102 | method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.paging.ListenablePageKeyedDataSource.Result<Key,Value>> loadAfter(androidx.paging.ListenablePageKeyedDataSource.LoadParams<Key> params); |
| 103 | method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.paging.ListenablePageKeyedDataSource.Result<Key,Value>> loadBefore(androidx.paging.ListenablePageKeyedDataSource.LoadParams<Key> params); |
| 104 | method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.paging.ListenablePageKeyedDataSource.InitialResult<Key,Value>> loadInitial(androidx.paging.ListenablePageKeyedDataSource.LoadInitialParams<Key> params); |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 105 | } |
| 106 | |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 107 | public static class ListenablePageKeyedDataSource.InitialResult<Key, Value> extends androidx.paging.DataSource.BaseResult<Value> { |
| 108 | ctor public ListenablePageKeyedDataSource.InitialResult(java.util.List<? extends Value> data, int position, int totalCount, Key? previousPageKey, Key? nextPageKey); |
| 109 | ctor public ListenablePageKeyedDataSource.InitialResult(java.util.List<? extends Value> data, Key? previousPageKey, Key? nextPageKey); |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | public static class ListenablePageKeyedDataSource.LoadInitialParams<Key> { |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 113 | ctor public ListenablePageKeyedDataSource.LoadInitialParams(int requestedLoadSize, boolean placeholdersEnabled); |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 114 | field public final boolean placeholdersEnabled; |
| 115 | field public final int requestedLoadSize; |
| 116 | } |
| 117 | |
| 118 | public static class ListenablePageKeyedDataSource.LoadParams<Key> { |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 119 | ctor public ListenablePageKeyedDataSource.LoadParams(Key key, int requestedLoadSize); |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 120 | field public final Key key; |
| 121 | field public final int requestedLoadSize; |
| 122 | } |
| 123 | |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 124 | public static class ListenablePageKeyedDataSource.Result<Key, Value> extends androidx.paging.DataSource.BaseResult<Value> { |
| 125 | ctor public ListenablePageKeyedDataSource.Result(java.util.List<? extends Value> data, Key? adjacentPageKey); |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | public abstract class ListenablePositionalDataSource<T> extends androidx.paging.DataSource<java.lang.Integer,T> { |
| 129 | ctor public ListenablePositionalDataSource(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 130 | method public static final int computeInitialLoadPosition(androidx.paging.ListenablePositionalDataSource.LoadInitialParams params, int totalCount); |
| 131 | method public static final int computeInitialLoadSize(androidx.paging.ListenablePositionalDataSource.LoadInitialParams params, int initialLoadPosition, int totalCount); |
| 132 | method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.paging.ListenablePositionalDataSource.InitialResult<T>> loadInitial(androidx.paging.ListenablePositionalDataSource.LoadInitialParams params); |
| 133 | method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.paging.ListenablePositionalDataSource.RangeResult<T>> loadRange(androidx.paging.ListenablePositionalDataSource.LoadRangeParams params); |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 134 | } |
| 135 | |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 136 | public static class ListenablePositionalDataSource.InitialResult<V> extends androidx.paging.DataSource.BaseResult<V> { |
| 137 | ctor public ListenablePositionalDataSource.InitialResult(java.util.List<? extends V> data, int position, int totalCount); |
| 138 | ctor public ListenablePositionalDataSource.InitialResult(java.util.List<? extends V> data, int position); |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 139 | } |
| 140 | |
| 141 | public static class ListenablePositionalDataSource.LoadInitialParams { |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 142 | ctor public ListenablePositionalDataSource.LoadInitialParams(int requestedStartPosition, int requestedLoadSize, int pageSize, boolean placeholdersEnabled); |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 143 | field public final int pageSize; |
| 144 | field public final boolean placeholdersEnabled; |
| 145 | field public final int requestedLoadSize; |
| 146 | field public final int requestedStartPosition; |
| 147 | } |
| 148 | |
| 149 | public static class ListenablePositionalDataSource.LoadRangeParams { |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 150 | ctor public ListenablePositionalDataSource.LoadRangeParams(int startPosition, int loadSize); |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 151 | field public final int loadSize; |
| 152 | field public final int startPosition; |
| 153 | } |
| 154 | |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 155 | public static class ListenablePositionalDataSource.RangeResult<V> extends androidx.paging.DataSource.BaseResult<V> { |
| 156 | ctor public ListenablePositionalDataSource.RangeResult(java.util.List<? extends V> data); |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | public abstract class PageKeyedDataSource<Key, Value> extends androidx.paging.ListenablePageKeyedDataSource<Key,Value> { |
| 160 | ctor public PageKeyedDataSource(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 161 | method public final com.google.common.util.concurrent.ListenableFuture<androidx.paging.ListenablePageKeyedDataSource.Result<Key,Value>> loadAfter(androidx.paging.ListenablePageKeyedDataSource.LoadParams<Key> params); |
| 162 | method public abstract void loadAfter(androidx.paging.PageKeyedDataSource.LoadParams<Key> params, androidx.paging.PageKeyedDataSource.LoadCallback<Key,Value> callback); |
| 163 | method public final com.google.common.util.concurrent.ListenableFuture<androidx.paging.ListenablePageKeyedDataSource.Result<Key,Value>> loadBefore(androidx.paging.ListenablePageKeyedDataSource.LoadParams<Key> params); |
| 164 | method public abstract void loadBefore(androidx.paging.PageKeyedDataSource.LoadParams<Key> params, androidx.paging.PageKeyedDataSource.LoadCallback<Key,Value> callback); |
| 165 | method public final com.google.common.util.concurrent.ListenableFuture<androidx.paging.ListenablePageKeyedDataSource.InitialResult<Key,Value>> loadInitial(androidx.paging.ListenablePageKeyedDataSource.LoadInitialParams<Key> params); |
| 166 | method public abstract void loadInitial(androidx.paging.PageKeyedDataSource.LoadInitialParams<Key> params, androidx.paging.PageKeyedDataSource.LoadInitialCallback<Key,Value> callback); |
| 167 | method public final <ToValue> androidx.paging.PageKeyedDataSource<Key,ToValue> map(androidx.arch.core.util.Function<Value,ToValue> function); |
| 168 | method public final <ToValue> androidx.paging.PageKeyedDataSource<Key,ToValue> mapByPage(androidx.arch.core.util.Function<java.util.List<Value>,java.util.List<ToValue>> function); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 169 | } |
| 170 | |
Jeff Gaston | c21caf9 | 2018-10-16 13:24:41 -0400 | [diff] [blame] | 171 | public abstract static class PageKeyedDataSource.LoadCallback<Key, Value> { |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 172 | ctor public PageKeyedDataSource.LoadCallback(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 173 | method public void onError(Throwable error); |
| 174 | method public abstract void onResult(java.util.List<? extends Value> data, Key? adjacentPageKey); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 175 | } |
| 176 | |
Jeff Gaston | c21caf9 | 2018-10-16 13:24:41 -0400 | [diff] [blame] | 177 | public abstract static class PageKeyedDataSource.LoadInitialCallback<Key, Value> { |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 178 | ctor public PageKeyedDataSource.LoadInitialCallback(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 179 | method public void onError(Throwable error); |
| 180 | method public abstract void onResult(java.util.List<? extends Value> data, int position, int totalCount, Key? previousPageKey, Key? nextPageKey); |
| 181 | method public abstract void onResult(java.util.List<? extends Value> data, Key? previousPageKey, Key? nextPageKey); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 182 | } |
| 183 | |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 184 | public static class PageKeyedDataSource.LoadInitialParams<Key> extends androidx.paging.ListenablePageKeyedDataSource.LoadInitialParams<Key> { |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 185 | ctor public PageKeyedDataSource.LoadInitialParams(int requestedLoadSize, boolean placeholdersEnabled); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 186 | } |
| 187 | |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 188 | public static class PageKeyedDataSource.LoadParams<Key> extends androidx.paging.ListenablePageKeyedDataSource.LoadParams<Key> { |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 189 | ctor public PageKeyedDataSource.LoadParams(Key key, int requestedLoadSize); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 190 | } |
| 191 | |
Jeff Gaston | c21caf9 | 2018-10-16 13:24:41 -0400 | [diff] [blame] | 192 | public abstract class PagedList<T> extends java.util.AbstractList<T> { |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 193 | method public void addWeakCallback(java.util.List<? extends T>? previousSnapshot, androidx.paging.PagedList.Callback callback); |
| 194 | method public void addWeakLoadStateListener(androidx.paging.PagedList.LoadStateListener listener); |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 195 | method public abstract void detach(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 196 | method public T? get(int index); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 197 | method public androidx.paging.PagedList.Config getConfig(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 198 | method public abstract androidx.paging.DataSource<?,T> getDataSource(); |
Jeff Gaston | c21caf9 | 2018-10-16 13:24:41 -0400 | [diff] [blame] | 199 | method public abstract Object? getLastKey(); |
Chris Craik | 00cf205 | 2018-08-10 14:00:23 -0700 | [diff] [blame] | 200 | method public int getLoadedCount(); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 201 | method public int getPositionOffset(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 202 | method public int getSize(); |
| 203 | method public abstract boolean isContiguous(); |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 204 | method public abstract boolean isDetached(); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 205 | method public boolean isImmutable(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 206 | method public void loadAround(int index); |
| 207 | method public void removeWeakCallback(androidx.paging.PagedList.Callback callback); |
| 208 | method public void removeWeakLoadStateListener(androidx.paging.PagedList.LoadStateListener listener); |
Chris Craik | cf72bdc | 2018-10-18 13:32:02 -0700 | [diff] [blame] | 209 | method public void retry(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 210 | method public java.util.List<T> snapshot(); |
| 211 | property public androidx.paging.PagedList.Config config; |
| 212 | property public abstract androidx.paging.DataSource<?,T> dataSource; |
| 213 | property public abstract boolean isContiguous; |
| 214 | property public abstract boolean isDetached; |
| 215 | property public boolean isImmutable; |
| 216 | property public abstract Object? lastKey; |
| 217 | property public int loadedCount; |
| 218 | property public int positionOffset; |
| 219 | property public int size; |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 220 | } |
| 221 | |
Jeff Gaston | c21caf9 | 2018-10-16 13:24:41 -0400 | [diff] [blame] | 222 | @MainThread public abstract static class PagedList.BoundaryCallback<T> { |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 223 | ctor public PagedList.BoundaryCallback(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 224 | method public void onItemAtEndLoaded(T? itemAtEnd); |
| 225 | method public void onItemAtFrontLoaded(T? itemAtFront); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 226 | method public void onZeroItemsLoaded(); |
| 227 | } |
| 228 | |
| 229 | public static final class PagedList.Builder<Key, Value> { |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 230 | ctor public PagedList.Builder(androidx.paging.DataSource<Key,Value> dataSource, androidx.paging.PagedList.Config config); |
| 231 | ctor public PagedList.Builder(androidx.paging.DataSource<Key,Value> dataSource, int pageSize); |
| 232 | method @Deprecated @WorkerThread public androidx.paging.PagedList<Value> build(); |
| 233 | method public com.google.common.util.concurrent.ListenableFuture<androidx.paging.PagedList<Value>> buildAsync(); |
| 234 | method public androidx.paging.PagedList.Builder<Key,Value> setBoundaryCallback(androidx.paging.PagedList.BoundaryCallback<Value>? boundaryCallback); |
| 235 | method public androidx.paging.PagedList.Builder<Key,Value> setFetchExecutor(java.util.concurrent.Executor fetchExecutor); |
| 236 | method public androidx.paging.PagedList.Builder<Key,Value> setInitialKey(Key? initialKey); |
| 237 | method public androidx.paging.PagedList.Builder<Key,Value> setNotifyExecutor(java.util.concurrent.Executor notifyExecutor); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 238 | } |
| 239 | |
Jeff Gaston | c21caf9 | 2018-10-16 13:24:41 -0400 | [diff] [blame] | 240 | public abstract static class PagedList.Callback { |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 241 | ctor public PagedList.Callback(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 242 | method public abstract void onChanged(int position, int count); |
| 243 | method public abstract void onInserted(int position, int count); |
| 244 | method public abstract void onRemoved(int position, int count); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 245 | } |
| 246 | |
| 247 | public static class PagedList.Config { |
Chris Craik | e8ca38c | 2018-05-22 18:08:16 -0700 | [diff] [blame] | 248 | field public static final int MAX_SIZE_UNBOUNDED = 2147483647; // 0x7fffffff |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 249 | field public final boolean enablePlaceholders; |
| 250 | field public final int initialLoadSizeHint; |
Chris Craik | e8ca38c | 2018-05-22 18:08:16 -0700 | [diff] [blame] | 251 | field public final int maxSize; |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 252 | field public final int pageSize; |
| 253 | field public final int prefetchDistance; |
| 254 | } |
| 255 | |
| 256 | public static final class PagedList.Config.Builder { |
| 257 | ctor public PagedList.Config.Builder(); |
| 258 | method public androidx.paging.PagedList.Config build(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 259 | method public androidx.paging.PagedList.Config.Builder setEnablePlaceholders(boolean enablePlaceholders); |
| 260 | method public androidx.paging.PagedList.Config.Builder setInitialLoadSizeHint(@IntRange(from=1) int initialLoadSizeHint); |
| 261 | method public androidx.paging.PagedList.Config.Builder setMaxSize(@IntRange(from=2) int maxSize); |
| 262 | method public androidx.paging.PagedList.Config.Builder setPageSize(@IntRange(from=1) int pageSize); |
| 263 | method public androidx.paging.PagedList.Config.Builder setPrefetchDistance(@IntRange(from=0) int prefetchDistance); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 264 | } |
| 265 | |
Jeff Gaston | 5d65a6a | 2019-01-23 13:44:15 -0500 | [diff] [blame] | 266 | public enum PagedList.LoadState { |
Chris Craik | cf72bdc | 2018-10-18 13:32:02 -0700 | [diff] [blame] | 267 | enum_constant public static final androidx.paging.PagedList.LoadState DONE; |
| 268 | enum_constant public static final androidx.paging.PagedList.LoadState ERROR; |
| 269 | enum_constant public static final androidx.paging.PagedList.LoadState IDLE; |
| 270 | enum_constant public static final androidx.paging.PagedList.LoadState LOADING; |
| 271 | enum_constant public static final androidx.paging.PagedList.LoadState RETRYABLE_ERROR; |
| 272 | } |
| 273 | |
| 274 | public static interface PagedList.LoadStateListener { |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 275 | method public void onLoadStateChanged(androidx.paging.PagedList.LoadType type, androidx.paging.PagedList.LoadState state, Throwable? error); |
Chris Craik | cf72bdc | 2018-10-18 13:32:02 -0700 | [diff] [blame] | 276 | } |
| 277 | |
Jeff Gaston | 5d65a6a | 2019-01-23 13:44:15 -0500 | [diff] [blame] | 278 | public enum PagedList.LoadType { |
Chris Craik | cf72bdc | 2018-10-18 13:32:02 -0700 | [diff] [blame] | 279 | enum_constant public static final androidx.paging.PagedList.LoadType END; |
| 280 | enum_constant public static final androidx.paging.PagedList.LoadType REFRESH; |
| 281 | enum_constant public static final androidx.paging.PagedList.LoadType START; |
| 282 | } |
| 283 | |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 284 | public final class PagedListConfigKt { |
| 285 | ctor public PagedListConfigKt(); |
| 286 | 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); |
| 287 | } |
| 288 | |
Dustin Lam | 26ca1a7 | 2019-05-28 17:42:51 -0700 | [diff] [blame^] | 289 | public final class PagedListKt { |
| 290 | ctor public PagedListKt(); |
| 291 | 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); |
| 292 | } |
| 293 | |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 294 | public abstract class PositionalDataSource<T> extends androidx.paging.ListenablePositionalDataSource<T> { |
| 295 | ctor public PositionalDataSource(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 296 | method public static final int computeInitialLoadPosition(androidx.paging.PositionalDataSource.LoadInitialParams params, int totalCount); |
| 297 | method public static final int computeInitialLoadSize(androidx.paging.PositionalDataSource.LoadInitialParams params, int initialLoadPosition, int totalCount); |
| 298 | method public final com.google.common.util.concurrent.ListenableFuture<androidx.paging.ListenablePositionalDataSource.InitialResult<T>> loadInitial(androidx.paging.ListenablePositionalDataSource.LoadInitialParams params); |
| 299 | method @WorkerThread public abstract void loadInitial(androidx.paging.PositionalDataSource.LoadInitialParams params, androidx.paging.PositionalDataSource.LoadInitialCallback<T> callback); |
| 300 | method public final com.google.common.util.concurrent.ListenableFuture<androidx.paging.ListenablePositionalDataSource.RangeResult<T>> loadRange(androidx.paging.ListenablePositionalDataSource.LoadRangeParams params); |
| 301 | method @WorkerThread public abstract void loadRange(androidx.paging.PositionalDataSource.LoadRangeParams params, androidx.paging.PositionalDataSource.LoadRangeCallback<T> callback); |
| 302 | method public final <V> androidx.paging.PositionalDataSource<V> map(androidx.arch.core.util.Function<T,V> function); |
| 303 | method public final <V> androidx.paging.PositionalDataSource<V> mapByPage(androidx.arch.core.util.Function<java.util.List<T>,java.util.List<V>> function); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 304 | } |
| 305 | |
Jeff Gaston | c21caf9 | 2018-10-16 13:24:41 -0400 | [diff] [blame] | 306 | public abstract static class PositionalDataSource.LoadInitialCallback<T> { |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 307 | ctor public PositionalDataSource.LoadInitialCallback(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 308 | method public void onError(Throwable error); |
| 309 | method public abstract void onResult(java.util.List<? extends T> data, int position, int totalCount); |
| 310 | method public abstract void onResult(java.util.List<? extends T> data, int position); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 311 | } |
| 312 | |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 313 | public static class PositionalDataSource.LoadInitialParams extends androidx.paging.ListenablePositionalDataSource.LoadInitialParams { |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 314 | ctor public PositionalDataSource.LoadInitialParams(int requestedStartPosition, int requestedLoadSize, int pageSize, boolean placeholdersEnabled); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 315 | } |
| 316 | |
Jeff Gaston | c21caf9 | 2018-10-16 13:24:41 -0400 | [diff] [blame] | 317 | public abstract static class PositionalDataSource.LoadRangeCallback<T> { |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 318 | ctor public PositionalDataSource.LoadRangeCallback(); |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 319 | method public void onError(Throwable error); |
| 320 | method public abstract void onResult(java.util.List<? extends T> data); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 321 | } |
| 322 | |
Chris Craik | 557c882 | 2018-10-25 15:04:03 -0700 | [diff] [blame] | 323 | public static class PositionalDataSource.LoadRangeParams extends androidx.paging.ListenablePositionalDataSource.LoadRangeParams { |
Dustin Lam | b6bab3f | 2019-05-20 08:05:34 -0700 | [diff] [blame] | 324 | ctor public PositionalDataSource.LoadRangeParams(int startPosition, int loadSize); |
| 325 | } |
| 326 | |
| 327 | } |
| 328 | |
| 329 | package androidx.paging.futures { |
| 330 | |
| 331 | public final class Futures { |
| 332 | ctor public Futures(); |
Chris Craik | 7cb6041 | 2018-04-04 13:02:50 -0700 | [diff] [blame] | 333 | } |
| 334 | |
| 335 | } |
| 336 | |