epoxy-adapter / com.airbnb.epoxy

Package com.airbnb.epoxy

Types

AsyncEpoxyController

abstract class AsyncEpoxyController : EpoxyController

A subclass of EpoxyController that makes it easy to do model building and diffing in the background.

BaseEpoxyAdapter

abstract class BaseEpoxyAdapter : Adapter<EpoxyViewHolder!>, StickyHeaderCallbacks

BoundViewHolders

open class BoundViewHolders : MutableIterable<EpoxyViewHolder!>

Helper class for keeping track of EpoxyViewHolders that are currently bound.

Carousel

open class Carousel : EpoxyRecyclerView

This feature is in Beta - please report bugs, feature requests, or other feedback at https://github.com/airbnb/epoxy by creating a new issue. Thanks!

CarouselModel_

open class CarouselModel_ : EpoxyModel<Carousel!>, GeneratedModel<Carousel!>, CarouselModelBuilder
open class CarouselModel_ : EpoxyModel<Carousel!>, GeneratedModel<Carousel!>, CarouselModelBuilder

Generated file. Do not modify!

CarouselModelBuilder

interface CarouselModelBuilder
interface CarouselModelBuilder

ControllerHelper

abstract class ControllerHelper<T : EpoxyController!>

A helper class for EpoxyController to handle models. This is only implemented by the generated classes created the annotation processor.

DiffPayload

open class DiffPayload

A helper class for tracking changed models found by the com.airbnb.epoxy.DiffHelper to be included as a payload in the androidx.recyclerview.widget.RecyclerView.Adapter#notifyItemChanged(int, Object) call.

DiffResult

open class DiffResult

Wraps the result of AsyncEpoxyDiffer#submitList(List).

EpoxyAdapter

abstract class EpoxyAdapter : BaseEpoxyAdapter

Allows you to easily combine different view types in the same adapter, and handles view holder creation, binding, and ids for you. Subclasses just need to add their desired EpoxyModel objects and the rest is done automatically.

EpoxyAsyncUtil

class EpoxyAsyncUtil

Various helpers for running Epoxy operations off the main thread.

EpoxyController

abstract class EpoxyController : ModelCollector, StickyHeaderCallbacks

A controller for easily combining EpoxyModel instances in a RecyclerView.Adapter. Simply implement #buildModels() to declare which models should be used, and in which order. Call #requestModelBuild() whenever your data changes, and the controller will call #buildModels(), update the adapter with the new models, and notify any changes between the new and old models.

EpoxyControllerAdapter

class EpoxyControllerAdapter : BaseEpoxyAdapter, ResultCallback

EpoxyDiffLogger

open class EpoxyDiffLogger : AdapterDataObserver

This data observer can be registered with an Epoxy adapter or controller to log all item change events. This may be useful to use in debug builds in order to observe model updates and monitor for issues.

EpoxyDragCallback

interface EpoxyDragCallback<T : EpoxyModel<Any!>!> : BaseEpoxyTouchCallback<T>

For use with EpoxyModelTouchCallback

EpoxyHolder

abstract class EpoxyHolder

Used in conjunction with com.airbnb.epoxy.EpoxyModelWithHolder to provide a view holder pattern when binding to a model.

EpoxyItemSpacingDecorator

open class EpoxyItemSpacingDecorator : ItemDecoration

Modifies item spacing in a recycler view so that items are equally spaced no matter where they are on the grid. Only designed to work with standard linear or grid layout managers.

EpoxyModel

abstract class EpoxyModel<T : Any!>

Helper to bind data to a view using a builder style. The parameterized type should extend Android's View or EpoxyHolder.

EpoxyModelGroup

open class EpoxyModelGroup : EpoxyModelWithHolder<ModelGroupHolder!>

An EpoxyModel that contains other models, and allows you to combine those models in whatever view configuration you want.

EpoxyModelTouchCallback

abstract class EpoxyModelTouchCallback<T : EpoxyModel<Any!>!> : EpoxyTouchHelperCallback, EpoxyDragCallback<T>, EpoxySwipeCallback<T>

A wrapper around androidx.recyclerview.widget.ItemTouchHelper.Callback to enable easier touch support when working with Epoxy models.

EpoxyModelWithHolder

abstract class EpoxyModelWithHolder<T : EpoxyHolder!> : EpoxyModel<T>

A version of com.airbnb.epoxy.EpoxyModel that allows you to use a view holder pattern instead of a specific view when binding to your model.

EpoxyModelWithView

abstract class EpoxyModelWithView<T : View!> : EpoxyModel<T>

A model that allows its view to be built programmatically instead of by inflating a layout resource. Just implement #buildView so the adapter can create a new view for this model when needed.

EpoxyRecyclerView

open class EpoxyRecyclerView : RecyclerView

A RecyclerView implementation that makes for easier integration with Epoxy. The goal of this class is to reduce boilerplate in setting up a RecyclerView by applying common defaults. Additionally, several performance optimizations are made.

EpoxySwipeCallback

interface EpoxySwipeCallback<T : EpoxyModel<Any!>!> : BaseEpoxyTouchCallback<T>

For use with EpoxyModelTouchCallback

EpoxyTouchHelper

abstract class EpoxyTouchHelper

A simple way to set up drag or swipe interactions with Epoxy.

EpoxyTouchHelperCallback

abstract class EpoxyTouchHelperCallback : Callback

A wrapper around androidx.recyclerview.widget.ItemTouchHelper.Callback to cast all view holders to com.airbnb.epoxy.EpoxyViewHolder for simpler use with Epoxy.

EpoxyViewHolder

open class EpoxyViewHolder : ViewHolder

EpoxyVisibilityItem

class EpoxyVisibilityItem

This class represent an item in a android.view.ViewGroup and it is being reused with multiple model via the update method. There is 1:1 relationship between an EpoxyVisibilityItem and a child within the android.view.ViewGroup.

EpoxyVisibilityTracker

class EpoxyVisibilityTracker

A simple way to track visibility events on com.airbnb.epoxy.EpoxyModel.

GeneratedModel

interface GeneratedModel<T : Any!>

Interface applied to generated models to allow the base adapter to interact with them.

GroupModel

abstract class GroupModel : EpoxyModelGroup, ModelCollector

An EpoxyModelGroup usable in a DSL manner via the group extension.

GroupModel_

open class GroupModel_ : GroupModel, GeneratedModel<ModelGroupHolder!>, GroupModelBuilder
open class GroupModel_ : GroupModel, GeneratedModel<ModelGroupHolder!>, GroupModelBuilder

Generated file. Do not modify!

GroupModelBuilder

interface GroupModelBuilder : ModelCollector
interface GroupModelBuilder : ModelCollector

IdUtils

class IdUtils

Utilities for generating 64-bit long IDs from types such as CharSequence.

ListenersUtils

open class ListenersUtils

ModelCollector

interface ModelCollector

Interface used to collect models. Used by EpoxyController. It is also convenient to build DSL helpers for carousel: @link https://github.com/airbnb/epoxy/issues/847.

ModelGroupHolder

class ModelGroupHolder : EpoxyHolder

OnModelBoundListener

interface OnModelBoundListener<T : EpoxyModel<*>!, V : Any!>

Used to register an onBind callback with a generated model.

OnModelBuildFinishedListener

interface OnModelBuildFinishedListener

Used with EpoxyController#addModelBuildListener(OnModelBuildFinishedListener) to be alerted to new model changes.

OnModelCheckedChangeListener

interface OnModelCheckedChangeListener<T : EpoxyModel<*>!, V : Any!>

OnModelClickListener

interface OnModelClickListener<T : EpoxyModel<*>!, V : Any!>

Used to register a click listener on a generated model.

OnModelLongClickListener

interface OnModelLongClickListener<T : EpoxyModel<*>!, V : Any!>

OnModelUnboundListener

interface OnModelUnboundListener<T : EpoxyModel<*>!, V : Any!>

Used to register an onUnbind callback with a generated model.

OnModelVisibilityChangedListener

interface OnModelVisibilityChangedListener<T : EpoxyModel<V>!, V : Any!>

Used to register an onVisibilityChanged callback with a generated model.

OnModelVisibilityStateChangedListener

interface OnModelVisibilityStateChangedListener<T : EpoxyModel<V>!, V : Any!>

Used to register an onVisibilityChanged callback with a generated model.

QuantityStringResAttribute

open class QuantityStringResAttribute

SimpleEpoxyAdapter

open class SimpleEpoxyAdapter : EpoxyAdapter

A non-abstract version of com.airbnb.epoxy.EpoxyAdapter that exposes all methods and models as public. Use this if you don't want to create your own adapter subclass and instead want to modify the adapter from elsewhere, such as from an activity.

SimpleEpoxyController

open class SimpleEpoxyController : EpoxyController

A small wrapper around com.airbnb.epoxy.EpoxyController that lets you set a list of models directly.

SimpleEpoxyModel

open class SimpleEpoxyModel : EpoxyModel<View!>

Helper class for cases where you don't need to do anything special when binding the view. This allows you to just provide the layout instead of needing to create a separate EpoxyModel subclass. This is useful for static layouts. You can also specify an onClick listener and the span size.

StringAttributeData

open class StringAttributeData

StyleBuilderCallback

interface StyleBuilderCallback<T : Any!>

Used for specifying dynamic styling for a view when creating a model. This is only used if the view is set up to be styled with the Paris library.

Typed2EpoxyController

abstract class Typed2EpoxyController<T : Any!, U : Any!> : EpoxyController

This is a wrapper around com.airbnb.epoxy.EpoxyController to simplify how data is accessed. Use this if the data required to build your models is represented by two objects.

Typed3EpoxyController

abstract class Typed3EpoxyController<T : Any!, U : Any!, V : Any!> : EpoxyController

This is a wrapper around com.airbnb.epoxy.EpoxyController to simplify how data is accessed. Use this if the data required to build your models is represented by three objects.

Typed4EpoxyController

abstract class Typed4EpoxyController<T : Any!, U : Any!, V : Any!, W : Any!> : EpoxyController

This is a wrapper around com.airbnb.epoxy.EpoxyController to simplify how data is accessed. Use this if the data required to build your models is represented by four objects.

TypedEpoxyController

abstract class TypedEpoxyController<T : Any!> : EpoxyController

This is a wrapper around com.airbnb.epoxy.EpoxyController to simplify how data is accessed. Use this if the data required to build your models is represented by a single object.

VisibilityState

class VisibilityState

WrappedEpoxyModelCheckedChangeListener

open class WrappedEpoxyModelCheckedChangeListener<T : EpoxyModel<*>!, V : Any!> : OnCheckedChangeListener

Used in the generated models to transform normal checked change listener to model checked change.

WrappedEpoxyModelClickListener

class WrappedEpoxyModelClickListener<T : EpoxyModel<*>, V> : OnClickListener, OnLongClickListener

Used in the generated models to transform normal view click listeners to model click listeners.

Exceptions

IllegalEpoxyUsage

open class IllegalEpoxyUsage : RuntimeException

Functions

carousel

fun ModelCollector.carousel(modelInitializer: CarouselModelBuilder.() -> Unit): Unit

group

fun ModelCollector.group(modelInitializer: GroupModelBuilder.() -> Unit): Unit
fun ModelCollector.group(layoutRes: Int, modelInitializer: GroupModelBuilder.() -> Unit): Unit