RowHeaderPresenter
public class RowHeaderPresenter extends Presenter
RowHeaderPresenter provides a default presentation for HeaderItem using a RowHeaderView and optionally a TextView for description. If a subclass creates its own view, the subclass must also override onCreateViewHolder, onSelectLevelChanged.
Summary
Nested types |
|---|
public class RowHeaderPresenter.ViewHolder extends Presenter.ViewHolderA ViewHolder for the RowHeaderPresenter. |
Public constructors |
|---|
|
Creates default RowHeaderPresenter using a title view and a description view. |
Public methods |
|
|---|---|
int |
Returns the space (distance in pixels) below the baseline of the text view, if one exists; otherwise, returns 0. |
boolean |
Returns true if the view visibility is set to |
void |
onBindViewHolder(Binds a |
@NonNull Presenter.ViewHolder |
onCreateViewHolder(@NonNull ViewGroup parent)Creates a new |
void |
onUnbindViewHolder(@NonNull Presenter.ViewHolder viewHolder)Unbinds a |
void |
setNullItemVisibilityGone(boolean nullItemVisibilityGone)Optionally sets the view visibility to |
final void |
setSelectLevel(Sets the select level. |
Protected methods |
|
|---|---|
static float |
getFontDescent(@NonNull TextView textView, @NonNull Paint fontMeasurePaint) |
void |
Called when the select level changes. |
Inherited methods |
||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
RowHeaderPresenter
public RowHeaderPresenter()
Creates default RowHeaderPresenter using a title view and a description view.
| See also | |
|---|---|
RowHeaderPresenter.ViewHolder |
Public methods
getSpaceUnderBaseline
public int getSpaceUnderBaseline(@NonNull RowHeaderPresenter.ViewHolder holder)
Returns the space (distance in pixels) below the baseline of the text view, if one exists; otherwise, returns 0.
isNullItemVisibilityGone
public boolean isNullItemVisibilityGone()
Returns true if the view visibility is set to GONE when bound to null.
onBindViewHolder
public void onBindViewHolder(
@NonNull Presenter.ViewHolder viewHolder,
@Nullable Object item
)
Binds a View to an item.
onCreateViewHolder
public @NonNull Presenter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent)
Creates a new View.
onUnbindViewHolder
public void onUnbindViewHolder(@NonNull Presenter.ViewHolder viewHolder)
Unbinds a View from an item. Any expensive references may be released here, and any fields that are not bound for every item should be cleared here.
setNullItemVisibilityGone
public void setNullItemVisibilityGone(boolean nullItemVisibilityGone)
Optionally sets the view visibility to GONE when bound to null.
setSelectLevel
public final void setSelectLevel(
@NonNull RowHeaderPresenter.ViewHolder holder,
float selectLevel
)
Sets the select level.
Protected methods
getFontDescent
protected static float getFontDescent(@NonNull TextView textView, @NonNull Paint fontMeasurePaint)
onSelectLevelChanged
protected void onSelectLevelChanged(@NonNull RowHeaderPresenter.ViewHolder holder)
Called when the select level changes. The default implementation sets the alpha on the view.