-
public interface GeneratedModel<T>Interface applied to generated models to allow the base adapter to interact with them.
-
-
Method Summary
Modifier and Type Method Description abstract voidhandlePreBind(EpoxyViewHolder holder, T objectToBind, int position)Called on the generated model immediately before the main model onBind method has been called. abstract voidhandlePostBind(T objectToBind, int position)Called on the generated model immediately after the main model onBind method has been called.This let's the generated model handle binding of its own and dispatch calls to its onBindlistener. -
-
Method Detail
-
handlePreBind
abstract void handlePreBind(EpoxyViewHolder holder, T objectToBind, int position)
Called on the generated model immediately before the main model onBind method has been called.This let's the generated model handle binding setup of its own
The ViewHolder is needed to get the model's adapter position when clicked.
-
handlePostBind
abstract void handlePostBind(T objectToBind, int position)
Called on the generated model immediately after the main model onBind method has been called.This let's the generated model handle binding of its own and dispatch calls to its onBindlistener.
We don't want to rely on the main onBind method to dispatch the onBind listener call becausethere are two onBind methods (one for payloads and one for no payloads), and one can call intothe other. We don't want to dispatch two onBind listener calls in that case.
-
-
-
-