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