本文整理汇总了Java中android.support.v17.leanback.widget.OnActionClickedListener类的典型用法代码示例。如果您正苦于以下问题:Java OnActionClickedListener类的具体用法?Java OnActionClickedListener怎么用?Java OnActionClickedListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OnActionClickedListener类属于android.support.v17.leanback.widget包,在下文中一共展示了OnActionClickedListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupDetailsOverviewRowPresenter
import android.support.v17.leanback.widget.OnActionClickedListener; //导入依赖的package包/类
private void setupDetailsOverviewRowPresenter() {
// Set detail background and style.
DetailsOverviewRowPresenter detailsPresenter =
new DetailsOverviewRowPresenter(new DetailsDescriptionPresenter());
detailsPresenter.setBackgroundColor(getResources().getColor(R.color.selected_background));
detailsPresenter.setStyleLarge(true);
// Hook up transition element.
detailsPresenter.setSharedElementEnterTransition(getActivity(),
DetailsActivity.SHARED_ELEMENT_NAME);
detailsPresenter.setOnActionClickedListener(new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
if (action.getId() == ACTION_WATCH_TRAILER) {
Intent intent = new Intent(getActivity(), PlaybackOverlayActivity.class);
intent.putExtra(DetailsActivity.MOVIE, mSelectedMovie);
startActivity(intent);
} else {
Toast.makeText(getActivity(), action.toString(), Toast.LENGTH_SHORT).show();
}
}
});
mPresenterSelector.addClassPresenter(DetailsOverviewRow.class, detailsPresenter);
}
示例2: createControlsRowAndPresenter
import android.support.v17.leanback.widget.OnActionClickedListener; //导入依赖的package包/类
@Override
public PlaybackControlsRowPresenter createControlsRowAndPresenter() {
PlaybackControlsRowPresenter presenter = super.createControlsRowAndPresenter();
adapter = new ArrayObjectAdapter(new ControlButtonPresenterSelector());
getControlsRow().setSecondaryActionsAdapter(adapter);
mFastForwardAction = (PlaybackControlsRow.FastForwardAction) getPrimaryActionsAdapter()
.lookup(ACTION_FAST_FORWARD);
mRewindAction = (PlaybackControlsRow.RewindAction) getPrimaryActionsAdapter()
.lookup(ACTION_REWIND);
presenter.setOnActionClickedListener(new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
dispatchAction(action);
}
});
return presenter;
}
示例3: onCreateOnActionClickedListener
import android.support.v17.leanback.widget.OnActionClickedListener; //导入依赖的package包/类
@Override
protected OnActionClickedListener onCreateOnActionClickedListener() {
return new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
if (action.getId() == ACTION_PLAY_FROM_BEGINNING) {
startPlayback(mRecordedProgram, TvInputManager.TIME_SHIFT_INVALID_TIME);
} else if (action.getId() == ACTION_RESUME_PLAYING) {
startPlayback(mRecordedProgram, mDvrWatchedPositionManager
.getWatchedPosition(mRecordedProgram.getId()));
} else if (action.getId() == ACTION_DELETE_RECORDING) {
DvrManager dvrManager = TvApplication
.getSingletons(getActivity()).getDvrManager();
dvrManager.removeRecordedProgram(mRecordedProgram);
getActivity().finish();
}
}
};
}
示例4: provideHelper
import android.support.v17.leanback.widget.OnActionClickedListener; //导入依赖的package包/类
@Provides
@PerFragment
public FullWidthDetailsOverviewSharedElementHelper provideHelper(Activity activity,
PresenterSelector mPs, DetailsOverviewRow row, OnActionClickedListener listener) {
FullWidthDetailsOverviewSharedElementHelper mHelper =
new FullWidthDetailsOverviewSharedElementHelper();
mHelper.setSharedElementEnterTransition(activity,
LiveDataDetailActivity.SHARED_ELEMENT_NAME);
((FullWidthDetailsOverviewRowPresenter) mPs.getPresenter(row))
.setListener(mHelper);
((FullWidthDetailsOverviewRowPresenter) mPs.getPresenter(row))
.setParticipatingEntranceTransition(false);
((FullWidthDetailsOverviewRowPresenter) mPs.getPresenter(row))
.setOnActionClickedListener(listener);
return mHelper;
}
示例5: buildAboutAdapter
import android.support.v17.leanback.widget.OnActionClickedListener; //导入依赖的package包/类
private ArrayObjectAdapter buildAboutAdapter() {
DetailsOverviewRowPresenter rowPresenter = new DetailsOverviewRowPresenter(new AboutDetailsDescriptionPresenter());
rowPresenter.setBackgroundColor(getResources().getColor(R.color.about_background));
rowPresenter.setOnActionClickedListener(new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {}
});
ClassPresenterSelector selector = new ClassPresenterSelector();
selector.addClassPresenter(DetailsOverviewRow.class, rowPresenter);
selector.addClassPresenter(ListRow.class, new ListRowPresenter());
ArrayObjectAdapter rowsAdapter = new ArrayObjectAdapter(selector);
rowsAdapter.add(generateAboutMeRow());
rowsAdapter.add(generateAboutGDGRow());
return rowsAdapter;
}
示例6: setupDetailsOverviewRowPresenter
import android.support.v17.leanback.widget.OnActionClickedListener; //导入依赖的package包/类
private void setupDetailsOverviewRowPresenter() {
// Set detail background and style.
DetailsOverviewRowPresenter detailsPresenter =
new DetailsOverviewRowPresenter(new DetailsDescriptionPresenter());
detailsPresenter.setBackgroundColor(getResources().getColor(R.color.selected_background));
detailsPresenter.setStyleLarge(true);
// Hook up transition element.
detailsPresenter.setSharedElementEnterTransition(getActivity(),
MovieDetailsActivity.SHARED_ELEMENT_NAME);
detailsPresenter.setOnActionClickedListener(new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
if (action.getId() == ACTION_WATCH_TRAILER) {
Intent intent = new Intent(getActivity(), PlaybackActivity.class);
intent.putExtra(MovieDetailsActivity.MOVIE, mSelectedMovie);
startActivity(intent);
} else {
Toast.makeText(getActivity(), action.toString(), Toast.LENGTH_SHORT).show();
}
}
});
mPresenterSelector.addClassPresenter(DetailsOverviewRow.class, detailsPresenter);
}
示例7: setupDetailsOverviewRowPresenter
import android.support.v17.leanback.widget.OnActionClickedListener; //导入依赖的package包/类
private void setupDetailsOverviewRowPresenter() {
// Set detail background.
FullWidthDetailsOverviewRowPresenter detailsPresenter =
new FullWidthDetailsOverviewRowPresenter(new DetailsDescriptionPresenter());
detailsPresenter.setBackgroundColor(
ContextCompat.getColor(getActivity(), R.color.selected_background));
// Hook up transition element.
FullWidthDetailsOverviewSharedElementHelper sharedElementHelper =
new FullWidthDetailsOverviewSharedElementHelper();
sharedElementHelper.setSharedElementEnterTransition(
getActivity(), DetailsActivity.SHARED_ELEMENT_NAME);
detailsPresenter.setListener(sharedElementHelper);
detailsPresenter.setParticipatingEntranceTransition(true);
detailsPresenter.setOnActionClickedListener(new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
if (action.getId() == ACTION_WATCH_TRAILER) {
Intent intent = new Intent(getActivity(), PlaybackActivity.class);
intent.putExtra(DetailsActivity.MOVIE, mSelectedMovie);
startActivity(intent);
} else {
Toast.makeText(getActivity(), action.toString(), Toast.LENGTH_SHORT).show();
}
}
});
mPresenterSelector.addClassPresenter(DetailsOverviewRow.class, detailsPresenter);
}
示例8: createControlsRowAndPresenter
import android.support.v17.leanback.widget.OnActionClickedListener; //导入依赖的package包/类
@Override
public PlaybackControlsRowPresenter createControlsRowAndPresenter() {
PlaybackControlsRowPresenter presenter = super.createControlsRowAndPresenter();
ArrayObjectAdapter adapter = new ArrayObjectAdapter(new ControlButtonPresenterSelector());
getControlsRow().setSecondaryActionsAdapter(adapter);
mFastForwardAction = (PlaybackControlsRow.FastForwardAction) getPrimaryActionsAdapter()
.lookup(ACTION_FAST_FORWARD);
mRewindAction = (PlaybackControlsRow.RewindAction) getPrimaryActionsAdapter()
.lookup(ACTION_REWIND);
// odebrani zbytecnych tlacitek
/*
adapter.add(mThumbsDownAction);
adapter.add(mRepeatAction);
adapter.add(mThumbsUpAction);
*/
if (PlaybackOverlayActivity.supportsPictureInPicture(getContext())) {
adapter.add(mPipAction);
}
presenter.setOnActionClickedListener(new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
dispatchAction(action);
}
});
return presenter;
}
示例9: setupAdapter
import android.support.v17.leanback.widget.OnActionClickedListener; //导入依赖的package包/类
private void setupAdapter() {
// Set detail background and style.
FullWidthDetailsOverviewRowPresenter detailsPresenter =
new FullWidthDetailsOverviewRowPresenter(new DetailsDescriptionPresenter(),
new MovieDetailsOverviewLogoPresenter());
detailsPresenter.setBackgroundColor(
ContextCompat.getColor(getActivity(), R.color.selected_background));
detailsPresenter.setInitialState(FullWidthDetailsOverviewRowPresenter.STATE_HALF);
// Hook up transition element.
mHelper = new FullWidthDetailsOverviewSharedElementHelper();
mHelper.setSharedElementEnterTransition(getActivity(),
VideoDetailsActivity.SHARED_ELEMENT_NAME);
detailsPresenter.setListener(mHelper);
detailsPresenter.setParticipatingEntranceTransition(false);
prepareEntranceTransition();
detailsPresenter.setOnActionClickedListener(new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
if (action.getId() == ACTION_WATCH_TRAILER) {
Intent intent = new Intent(getActivity(), PlaybackOverlayActivity.class);
intent.putExtra(VideoDetailsActivity.VIDEO, mSelectedVideo);
startActivity(intent);
} else {
Toast.makeText(getActivity(), action.toString(), Toast.LENGTH_SHORT).show();
}
}
});
mPresenterSelector = new ClassPresenterSelector();
mPresenterSelector.addClassPresenter(DetailsOverviewRow.class, detailsPresenter);
mPresenterSelector.addClassPresenter(ListRow.class, new ListRowPresenter());
mAdapter = new ArrayObjectAdapter(mPresenterSelector);
setAdapter(mAdapter);
}
示例10: createControlsRowAndPresenter
import android.support.v17.leanback.widget.OnActionClickedListener; //导入依赖的package包/类
@Override
public PlaybackControlsRowPresenter createControlsRowAndPresenter() {
PlaybackControlsRowPresenter presenter = super.createControlsRowAndPresenter();
ArrayObjectAdapter adapter = new ArrayObjectAdapter(new ControlButtonPresenterSelector());
getControlsRow().setSecondaryActionsAdapter(adapter);
mFastForwardAction = (PlaybackControlsRow.FastForwardAction) getPrimaryActionsAdapter()
.lookup(ACTION_FAST_FORWARD);
mRewindAction = (PlaybackControlsRow.RewindAction) getPrimaryActionsAdapter()
.lookup(ACTION_REWIND);
adapter.add(mThumbsDownAction);
adapter.add(mRepeatAction);
adapter.add(mThumbsUpAction);
if (PlaybackOverlayActivity.supportsPictureInPicture(getContext())) {
adapter.add(mPipAction);
}
presenter.setOnActionClickedListener(new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
dispatchAction(action);
}
});
return presenter;
}
示例11: setupAdapter
import android.support.v17.leanback.widget.OnActionClickedListener; //导入依赖的package包/类
private void setupAdapter() {
FullWidthDetailsOverviewRowPresenter detailsPresenter =
new FullWidthDetailsOverviewRowPresenter(
new DetailsDescriptionPresenter(), new MovieDetailsOverviewLogoPresenter());
detailsPresenter.setBackgroundColor(
ContextCompat.getColor(getContext(), R.color.background_dark));
detailsPresenter.setInitialState(FullWidthDetailsOverviewRowPresenter.STATE_HALF);
detailsPresenter.setOnActionClickedListener(
new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
if (action.getId() == ACTION_WATCH) {
Intent intent =
PlaybackActivity.createIntent(getContext(), mMovie.getId());
startActivity(intent);
} else {
Toast.makeText(getActivity(), action.toString(), Toast.LENGTH_SHORT)
.show();
}
}
});
ClassPresenterSelector mPresenterSelector = new ClassPresenterSelector();
mPresenterSelector.addClassPresenter(DetailsOverviewRow.class, detailsPresenter);
mAdapter = new ArrayObjectAdapter(mPresenterSelector);
setAdapter(mAdapter);
}
示例12: onCreateOnActionClickedListener
import android.support.v17.leanback.widget.OnActionClickedListener; //导入依赖的package包/类
@Override
protected OnActionClickedListener onCreateOnActionClickedListener() {
return new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
if (action.getId() == ACTION_WATCH) {
startPlayback(mRecommendRecordedProgram, mInitialPlaybackPositionMs);
} else if (action.getId() == ACTION_SERIES_SCHEDULES) {
DvrUiHelper.startSchedulesActivityForSeries(getContext(), mSeries);
} else if (action.getId() == ACTION_DELETE) {
DvrUiHelper.startSeriesDeletionActivity(getContext(), mSeries.getId());
}
}
};
}
示例13: onCreateOnActionClickedListener
import android.support.v17.leanback.widget.OnActionClickedListener; //导入依赖的package包/类
@Override
protected OnActionClickedListener onCreateOnActionClickedListener() {
return new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
long actionId = action.getId();
if (actionId == ACTION_VIEW_SCHEDULE) {
DvrUiHelper.startSchedulesActivity(getContext(), getRecording());
} else if (actionId == ACTION_CANCEL) {
mDvrManager.removeScheduledRecording(getRecording());
getActivity().finish();
}
}
};
}
示例14: onCreateOnActionClickedListener
import android.support.v17.leanback.widget.OnActionClickedListener; //导入依赖的package包/类
@Override
protected OnActionClickedListener onCreateOnActionClickedListener() {
return new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
if (action.getId() == ACTION_STOP_RECORDING) {
DvrManager dvrManager = TvApplication.getSingletons(getActivity())
.getDvrManager();
dvrManager.stopRecording(getRecording());
}
getActivity().finish();
}
};
}
示例15: onPostExecute
import android.support.v17.leanback.widget.OnActionClickedListener; //导入依赖的package包/类
@Override
protected void onPostExecute(DetailsOverviewRow detailRow) {
ClassPresenterSelector ps = new ClassPresenterSelector();
// set detail background and style
mDorPresenter.setBackgroundColor(getResources().getColor(R.color.detail_background));
mDorPresenter.setStyleLarge(true);
mDorPresenter.setOnActionClickedListener(new OnActionClickedListener() {
@Override
public void onActionClicked(Action action) {
if (action.getId() == ACTION_WATCH_TRAILER) {
} else {
Toast.makeText(getActivity(), action.toString(), Toast.LENGTH_SHORT).show();
}
}
});
ps.addClassPresenter(DetailsOverviewRow.class, mDorPresenter);
ps.addClassPresenter(ListRow.class,
new ListRowPresenter());
ArrayObjectAdapter adapter = new ArrayObjectAdapter(ps);
adapter.add(detailRow);
String subcategories[] = {
getString(R.string.related_movies)
};
List<Movie> list = MovieList.list;
Collections.shuffle(list);
ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(new CardPresenter());
for (int j = 0; j < NUM_COLS; j++) {
listRowAdapter.add(list.get(j % 5));
}
HeaderItem header = new HeaderItem(0, subcategories[0]);
adapter.add(new ListRow(header, listRowAdapter));
setAdapter(adapter);
}