# AsyncPagedListDiffer

Artifact: [androidx.paging:paging-runtime](https://developer.android.com/jetpack/androidx/releases/paging) [View Source](https://cs.android.com/search?q=file:androidx/paging/AsyncPagedListDiffer.kt+class:androidx.paging.AsyncPagedListDiffer) Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOSJavaScript
- android

  ```
  open class AsyncPagedListDiffer<T : Any>
  ```

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer, use this instead:
>
> ```kotlin
> AsyncPagingDataDiffer<T>
> ```

Helper object for mapping a `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` into a `https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter`.

For simplicity, the `https://developer.android.com/reference/kotlin/androidx/paging/PagedListAdapter` wrapper class can often be used instead of the differ directly. This diff class is exposed for complex cases, and where overriding an adapter base class to support paging isn't convenient.

When consuming a `https://developer.android.com/reference/kotlin/androidx/lifecycle/LiveData` of PagedList, you can observe updates and dispatch them directly to `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#submitList(androidx.paging.PagedList)`. The AsyncPagedListDiffer then can present this updating data set simply for an adapter. It listens to PagedList loading callbacks, and uses DiffUtil on a background thread to compute updates as new PagedLists are received.

It provides a simple list-like API with `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#getItem(kotlin.Int)` and `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#itemCount()` for an adapter to acquire and present data objects.

A complete usage pattern with Room would look like this:

```kotlin
@Dao
interface UserDao {
    @Query("SELECT * FROM user ORDER BY lastName ASC")
    public abstract DataSource.Factory<Integer, User> usersByLastName();
}

class MyViewModel extends ViewModel {
    public final LiveData<PagedList<User>> usersList;
    public MyViewModel(UserDao userDao) {
        usersList = new LivePagedListBuilder<>(
        userDao.usersByLastName(), /* page size */20).build();
    }
}

class MyActivity extends AppCompatActivity {
    @Override
    public void onCreate(Bundle savedState) {
        super.onCreate(savedState);
        MyViewModel viewModel = new ViewModelProvider(this).get(MyViewModel.class);
        RecyclerView recyclerView = findViewById(R.id.user_list);
        final UserAdapter adapter = new UserAdapter();
        viewModel.usersList.observe(this, pagedList -> adapter.submitList(pagedList));
        recyclerView.setAdapter(adapter);
    }
}

class UserAdapter extends RecyclerView.Adapter&lt;UserViewHolder> {
    private final AsyncPagedListDiffer&lt;User> differ =
            new AsyncPagedListDiffer(this, DIFF_CALLBACK);
    @Override
    public int getItemCount() {
        return differ.getItemCount();
    }
    public void submitList(PagedList&lt;User> pagedList) {
        differ.submitList(pagedList);
    }
    @Override
    public void onBindViewHolder(UserViewHolder holder, int position) {
        User user = differ.getItem(position);
        if (user != null) {
            holder.bindTo(user);
        } else {
            // Null defines a placeholder item - AsyncPagedListDiffer will automatically
            // invalidate this row when the actual object is loaded from the database
            holder.clear();
        }
    }
    public static final DiffUtil.ItemCallback&lt;User> DIFF_CALLBACK =
            new DiffUtil.ItemCallback&lt;User>() {
        @Override
        public boolean areItemsTheSame(
            @NonNull User oldUser, @NonNull User newUser) {
            // User properties may have changed if reloaded from the DB, but ID is fixed
            return oldUser.getId() == newUser.getId();
        }
        @Override
        public boolean areContentsTheSame(@NonNull User oldUser, @NonNull User newUser) {
            // NOTE: if you use equals, your object must properly override Object#equals()
            // Incorrectly returning false here will result in too many animations.
            return oldUser.equals(newUser);
        }
    }
}
```

| Parameters |
|---|---|
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | Type of the PagedLists this differ will receive. |

## Summary

| ### Nested types |
|---|
| `interface https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer.PagedListListener<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` **This interface is deprecated.** PagedList is deprecated and has been replaced by PagingData |

| ### Public constructors |
|---|---|
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> [AsyncPagedListDiffer](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#AsyncPagedListDiffer(androidx.recyclerview.widget.RecyclerView.Adapter,androidx.recyclerview.widget.DiffUtil.ItemCallback))( adapter: https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter<*>, diffCallback: https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/DiffUtil.ItemCallback<T> )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> [AsyncPagedListDiffer](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#AsyncPagedListDiffer(androidx.recyclerview.widget.ListUpdateCallback,androidx.recyclerview.widget.AsyncDifferConfig))( listUpdateCallback: https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ListUpdateCallback, config: https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/AsyncDifferConfig<T> )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |

| ### Public functions |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[addLoadStateListener](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#addLoadStateListener(kotlin.Function2))(listener: (https://developer.android.com/reference/kotlin/androidx/paging/LoadType, https://developer.android.com/reference/kotlin/androidx/paging/LoadState) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` **This function is deprecated.** AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[addPagedListListener](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#addPagedListListener(kotlin.Function2))(callback: (https://developer.android.com/reference/kotlin/androidx/paging/PagedList<T>?, https://developer.android.com/reference/kotlin/androidx/paging/PagedList<T>?) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` **This function is deprecated.** AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[addPagedListListener](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#addPagedListListener(androidx.paging.AsyncPagedListDiffer.PagedListListener))( listener: https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer.PagedListListener<T> )` **This function is deprecated.** AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer | android |
| `open T?` | `[getItem](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#getItem(kotlin.Int))(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[removeLoadStateListener](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#removeLoadStateListener(kotlin.Function2))(listener: (https://developer.android.com/reference/kotlin/androidx/paging/LoadType, https://developer.android.com/reference/kotlin/androidx/paging/LoadState) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` **This function is deprecated.** AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[removePagedListListener](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#removePagedListListener(kotlin.Function2))(callback: (https://developer.android.com/reference/kotlin/androidx/paging/PagedList<T>?, https://developer.android.com/reference/kotlin/androidx/paging/PagedList<T>?) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` **This function is deprecated.** AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[removePagedListListener](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#removePagedListListener(androidx.paging.AsyncPagedListDiffer.PagedListListener))( listener: https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer.PagedListListener<T> )` **This function is deprecated.** AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[submitList](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#submitList(androidx.paging.PagedList))(pagedList: https://developer.android.com/reference/kotlin/androidx/paging/PagedList<T>?)` **This function is deprecated.** AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[submitList](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#submitList(androidx.paging.PagedList,java.lang.Runnable))(pagedList: https://developer.android.com/reference/kotlin/androidx/paging/PagedList<T>?, commitCallback: https://developer.android.com/reference/java/lang/Runnable.html?)` **This function is deprecated.** AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer | android |

| ### Public properties |
|---|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/paging/PagedList<T>?` | `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#currentList()` **This property is deprecated.** AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#itemCount()` **This property is deprecated.** AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer | android |

## Public constructors

### AsyncPagedListDiffer

android

```
<T : Any> [AsyncPagedListDiffer](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#AsyncPagedListDiffer(androidx.recyclerview.widget.RecyclerView.Adapter,androidx.recyclerview.widget.DiffUtil.ItemCallback))(
    adapter: RecyclerView.Adapter<*>,
    diffCallback: DiffUtil.ItemCallback<T>
)
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```kotlin
> AsyncPagingDataDiffer(
>                 Dispatchers.Main,
>                 Dispatchers.IO,
>                 diffCallback,
>                 listUpdateCallback
>             )
> ```

Convenience for

```kotlin
AsyncPagedListDiffer(
    AdapterListUpdateCallback(adapter),
    AsyncDifferConfig.Builder<T>(diffCallback).build()
)
```

| Parameters |
|---|---|
| `adapter: https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter<*>` | Adapter that will receive update signals. |
| `diffCallback: https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/DiffUtil.ItemCallback<T>` | The `https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/DiffUtil.ItemCallback` instance to compare items in the list. |

### AsyncPagedListDiffer

android

```
<T : Any> [AsyncPagedListDiffer](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#AsyncPagedListDiffer(androidx.recyclerview.widget.ListUpdateCallback,androidx.recyclerview.widget.AsyncDifferConfig))(
    listUpdateCallback: ListUpdateCallback,
    config: AsyncDifferConfig<T>
)
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```kotlin
> AsyncPagingDataDiffer(
>                 Dispatchers.Main,
>                 Dispatchers.IO,
>                 config.diffCallback,
>                 listUpdateCallback
>             )
> ```

## Public functions

### addLoadStateListener

android Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
open fun [addLoadStateListener](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#addLoadStateListener(kotlin.Function2))(listener: (LoadType, LoadState) -> Unit): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer, use this instead:
>
> ```kotlin
> AsyncPagingDataDiffer<T>
> ```

Add a `https://developer.android.com/reference/kotlin/androidx/paging/LoadState` listener to observe the loading state of the current `https://developer.android.com/reference/kotlin/androidx/paging/PagedList`.

As new PagedLists are submitted and displayed, the listener will be notified to reflect current `https://developer.android.com/reference/kotlin/androidx/paging/LoadType#REFRESH`, `https://developer.android.com/reference/kotlin/androidx/paging/LoadType#PREPEND`, and `https://developer.android.com/reference/kotlin/androidx/paging/LoadType#APPEND` states.

| Parameters |
|---|---|
| `listener: (https://developer.android.com/reference/kotlin/androidx/paging/LoadType, https://developer.android.com/reference/kotlin/androidx/paging/LoadState) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/paging/LoadState` listener to receive updates. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#removeLoadStateListener(kotlin.Function2)` |   |

### addPagedListListener

android Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
fun [addPagedListListener](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#addPagedListListener(kotlin.Function2))(callback: (PagedList<T>?, PagedList<T>?) -> Unit): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer, use this instead:
>
> ```kotlin
> AsyncPagingDataDiffer<T>
> ```

Add a callback to receive updates when the current `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` changes.

| Parameters |
|---|---|
| `callback: (https://developer.android.com/reference/kotlin/androidx/paging/PagedList<T>?, https://developer.android.com/reference/kotlin/androidx/paging/PagedList<T>?) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | to receive updates. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#currentList()` |   |
| `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#removePagedListListener(androidx.paging.AsyncPagedListDiffer.PagedListListener)` |   |

### addPagedListListener

android Added in [2.1.0](https://developer.android.com/jetpack/androidx/releases/paging#2.1.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
open fun [addPagedListListener](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#addPagedListListener(androidx.paging.AsyncPagedListDiffer.PagedListListener))(
    listener: AsyncPagedListDiffer.PagedListListener<T>
): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer, use this instead:
>
> ```kotlin
> AsyncPagingDataDiffer<T>
> ```

Add a `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer.PagedListListener` to receive updates when the current `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` changes.

| Parameters |
|---|---|
| `listener: https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer.PagedListListener<T>` | Listener to receive updates. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#currentList()` |   |
| `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#removePagedListListener(androidx.paging.AsyncPagedListDiffer.PagedListListener)` |   |

### getItem

android Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
open fun [getItem](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#getItem(kotlin.Int))(index: Int): T?
```

> [!CAUTION]
> **This function is deprecated.**   
> AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer, use this instead:
>
> ```kotlin
> AsyncPagingDataDiffer<T>
> ```

Get the item from the current PagedList at the specified index.

Note that this operates on both loaded items and null padding within the PagedList.

| Parameters |
|---|---|
| `index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Index of item to get, must be \>= 0, and \<`getItemCount`. |

| Returns |
|---|---|
| `T?` | The item, or null, if a null placeholder is at the specified position. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-index-out-of-bounds-exception/index.html` | if `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#itemCount()` is 0. |

### removeLoadStateListener

android Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
open fun [removeLoadStateListener](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#removeLoadStateListener(kotlin.Function2))(listener: (LoadType, LoadState) -> Unit): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer, use this instead:
>
> ```kotlin
> AsyncPagingDataDiffer<T>
> ```

Remove a previously registered `https://developer.android.com/reference/kotlin/androidx/paging/LoadState` listener.

| Parameters |
|---|---|
| `listener: (https://developer.android.com/reference/kotlin/androidx/paging/LoadType, https://developer.android.com/reference/kotlin/androidx/paging/LoadState) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | Previously registered listener. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#currentList()` |   |
| `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#addPagedListListener(androidx.paging.AsyncPagedListDiffer.PagedListListener)` |   |

### removePagedListListener

android Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
fun [removePagedListListener](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#removePagedListListener(kotlin.Function2))(callback: (PagedList<T>?, PagedList<T>?) -> Unit): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer, use this instead:
>
> ```kotlin
> AsyncPagingDataDiffer<T>
> ```

Remove a previously registered callback via `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#addPagedListListener(androidx.paging.AsyncPagedListDiffer.PagedListListener)`.

| Parameters |
|---|---|
| `callback: (https://developer.android.com/reference/kotlin/androidx/paging/PagedList<T>?, https://developer.android.com/reference/kotlin/androidx/paging/PagedList<T>?) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | Previously registered callback. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#currentList()` |   |
| `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#addPagedListListener(androidx.paging.AsyncPagedListDiffer.PagedListListener)` |   |

### removePagedListListener

android Added in [2.1.0](https://developer.android.com/jetpack/androidx/releases/paging#2.1.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
open fun [removePagedListListener](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#removePagedListListener(androidx.paging.AsyncPagedListDiffer.PagedListListener))(
    listener: AsyncPagedListDiffer.PagedListListener<T>
): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer, use this instead:
>
> ```kotlin
> AsyncPagingDataDiffer<T>
> ```

Remove a previously registered `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer.PagedListListener`.

| Parameters |
|---|---|
| `listener: https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer.PagedListListener<T>` | Previously registered listener. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#currentList()` |   |
| `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#addPagedListListener(androidx.paging.AsyncPagedListDiffer.PagedListListener)` |   |

### submitList

android Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
open fun [submitList](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#submitList(androidx.paging.PagedList))(pagedList: PagedList<T>?): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer, use this instead:
>
> ```kotlin
> AsyncPagingDataDiffer<T>
> ```

Pass a new `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` to the differ.

If a PagedList is already present, a diff will be computed asynchronously on a background thread. When the diff is computed, it will be applied (dispatched to the `https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ListUpdateCallback`), and the new PagedList will be swapped in as the `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#currentList()`.

| Parameters |
|---|---|
| `pagedList: https://developer.android.com/reference/kotlin/androidx/paging/PagedList<T>?` | The new PagedList. |

### submitList

android Added in [2.1.0](https://developer.android.com/jetpack/androidx/releases/paging#2.1.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
open fun [submitList](https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#submitList(androidx.paging.PagedList,java.lang.Runnable))(pagedList: PagedList<T>?, commitCallback: Runnable?): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer, use this instead:
>
> ```kotlin
> AsyncPagingDataDiffer<T>
> ```

Pass a new PagedList to the differ.

If a PagedList is already present, a diff will be computed asynchronously on a background thread. When the diff is computed, it will be applied (dispatched to the `https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/ListUpdateCallback`), and the new PagedList will be swapped in as the `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#currentList()`.

The commit callback can be used to know when the PagedList is committed, but note that it may not be executed. If PagedList B is submitted immediately after PagedList A, and is committed directly, the callback associated with PagedList A will not be run.

| Parameters |
|---|---|
| `pagedList: https://developer.android.com/reference/kotlin/androidx/paging/PagedList<T>?` | The new `https://developer.android.com/reference/kotlin/androidx/paging/PagedList`. |
| `commitCallback: https://developer.android.com/reference/java/lang/Runnable.html?` | Optional runnable that is executed when the PagedList is committed, if it is committed. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if previous PagedList wasn't snapshotted correctly. |

## Public properties

### currentList

android Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
open val currentList: PagedList<T>?
```

> [!CAUTION]
> **This property is deprecated.**   
> AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer, use this instead:
>
> ```kotlin
> AsyncPagingDataDiffer<T>
> ```

Returns the PagedList currently being displayed by the differ.

This is not necessarily the most recent list passed to `https://developer.android.com/reference/kotlin/androidx/paging/AsyncPagedListDiffer#submitList(androidx.paging.PagedList)`, because a diff is computed asynchronously between the new list and the current list before updating the currentList value. May be `null` if no `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` is being presented.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/PagedList<T>?` | The list currently being displayed, may be `null`. |

### itemCount

android Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
open val itemCount: Int
```

> [!CAUTION]
> **This property is deprecated.**   
> AsyncPagedListDiffer is deprecated and has been replaced by AsyncPagingDataDiffer, use this instead:
>
> ```kotlin
> AsyncPagingDataDiffer<T>
> ```

Get the number of items currently presented by this Differ. This value can be directly returned to `https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter#getItemCount()`.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Number of items being presented. |