Methods Summary |
---|
protected static float | getFontDescent(android.widget.TextView textView, android.graphics.Paint fontMeasurePaint)
if (fontMeasurePaint.getTextSize() != textView.getTextSize()) {
fontMeasurePaint.setTextSize(textView.getTextSize());
}
if (fontMeasurePaint.getTypeface() != textView.getTypeface()) {
fontMeasurePaint.setTypeface(textView.getTypeface());
}
return fontMeasurePaint.descent();
|
public int | getSpaceUnderBaseline(android.support.v17.leanback.widget.RowHeaderPresenter$ViewHolder holder)Returns the space (distance in pixels) below the baseline of the
text view, if one exists; otherwise, returns 0.
int space = holder.view.getPaddingBottom();
if (holder.view instanceof TextView) {
space += (int) getFontDescent((TextView) holder.view, mFontMeasurePaint);
}
return space;
|
public void | onBindViewHolder(Presenter.ViewHolder viewHolder, java.lang.Object item)
setSelectLevel((ViewHolder) viewHolder, 0);
Row rowItem = (Row) item;
if (rowItem != null) {
HeaderItem headerItem = rowItem.getHeaderItem();
if (headerItem != null) {
String text = headerItem.getName();
((RowHeaderView) viewHolder.view).setText(text);
}
}
|
public Presenter.ViewHolder | onCreateViewHolder(android.view.ViewGroup parent)
RowHeaderView headerView = (RowHeaderView) LayoutInflater.from(parent.getContext())
.inflate(mLayoutResourceId, parent, false);
ViewHolder viewHolder = new ViewHolder(headerView);
viewHolder.mOriginalTextColor = headerView.getCurrentTextColor();
viewHolder.mUnselectAlpha = parent.getResources().getFraction(
R.fraction.lb_browse_header_unselect_alpha, 1, 1);
return viewHolder;
|
protected void | onSelectLevelChanged(android.support.v17.leanback.widget.RowHeaderPresenter$ViewHolder holder)
holder.view.setAlpha(holder.mUnselectAlpha + holder.mSelectLevel *
(1f - holder.mUnselectAlpha));
|
public void | onUnbindViewHolder(Presenter.ViewHolder viewHolder)
|
public final void | setSelectLevel(android.support.v17.leanback.widget.RowHeaderPresenter$ViewHolder holder, float selectLevel)
holder.mSelectLevel = selectLevel;
onSelectLevelChanged(holder);
|