public abstract class SnappyAdapter<VH extends RecyclerView.ViewHolder>
extends <any>
| Modifier and Type | Class and Description |
|---|---|
static interface |
SnappyAdapter.Callback |
static interface |
SnappyAdapter.Snapper |
| Modifier and Type | Field and Description |
|---|---|
protected SnappyAdapter.Snapper |
snapper |
| Constructor and Description |
|---|
SnappyAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
onBindViewHolder(VH vh,
int i) |
protected abstract void |
onBindViewHolder(VH vh,
int position,
boolean isAtTheCenter)
Similar to onBindViewHolder(@NonNull VH vh, int position)
If centered item is different from the other, layout of the item should be binded with
respect of @param isAtTheCenter
provides with @param isAtTheCenter only if enableSnapListener of recyclerview had been called,
otherwise isAtTheCenter will always be false
|
protected abstract void |
onSnapedFromCenter(VH vh)
Notifies when the item that had been at the center moved.
|
void |
setCallback(SnappyAdapter.Callback callback) |
protected SnappyAdapter.Snapper snapper
public final void setCallback(SnappyAdapter.Callback callback)
public final void onBindViewHolder(VH vh, int i)
protected abstract void onBindViewHolder(VH vh, int position, boolean isAtTheCenter)
provides with @param isAtTheCenter only if enableSnapListener of recyclerview had been called, otherwise isAtTheCenter will always be false
isAtTheCenter - true if item is at the centerprotected abstract void onSnapedFromCenter(VH vh)
fires only if enableSnapListener of recyclerview had been called