public abstract class DocumentHolder extends RecyclerView.ViewHolder implements View.OnKeyListener
Modifier and Type | Field and Description |
---|---|
String |
modelId |
itemView
Constructor and Description |
---|
DocumentHolder(Context context,
View item) |
DocumentHolder(Context context,
ViewGroup parent,
int layout) |
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(com.android.documentsui.dirlist.DocumentHolder.EventListener listener) |
void |
addOnKeyListener(View.OnKeyListener listener) |
abstract void |
bind(Cursor cursor,
String modelId,
State state)
Binds the view to the given item data.
|
boolean |
onKey(View v,
int keyCode,
KeyEvent event)
Called when a hardware key is dispatched to a view.
|
boolean |
onSingleTapUp(MotionEvent event) |
void |
setEnabled(boolean enabled) |
void |
setHighlighted(boolean highlighted)
Highlights the associated item view.
|
void |
setSelected(boolean selected,
boolean animate)
Makes the associated item view appear selected.
|
getAdapterPosition, getItemId, getItemViewType, getLayoutPosition, getOldPosition, getPosition, isRecyclable, setIsRecyclable, toString
public abstract void bind(Cursor cursor, String modelId, State state)
cursor
- modelId
- state
- public void setSelected(boolean selected, boolean animate)
selected
- animate
- Whether or not to animate the change. Only selection changes initiated by the
selection manager should be animated. See
ModelBackedDocumentsAdapter.onBindViewHolder(DocumentHolder, int, java.util.List)
public void setHighlighted(boolean highlighted)
highlighted
- public void setEnabled(boolean enabled)
public boolean onKey(View v, int keyCode, KeyEvent event)
View.OnKeyListener
Key presses in software keyboards will generally NOT trigger this method, although some may elect to do so in some situations. Do not assume a software input method has to be key-based; even if it is, it may use key presses in a different way than you expect, so there is no way to reliably catch soft input key presses.
onKey
in interface View.OnKeyListener
v
- The view the key has been dispatched to.keyCode
- The code for the physical key that was pressedevent
- The KeyEvent object containing full information about
the event.public void addEventListener(com.android.documentsui.dirlist.DocumentHolder.EventListener listener)
public void addOnKeyListener(View.OnKeyListener listener)
public boolean onSingleTapUp(MotionEvent event)