-
public final class AsyncDifferConfig.Builder<T>
Builder class for AsyncDifferConfig.
-
-
Constructor Summary
Constructors Constructor Description AsyncDifferConfig.Builder(DiffUtil.ItemCallback<T> diffCallback)
-
Method Summary
Modifier and Type Method Description AsyncDifferConfig.Builder<T>
setMainThreadExecutor(Executor executor)
If provided, defines the main thread executor used to dispatch adapter updatenotifications on the main thread. AsyncDifferConfig.Builder<T>
setBackgroundThreadExecutor(Executor executor)
If provided, defines the background executor used to calculate the diff between an oldand a new list. AsyncDifferConfig<T>
build()
Creates a AsyncListDiffer with the given parameters. -
-
Constructor Detail
-
AsyncDifferConfig.Builder
AsyncDifferConfig.Builder(DiffUtil.ItemCallback<T> diffCallback)
-
-
Method Detail
-
setMainThreadExecutor
@NonNull() AsyncDifferConfig.Builder<T> setMainThreadExecutor(Executor executor)
If provided, defines the main thread executor used to dispatch adapter updatenotifications on the main thread.
If not provided, it will default to the main thread.
- Parameters:
executor
- The executor which can run tasks in the UI thread.
-
setBackgroundThreadExecutor
@NonNull() AsyncDifferConfig.Builder<T> setBackgroundThreadExecutor(Executor executor)
If provided, defines the background executor used to calculate the diff between an oldand a new list.
If not provided, defaults to two thread pool executor, shared by all ListAdapterConfigs.
- Parameters:
executor
- The background executor to run list diffing.
-
build
@NonNull() AsyncDifferConfig<T> build()
Creates a AsyncListDiffer with the given parameters.
-
-
-
-