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


Java PlaybackControlsRow.setPrimaryActionsAdapter方法代码示例

本文整理汇总了Java中android.support.v17.leanback.widget.PlaybackControlsRow.setPrimaryActionsAdapter方法的典型用法代码示例。如果您正苦于以下问题:Java PlaybackControlsRow.setPrimaryActionsAdapter方法的具体用法?Java PlaybackControlsRow.setPrimaryActionsAdapter怎么用?Java PlaybackControlsRow.setPrimaryActionsAdapter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v17.leanback.widget.PlaybackControlsRow的用法示例。


在下文中一共展示了PlaybackControlsRow.setPrimaryActionsAdapter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupUI

import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
private void setupUI() {
    VideoFragment videoFragment = (VideoFragment) getFragmentManager().findFragmentById(R.id.video_fragment);
    mGlue = new VideoFragmentGlueHost(videoFragment);
    mGlue.setSurfaceHolderCallback(this);
    mGlue.setOnActionClickedListener(this);

    mControlsRow = new PlaybackControlsRow(mSelectedLink);

    ArrayObjectAdapter adapter = new ArrayObjectAdapter(new ControlButtonPresenterSelector());
    mPlayPauseAction = new PlaybackControlsRow.PlayPauseAction(this);
    mPlayPauseAction.nextIndex(); // set to play
    adapter.add(new PlaybackControlsRow.RewindAction(this));
    adapter.add(mPlayPauseAction);
    adapter.add(new PlaybackControlsRow.FastForwardAction(this));
    mControlsRow.setPrimaryActionsAdapter(adapter);

    PlaybackControlsRowPresenter presenter = new PlaybackControlsRowPresenter(new DetailsPresenter());

    mGlue.setPlaybackRow(mControlsRow);
    mGlue.setPlaybackRowPresenter(presenter);
}
 
开发者ID:CrazyDude1994,项目名称:lostfilm-android-client,代码行数:22,代码来源:PlayerActivity.java

示例2: setupPlaybackControlItemsToInitialisingState

import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
private void setupPlaybackControlItemsToInitialisingState() {
    mRowsAdapter.clear();
    mPlaybackControlsRow = new PlaybackControlsRow(mStreamInfo);
    mPlaybackControlsRow.setCurrentTime(0);
    mPlaybackControlsRow.setBufferedProgress(0);

    ControlButtonPresenterSelector presenterSelector = new ControlButtonPresenterSelector();
    mPrimaryActionsAdapter = new ArrayObjectAdapter(presenterSelector);
    mPlaybackControlsRow.setPrimaryActionsAdapter(mPrimaryActionsAdapter);

    Activity activity = getActivity();
    mPlayPauseAction = new PlayPauseAction(activity);
    mPrimaryActionsAdapter.add(mPlayPauseAction);

    setupSecondaryRowPlaybackControl(presenterSelector);

    mRowsAdapter.add(mPlaybackControlsRow);
    mRowsAdapter.notifyArrayItemRangeChanged(0, mRowsAdapter.size());
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:20,代码来源:PTVPlaybackOverlayFragment.java

示例3: addPlaybackControlsRow

import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
private void addPlaybackControlsRow(MediaMetadata metadata) {

        mPlaybackControlsRow = new PlaybackControlsRow(new MutableMediaMetadataHolder(metadata));
        mRowsAdapter.add(mPlaybackControlsRow);

        resetPlaybackRow();

        ControlButtonPresenterSelector presenterSelector = new ControlButtonPresenterSelector();
        mPrimaryActionsAdapter = new ArrayObjectAdapter(presenterSelector);
        mPlaybackControlsRow.setPrimaryActionsAdapter(mPrimaryActionsAdapter);

        mPlayPauseAction = new PlayPauseAction(getActivity());
        mSkipNextAction = new PlaybackControlsRow.SkipNextAction(getActivity());
        mSkipPreviousAction = new PlaybackControlsRow.SkipPreviousAction(getActivity());

        mPrimaryActionsAdapter.add(mSkipPreviousAction);
        mPrimaryActionsAdapter.add(mPlayPauseAction);
        mPrimaryActionsAdapter.add(mSkipNextAction);
    }
 
开发者ID:mrinalgit-dev,项目名称:MrinalMusicPlayer,代码行数:20,代码来源:TvPlaybackFragment.java

示例4: addPlaybackControlsRow

import android.support.v17.leanback.widget.PlaybackControlsRow; //导入方法依赖的package包/类
private void addPlaybackControlsRow(MediaMetadataCompat metadata) {

        mPlaybackControlsRow = new PlaybackControlsRow(new MutableMediaMetadataHolder(metadata));
        mRowsAdapter.add(mPlaybackControlsRow);

        resetPlaybackRow();

        ControlButtonPresenterSelector presenterSelector = new ControlButtonPresenterSelector();
        mPrimaryActionsAdapter = new ArrayObjectAdapter(presenterSelector);
        mPlaybackControlsRow.setPrimaryActionsAdapter(mPrimaryActionsAdapter);

        mPlayPauseAction = new PlayPauseAction(getActivity());
        mSkipNextAction = new PlaybackControlsRow.SkipNextAction(getActivity());
        mSkipPreviousAction = new PlaybackControlsRow.SkipPreviousAction(getActivity());

        mPrimaryActionsAdapter.add(mSkipPreviousAction);
        mPrimaryActionsAdapter.add(mPlayPauseAction);
        mPrimaryActionsAdapter.add(mSkipNextAction);
    }
 
开发者ID:googlesamples,项目名称:android-UniversalMusicPlayer,代码行数:20,代码来源:TvPlaybackFragment.java


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