T
- the type parameterK
- the type parameterQ
- the type parameterpublic abstract class PaymentOptionsBaseViewHolder<T,K extends PaymentOptionsBaseViewHolder<T,K,Q>,Q extends PaymentOptionViewModel<T,K,Q>>
extends android.support.v7.widget.RecyclerView.ViewHolder
Modifier and Type | Class and Description |
---|---|
static class |
PaymentOptionsBaseViewHolder.ViewHolderType
The enum View holder type.
|
Modifier and Type | Field and Description |
---|---|
(package private) Q |
viewModel
The View model.
|
Constructor and Description |
---|
PaymentOptionsBaseViewHolder(android.view.View itemView)
Instantiates a new Payment options base view holder.
|
Modifier and Type | Method and Description |
---|---|
void |
attachToViewModel(Q viewModel,
int position)
Attach to view model.
|
abstract void |
bind(T data)
Bind.
|
void |
detachFromViewModel()
Detach from view model.
|
static PaymentOptionsBaseViewHolder |
newInstance(android.view.ViewGroup parent,
PaymentOptionsBaseViewHolder.ViewHolderType viewHolderType)
New instance payment options base view holder.
|
void |
restoreState(android.os.Parcelable state)
Restore state.
|
android.os.Parcelable |
saveState()
Save state parcelable.
|
void |
setFocused(boolean isFocused)
Sets focused.
|
void |
unbind()
Unbind.
|
Q extends PaymentOptionViewModel<T,K,Q> viewModel
PaymentOptionsBaseViewHolder(android.view.View itemView)
itemView
- the item viewpublic static PaymentOptionsBaseViewHolder newInstance(android.view.ViewGroup parent, @NonNull PaymentOptionsBaseViewHolder.ViewHolderType viewHolderType)
parent
- the parentviewHolderType
- the view holder typepublic final void attachToViewModel(Q viewModel, int position)
viewModel
- the view modelposition
- the positionpublic final void detachFromViewModel()
public abstract void bind(T data)
data
- the datapublic final void unbind()
public void setFocused(boolean isFocused)
isFocused
- the is focusedpublic android.os.Parcelable saveState()
public void restoreState(android.os.Parcelable state)
state
- the state