Deprecate dataRefreshFlow
dataRefresh signals are redundant with REFRESH signals from loadState
with the inclusion of .peek() and .snapshot() that now provide a way to
access state of the presented list.
RelNote: "Deprecate dataRefresh Flow / Listener APIs as they were
intended to expose the presented items state on REFRESH, but it has been
made redundant with loadState Flow / Listener with the inclusion of the
.peek() and .snapshot() APIs"
Test: ./gradlew paging:paging-common:test
Test: ./gradlew paging:paging-runtime:cC
Change-Id: Ia19f3a4249e4f5586894d6702e998a2d9fb22eb0
diff --git a/paging/common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt b/paging/common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt
index 6747a92..d6ce2c5 100644
--- a/paging/common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt
+++ b/paging/common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt
@@ -285,6 +285,10 @@
* displayed. The [Boolean] that is emitted is `true` if the new [PagingData] is empty,
* `false` otherwise.
*/
+ @Deprecated(
+ "dataRefreshFlow is now redundant with the information passed from loadStateFlow," +
+ " peek, and snapshot APIs, and will be removed in a future alpha version"
+ )
@ExperimentalPagingApi
@OptIn(FlowPreview::class)
val dataRefreshFlow: Flow<Boolean> = _dataRefreshCh.asFlow()
@@ -293,6 +297,7 @@
@OptIn(ExperimentalCoroutinesApi::class)
addLoadStateListener { _loadStateCh.offer(it) }
@OptIn(ExperimentalCoroutinesApi::class, ExperimentalPagingApi::class)
+ @Suppress("DEPRECATION")
addDataRefreshListener { _dataRefreshCh.offer(it) }
}
@@ -334,6 +339,11 @@
*
* @see removeDataRefreshListener
*/
+ @Deprecated(
+ "dataRefreshListener is now redundant with the information passed from " +
+ "loadStateListener, peek, and snapshot APIs, and will be removed in a future " +
+ "alpha version"
+ )
@ExperimentalPagingApi
fun addDataRefreshListener(listener: (isEmpty: Boolean) -> Unit) {
dataRefreshedListeners.add(listener)
@@ -346,6 +356,11 @@
*
* @see addDataRefreshListener
*/
+ @Deprecated(
+ "dataRefreshListener is now redundant with the information passed from " +
+ "loadStateListener, peek, and snapshot APIs, and will be removed in a future " +
+ "alpha version"
+ )
@ExperimentalPagingApi
fun removeDataRefreshListener(listener: (isEmpty: Boolean) -> Unit) {
dataRefreshedListeners.remove(listener)
diff --git a/paging/common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt b/paging/common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt
index 74056b5..8deb6e6 100644
--- a/paging/common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt
+++ b/paging/common/src/test/kotlin/androidx/paging/PagingDataDifferTest.kt
@@ -178,6 +178,7 @@
// from affecting the expected events.
val listUpdates = mutableListOf<Boolean>()
val listUpdateJob = launch {
+ @Suppress("DEPRECATION")
differ.dataRefreshFlow.collect { listUpdates.add(it) }
}
@@ -207,6 +208,7 @@
// Start listening for ListUpdates before collecting from differ to prevent conflation
// from affecting the expected events.
val listUpdates = mutableListOf<Boolean>()
+ @Suppress("DEPRECATION")
differ.addDataRefreshListener { listUpdates.add(it) }
val job = launch {
diff --git a/paging/runtime/api/current.txt b/paging/runtime/api/current.txt
index 6b14453..21491b1 100644
--- a/paging/runtime/api/current.txt
+++ b/paging/runtime/api/current.txt
@@ -27,20 +27,20 @@
ctor public AsyncPagingDataDiffer(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback, androidx.recyclerview.widget.ListUpdateCallback updateCallback, kotlinx.coroutines.CoroutineDispatcher mainDispatcher, kotlinx.coroutines.CoroutineDispatcher workerDispatcher);
ctor public AsyncPagingDataDiffer(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback, androidx.recyclerview.widget.ListUpdateCallback updateCallback, kotlinx.coroutines.CoroutineDispatcher mainDispatcher);
ctor public AsyncPagingDataDiffer(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback, androidx.recyclerview.widget.ListUpdateCallback updateCallback);
- method @androidx.paging.ExperimentalPagingApi public void addDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
+ method @Deprecated @androidx.paging.ExperimentalPagingApi public void addDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
method public void addLoadStateListener(kotlin.jvm.functions.Function1<? super androidx.paging.CombinedLoadStates,kotlin.Unit> listener);
- method public kotlinx.coroutines.flow.Flow<java.lang.Boolean> getDataRefreshFlow();
+ method @Deprecated public kotlinx.coroutines.flow.Flow<java.lang.Boolean> getDataRefreshFlow();
method public T? getItem(@IntRange(from=0) int index);
method public int getItemCount();
method public kotlinx.coroutines.flow.Flow<androidx.paging.CombinedLoadStates> getLoadStateFlow();
method public T? peek(@IntRange(from=0) int index);
method public void refresh();
- method @androidx.paging.ExperimentalPagingApi public void removeDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
+ method @Deprecated @androidx.paging.ExperimentalPagingApi public void removeDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
method public void removeLoadStateListener(kotlin.jvm.functions.Function1<? super androidx.paging.CombinedLoadStates,kotlin.Unit> listener);
method public void retry();
method public suspend Object? submitData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method public void submitData(androidx.lifecycle.Lifecycle lifecycle, androidx.paging.PagingData<T> pagingData);
- property public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> dataRefreshFlow;
+ property @Deprecated public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> dataRefreshFlow;
property public final int itemCount;
property public final kotlinx.coroutines.flow.Flow<androidx.paging.CombinedLoadStates> loadStateFlow;
}
@@ -104,16 +104,16 @@
ctor public PagingDataAdapter(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback, kotlinx.coroutines.CoroutineDispatcher mainDispatcher, kotlinx.coroutines.CoroutineDispatcher workerDispatcher);
ctor public PagingDataAdapter(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback, kotlinx.coroutines.CoroutineDispatcher mainDispatcher);
ctor public PagingDataAdapter(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback);
- method @androidx.paging.ExperimentalPagingApi public final void addDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
+ method @Deprecated @androidx.paging.ExperimentalPagingApi public final void addDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
method public final void addLoadStateListener(kotlin.jvm.functions.Function1<? super androidx.paging.CombinedLoadStates,kotlin.Unit> listener);
- method public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> getDataRefreshFlow();
+ method @Deprecated public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> getDataRefreshFlow();
method protected final T? getItem(@IntRange(from=0) int position);
method public int getItemCount();
method public final long getItemId(int position);
method public final kotlinx.coroutines.flow.Flow<androidx.paging.CombinedLoadStates> getLoadStateFlow();
method public final T? peek(@IntRange(from=0) int index);
method public final void refresh();
- method @androidx.paging.ExperimentalPagingApi public final void removeDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
+ method @Deprecated @androidx.paging.ExperimentalPagingApi public final void removeDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
method public final void removeLoadStateListener(kotlin.jvm.functions.Function1<? super androidx.paging.CombinedLoadStates,kotlin.Unit> listener);
method public final void retry();
method public final suspend Object? submitData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
@@ -121,7 +121,7 @@
method public final androidx.recyclerview.widget.ConcatAdapter withLoadStateFooter(androidx.paging.LoadStateAdapter<?> footer);
method public final androidx.recyclerview.widget.ConcatAdapter withLoadStateHeader(androidx.paging.LoadStateAdapter<?> header);
method public final androidx.recyclerview.widget.ConcatAdapter withLoadStateHeaderAndFooter(androidx.paging.LoadStateAdapter<?> header, androidx.paging.LoadStateAdapter<?> footer);
- property public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> dataRefreshFlow;
+ property @Deprecated public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> dataRefreshFlow;
property public final kotlinx.coroutines.flow.Flow<androidx.paging.CombinedLoadStates> loadStateFlow;
}
diff --git a/paging/runtime/api/public_plus_experimental_current.txt b/paging/runtime/api/public_plus_experimental_current.txt
index 6b14453..21491b1 100644
--- a/paging/runtime/api/public_plus_experimental_current.txt
+++ b/paging/runtime/api/public_plus_experimental_current.txt
@@ -27,20 +27,20 @@
ctor public AsyncPagingDataDiffer(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback, androidx.recyclerview.widget.ListUpdateCallback updateCallback, kotlinx.coroutines.CoroutineDispatcher mainDispatcher, kotlinx.coroutines.CoroutineDispatcher workerDispatcher);
ctor public AsyncPagingDataDiffer(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback, androidx.recyclerview.widget.ListUpdateCallback updateCallback, kotlinx.coroutines.CoroutineDispatcher mainDispatcher);
ctor public AsyncPagingDataDiffer(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback, androidx.recyclerview.widget.ListUpdateCallback updateCallback);
- method @androidx.paging.ExperimentalPagingApi public void addDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
+ method @Deprecated @androidx.paging.ExperimentalPagingApi public void addDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
method public void addLoadStateListener(kotlin.jvm.functions.Function1<? super androidx.paging.CombinedLoadStates,kotlin.Unit> listener);
- method public kotlinx.coroutines.flow.Flow<java.lang.Boolean> getDataRefreshFlow();
+ method @Deprecated public kotlinx.coroutines.flow.Flow<java.lang.Boolean> getDataRefreshFlow();
method public T? getItem(@IntRange(from=0) int index);
method public int getItemCount();
method public kotlinx.coroutines.flow.Flow<androidx.paging.CombinedLoadStates> getLoadStateFlow();
method public T? peek(@IntRange(from=0) int index);
method public void refresh();
- method @androidx.paging.ExperimentalPagingApi public void removeDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
+ method @Deprecated @androidx.paging.ExperimentalPagingApi public void removeDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
method public void removeLoadStateListener(kotlin.jvm.functions.Function1<? super androidx.paging.CombinedLoadStates,kotlin.Unit> listener);
method public void retry();
method public suspend Object? submitData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method public void submitData(androidx.lifecycle.Lifecycle lifecycle, androidx.paging.PagingData<T> pagingData);
- property public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> dataRefreshFlow;
+ property @Deprecated public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> dataRefreshFlow;
property public final int itemCount;
property public final kotlinx.coroutines.flow.Flow<androidx.paging.CombinedLoadStates> loadStateFlow;
}
@@ -104,16 +104,16 @@
ctor public PagingDataAdapter(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback, kotlinx.coroutines.CoroutineDispatcher mainDispatcher, kotlinx.coroutines.CoroutineDispatcher workerDispatcher);
ctor public PagingDataAdapter(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback, kotlinx.coroutines.CoroutineDispatcher mainDispatcher);
ctor public PagingDataAdapter(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback);
- method @androidx.paging.ExperimentalPagingApi public final void addDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
+ method @Deprecated @androidx.paging.ExperimentalPagingApi public final void addDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
method public final void addLoadStateListener(kotlin.jvm.functions.Function1<? super androidx.paging.CombinedLoadStates,kotlin.Unit> listener);
- method public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> getDataRefreshFlow();
+ method @Deprecated public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> getDataRefreshFlow();
method protected final T? getItem(@IntRange(from=0) int position);
method public int getItemCount();
method public final long getItemId(int position);
method public final kotlinx.coroutines.flow.Flow<androidx.paging.CombinedLoadStates> getLoadStateFlow();
method public final T? peek(@IntRange(from=0) int index);
method public final void refresh();
- method @androidx.paging.ExperimentalPagingApi public final void removeDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
+ method @Deprecated @androidx.paging.ExperimentalPagingApi public final void removeDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
method public final void removeLoadStateListener(kotlin.jvm.functions.Function1<? super androidx.paging.CombinedLoadStates,kotlin.Unit> listener);
method public final void retry();
method public final suspend Object? submitData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
@@ -121,7 +121,7 @@
method public final androidx.recyclerview.widget.ConcatAdapter withLoadStateFooter(androidx.paging.LoadStateAdapter<?> footer);
method public final androidx.recyclerview.widget.ConcatAdapter withLoadStateHeader(androidx.paging.LoadStateAdapter<?> header);
method public final androidx.recyclerview.widget.ConcatAdapter withLoadStateHeaderAndFooter(androidx.paging.LoadStateAdapter<?> header, androidx.paging.LoadStateAdapter<?> footer);
- property public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> dataRefreshFlow;
+ property @Deprecated public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> dataRefreshFlow;
property public final kotlinx.coroutines.flow.Flow<androidx.paging.CombinedLoadStates> loadStateFlow;
}
diff --git a/paging/runtime/api/restricted_current.txt b/paging/runtime/api/restricted_current.txt
index 6b14453..21491b1 100644
--- a/paging/runtime/api/restricted_current.txt
+++ b/paging/runtime/api/restricted_current.txt
@@ -27,20 +27,20 @@
ctor public AsyncPagingDataDiffer(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback, androidx.recyclerview.widget.ListUpdateCallback updateCallback, kotlinx.coroutines.CoroutineDispatcher mainDispatcher, kotlinx.coroutines.CoroutineDispatcher workerDispatcher);
ctor public AsyncPagingDataDiffer(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback, androidx.recyclerview.widget.ListUpdateCallback updateCallback, kotlinx.coroutines.CoroutineDispatcher mainDispatcher);
ctor public AsyncPagingDataDiffer(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback, androidx.recyclerview.widget.ListUpdateCallback updateCallback);
- method @androidx.paging.ExperimentalPagingApi public void addDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
+ method @Deprecated @androidx.paging.ExperimentalPagingApi public void addDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
method public void addLoadStateListener(kotlin.jvm.functions.Function1<? super androidx.paging.CombinedLoadStates,kotlin.Unit> listener);
- method public kotlinx.coroutines.flow.Flow<java.lang.Boolean> getDataRefreshFlow();
+ method @Deprecated public kotlinx.coroutines.flow.Flow<java.lang.Boolean> getDataRefreshFlow();
method public T? getItem(@IntRange(from=0) int index);
method public int getItemCount();
method public kotlinx.coroutines.flow.Flow<androidx.paging.CombinedLoadStates> getLoadStateFlow();
method public T? peek(@IntRange(from=0) int index);
method public void refresh();
- method @androidx.paging.ExperimentalPagingApi public void removeDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
+ method @Deprecated @androidx.paging.ExperimentalPagingApi public void removeDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
method public void removeLoadStateListener(kotlin.jvm.functions.Function1<? super androidx.paging.CombinedLoadStates,kotlin.Unit> listener);
method public void retry();
method public suspend Object? submitData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
method public void submitData(androidx.lifecycle.Lifecycle lifecycle, androidx.paging.PagingData<T> pagingData);
- property public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> dataRefreshFlow;
+ property @Deprecated public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> dataRefreshFlow;
property public final int itemCount;
property public final kotlinx.coroutines.flow.Flow<androidx.paging.CombinedLoadStates> loadStateFlow;
}
@@ -104,16 +104,16 @@
ctor public PagingDataAdapter(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback, kotlinx.coroutines.CoroutineDispatcher mainDispatcher, kotlinx.coroutines.CoroutineDispatcher workerDispatcher);
ctor public PagingDataAdapter(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback, kotlinx.coroutines.CoroutineDispatcher mainDispatcher);
ctor public PagingDataAdapter(androidx.recyclerview.widget.DiffUtil.ItemCallback<T> diffCallback);
- method @androidx.paging.ExperimentalPagingApi public final void addDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
+ method @Deprecated @androidx.paging.ExperimentalPagingApi public final void addDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
method public final void addLoadStateListener(kotlin.jvm.functions.Function1<? super androidx.paging.CombinedLoadStates,kotlin.Unit> listener);
- method public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> getDataRefreshFlow();
+ method @Deprecated public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> getDataRefreshFlow();
method protected final T? getItem(@IntRange(from=0) int position);
method public int getItemCount();
method public final long getItemId(int position);
method public final kotlinx.coroutines.flow.Flow<androidx.paging.CombinedLoadStates> getLoadStateFlow();
method public final T? peek(@IntRange(from=0) int index);
method public final void refresh();
- method @androidx.paging.ExperimentalPagingApi public final void removeDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
+ method @Deprecated @androidx.paging.ExperimentalPagingApi public final void removeDataRefreshListener(kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> listener);
method public final void removeLoadStateListener(kotlin.jvm.functions.Function1<? super androidx.paging.CombinedLoadStates,kotlin.Unit> listener);
method public final void retry();
method public final suspend Object? submitData(androidx.paging.PagingData<T> pagingData, kotlin.coroutines.Continuation<? super kotlin.Unit> p);
@@ -121,7 +121,7 @@
method public final androidx.recyclerview.widget.ConcatAdapter withLoadStateFooter(androidx.paging.LoadStateAdapter<?> footer);
method public final androidx.recyclerview.widget.ConcatAdapter withLoadStateHeader(androidx.paging.LoadStateAdapter<?> header);
method public final androidx.recyclerview.widget.ConcatAdapter withLoadStateHeaderAndFooter(androidx.paging.LoadStateAdapter<?> header, androidx.paging.LoadStateAdapter<?> footer);
- property public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> dataRefreshFlow;
+ property @Deprecated public final kotlinx.coroutines.flow.Flow<java.lang.Boolean> dataRefreshFlow;
property public final kotlinx.coroutines.flow.Flow<androidx.paging.CombinedLoadStates> loadStateFlow;
}
diff --git a/paging/runtime/src/main/java/androidx/paging/AsyncPagingDataDiffer.kt b/paging/runtime/src/main/java/androidx/paging/AsyncPagingDataDiffer.kt
index 18020f3..b0a8d92 100644
--- a/paging/runtime/src/main/java/androidx/paging/AsyncPagingDataDiffer.kt
+++ b/paging/runtime/src/main/java/androidx/paging/AsyncPagingDataDiffer.kt
@@ -273,6 +273,11 @@
* displayed. The [Boolean] that is emitted is `true` if the new [PagingData] is empty,
* `false` otherwise.
*/
+ @Suppress("DEPRECATION")
+ @Deprecated(
+ "dataRefreshFlow is now redundant with the information passed from loadStateFlow," +
+ " peek, and snapshot APIs, and will be removed in a future alpha version"
+ )
@ExperimentalPagingApi
val dataRefreshFlow: Flow<Boolean> = differBase.dataRefreshFlow
@@ -284,8 +289,14 @@
*
* @see removeDataRefreshListener
*/
+ @Deprecated(
+ "dataRefreshListener is now redundant with the information passed from " +
+ "loadStateListener, peek, and snapshot APIs, and will be removed in a future " +
+ "alpha version"
+ )
@ExperimentalPagingApi
fun addDataRefreshListener(listener: (isEmpty: Boolean) -> Unit) {
+ @Suppress("DEPRECATION")
differBase.addDataRefreshListener(listener)
}
@@ -296,8 +307,14 @@
*
* @see addDataRefreshListener
*/
+ @Deprecated(
+ "dataRefreshListener is now redundant with the information passed from " +
+ "loadStateListener, peek, and snapshot APIs, and will be removed in a future " +
+ "alpha version"
+ )
@ExperimentalPagingApi
fun removeDataRefreshListener(listener: (isEmpty: Boolean) -> Unit) {
+ @Suppress("DEPRECATION")
differBase.removeDataRefreshListener(listener)
}
}
\ No newline at end of file
diff --git a/paging/runtime/src/main/java/androidx/paging/PagingDataAdapter.kt b/paging/runtime/src/main/java/androidx/paging/PagingDataAdapter.kt
index 6263a0b..d3fd466 100644
--- a/paging/runtime/src/main/java/androidx/paging/PagingDataAdapter.kt
+++ b/paging/runtime/src/main/java/androidx/paging/PagingDataAdapter.kt
@@ -265,6 +265,11 @@
* displayed. The [Boolean] that is emitted is `true` if the new [PagingData] is empty,
* `false` otherwise.
*/
+ @Suppress("DEPRECATION")
+ @Deprecated(
+ "dataRefreshFlow is now redundant with the information passed from loadStateFlow," +
+ " peek, and snapshot APIs, and will be removed in a future alpha version"
+ )
@ExperimentalPagingApi
val dataRefreshFlow: Flow<Boolean> = differ.dataRefreshFlow
@@ -276,8 +281,14 @@
*
* @see removeDataRefreshListener
*/
+ @Deprecated(
+ "dataRefreshListener is now redundant with the information passed from " +
+ "loadStateListener, peek, and snapshot APIs, and will be removed in a future " +
+ "alpha version"
+ )
@ExperimentalPagingApi
fun addDataRefreshListener(listener: (isEmpty: Boolean) -> Unit) {
+ @Suppress("DEPRECATION")
differ.addDataRefreshListener(listener)
}
@@ -288,8 +299,14 @@
*
* @see addDataRefreshListener
*/
+ @Deprecated(
+ "dataRefreshListener is now redundant with the information passed from " +
+ "loadStateListener, peek, and snapshot APIs, and will be removed in a future " +
+ "alpha version"
+ )
@ExperimentalPagingApi
fun removeDataRefreshListener(listener: (isEmpty: Boolean) -> Unit) {
+ @Suppress("DEPRECATION")
differ.removeDataRefreshListener(listener)
}
}