当前位置: 首页>>代码示例>>Java>>正文


Java OnActionClickedListener类代码示例

本文整理汇总了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);
}
 
开发者ID:bassaer,项目名称:HelloTV,代码行数:26,代码来源:VideoDetailsFragment.java

示例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;
}
 
开发者ID:NiciDieNase,项目名称:chaosflix-leanback,代码行数:21,代码来源:PlaybackHelper.java

示例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();
            }
        }
    };
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:20,代码来源:RecordedProgramDetailsFragment.java

示例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;

}
 
开发者ID:googlesamples,项目名称:leanback-showcase,代码行数:19,代码来源:LiveDataDetailFragmentUiModule.java

示例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;
}
 
开发者ID:wildsmith,项目名称:TickTank_old,代码行数:21,代码来源:AboutDetailsFragment.java

示例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);
}
 
开发者ID:dextorer,项目名称:BuildingForAndroidTV,代码行数:26,代码来源:MovieDetailsFragment.java

示例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);
}
 
开发者ID:alphater,项目名称:garras,代码行数:30,代码来源:VideoDetailsFragment.java

示例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;
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:33,代码来源:PlaybackControlHelper.java

示例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);
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:38,代码来源:VideoDetailsFragment.java

示例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;
}
 
开发者ID:ad-on-is,项目名称:chilly,代码行数:30,代码来源:PlaybackControlHelper.java

示例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);
}
 
开发者ID:googlesamples,项目名称:leanback-assistant,代码行数:30,代码来源:VideoDetailsFragment.java

示例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());
            }
        }
    };
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:16,代码来源:SeriesRecordingDetailsFragment.java

示例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();
            }
        }
    };
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:16,代码来源:ScheduledRecordingDetailsFragment.java

示例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();
        }
    };
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:15,代码来源:CurrentRecordingDetailsFragment.java

示例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);
}
 
开发者ID:MizzleDK,项目名称:Mizuu-Android-TV,代码行数:40,代码来源:VideoDetailsFragment.java


注:本文中的android.support.v17.leanback.widget.OnActionClickedListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。