Methods Summary |
---|
public boolean | areMoreActionsEnabled()Returns true if secondary actions are enabled.
return mMoreActionsEnabled;
|
public void | enableSecondaryActions(boolean enable)Enables the display of secondary actions.
A "more actions" button will be displayed. When "more actions" is selected,
the primary actions are replaced with the secondary actions.
mMoreActionsEnabled = enable;
|
public void | enableTimeMargins(android.support.v17.leanback.widget.PlaybackControlsPresenter$ViewHolder vh, boolean enable)
MarginLayoutParams lp;
lp = (MarginLayoutParams) vh.mCurrentTime.getLayoutParams();
lp.setMarginStart(enable ? vh.mCurrentTimeMarginStart : 0);
vh.mCurrentTime.setLayoutParams(lp);
lp = (MarginLayoutParams) vh.mTotalTime.getLayoutParams();
lp.setMarginEnd(enable ? vh.mTotalTimeMarginEnd : 0);
vh.mTotalTime.setLayoutParams(lp);
|
private static void | formatTime(int seconds, java.lang.StringBuilder sb)
int minutes = seconds / 60;
int hours = minutes / 60;
seconds -= minutes * 60;
minutes -= hours * 60;
sb.setLength(0);
if (hours > 0) {
sb.append(hours).append(':");
if (minutes < 10) {
sb.append('0");
}
}
sb.append(minutes).append(':");
if (seconds < 10) {
sb.append('0");
}
sb.append(seconds);
|
int | getChildMarginBigger(android.content.Context context)
if (sChildMarginBigger == 0) {
sChildMarginBigger = context.getResources().getDimensionPixelSize(
R.dimen.lb_playback_controls_child_margin_bigger);
}
return sChildMarginBigger;
|
int | getChildMarginBiggest(android.content.Context context)
if (sChildMarginBiggest == 0) {
sChildMarginBiggest = context.getResources().getDimensionPixelSize(
R.dimen.lb_playback_controls_child_margin_biggest);
}
return sChildMarginBiggest;
|
public int | getCurrentTime(android.support.v17.leanback.widget.PlaybackControlsPresenter$ViewHolder vh)
return vh.getCurrentTime();
|
public int | getSecondaryProgress(android.support.v17.leanback.widget.PlaybackControlsPresenter$ViewHolder vh)
return vh.getSecondaryProgress();
|
public int | getTotalTime(android.support.v17.leanback.widget.PlaybackControlsPresenter$ViewHolder vh)
return vh.getTotalTime();
|
public void | onBindViewHolder(Presenter.ViewHolder holder, java.lang.Object item)
ViewHolder vh = (ViewHolder) holder;
BoundData data = (BoundData) item;
// If binding to a new adapter, display primary actions.
if (vh.mMoreActionsAdapter != data.secondaryActionsAdapter) {
vh.mMoreActionsAdapter = data.secondaryActionsAdapter;
vh.mMoreActionsAdapter.registerObserver(vh.mMoreActionsObserver);
vh.mMoreActionsShowing = false;
}
super.onBindViewHolder(holder, item);
vh.showMoreActions(mMoreActionsEnabled);
|
public Presenter.ViewHolder | onCreateViewHolder(android.view.ViewGroup parent)
View v = LayoutInflater.from(parent.getContext())
.inflate(getLayoutResourceId(), parent, false);
return new ViewHolder(v);
|
public void | onUnbindViewHolder(Presenter.ViewHolder holder)
super.onUnbindViewHolder(holder);
ViewHolder vh = (ViewHolder) holder;
vh.mMoreActionsAdapter.unregisterObserver(vh.mMoreActionsObserver);
vh.mMoreActionsAdapter = null;
|
public void | setCurrentTime(android.support.v17.leanback.widget.PlaybackControlsPresenter$ViewHolder vh, int ms)
vh.setCurrentTime(ms);
|
public void | setProgressColor(android.support.v17.leanback.widget.PlaybackControlsPresenter$ViewHolder vh, int color)
Drawable drawable = new ClipDrawable(new ColorDrawable(color),
Gravity.LEFT, ClipDrawable.HORIZONTAL);
((LayerDrawable) vh.mProgressBar.getProgressDrawable())
.setDrawableByLayerId(android.R.id.progress, drawable);
|
public void | setSecondaryProgress(android.support.v17.leanback.widget.PlaybackControlsPresenter$ViewHolder vh, int progressMs)
vh.setSecondaryProgress(progressMs);
|
public void | setTotalTime(android.support.v17.leanback.widget.PlaybackControlsPresenter$ViewHolder vh, int ms)
vh.setTotalTime(ms);
|
public void | showPrimaryActions(android.support.v17.leanback.widget.PlaybackControlsPresenter$ViewHolder vh)
if (vh.mMoreActionsShowing) {
vh.toggleMoreActions();
}
|