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


Java PlaybackControlsRowPresenter类代码示例

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


PlaybackControlsRowPresenter类属于android.support.v17.leanback.widget包,在下文中一共展示了PlaybackControlsRowPresenter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupUI

import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的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: createControlsRowAndPresenter

import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的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: initUi

import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
private void initUi() {
  PlaybackControlsRowPresenter presenter = mediaControllerHelper.createControlsRowAndPresenter();
  rows = new ArrayObjectAdapter(presenter);
  rows.add(mediaControllerHelper.getControlsRow());
  setAdapter(rows);
  setOnItemViewClickedListener(new OnItemViewClickedListener() {

    @Override
    public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                              RowPresenter.ViewHolder rowViewHolder, Row row) {
      if (item instanceof Action) {
        mediaControllerHelper.onActionClicked((Action) item);
      }
    }
  });
}
 
开发者ID:mkjensen,项目名称:danish-media-license,代码行数:17,代码来源:PlaybackFragment.java

示例4: createControlsRowAndPresenter

import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的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

示例5: onStart

import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
@Override
public void onStart() {
    super.onStart();

    // Set up UI
    Video video = getActivity().getIntent().getParcelableExtra(VideoDetailsActivity.VIDEO);
    if (!updateSelectedVideo(video)) {
        return;
    }

    mGlue = new PlaybackControlHelper(getActivity(), this, mSelectedVideo);
    PlaybackControlsRowPresenter controlsRowPresenter = mGlue.createControlsRowAndPresenter();
    PlaybackControlsRow controlsRow = mGlue.getControlsRow();
    mMediaControllerCallback = mGlue.createMediaControllerCallback();

    mMediaController = getActivity().getMediaController();
    mMediaController.registerCallback(mMediaControllerCallback);

    ClassPresenterSelector ps = new ClassPresenterSelector();
    ps.addClassPresenter(PlaybackControlsRow.class, controlsRowPresenter);
    ps.addClassPresenter(ListRow.class, new ListRowPresenter());
    mRowsAdapter = new ArrayObjectAdapter(ps);
    mRowsAdapter.add(controlsRow);
    addOtherRows();
    updatePlaybackRow();
    setAdapter(mRowsAdapter);

    startPlaying();
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:30,代码来源:PlaybackOverlayFragment.java

示例6: createControlsRowAndPresenter

import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的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

示例7: onStart

import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
@Override
    public void onStart() {
        super.onStart();

        // Set up UI
        Video video = getActivity().getIntent().getParcelableExtra(VideoDetailsActivity.VIDEO);
        if (!updateSelectedVideo(video)) {
            return;
        }

        mGlue = new PlaybackControlHelper(getActivity(), this, mSelectedVideo);
        PlaybackControlsRowPresenter controlsRowPresenter = mGlue.createControlsRowAndPresenter();
        PlaybackControlsRow controlsRow = mGlue.getControlsRow();
        mMediaControllerCallback = mGlue.createMediaControllerCallback();
//
        mMediaController = getActivity().getMediaController();
        mMediaController.registerCallback(mMediaControllerCallback);
//
        ClassPresenterSelector ps = new ClassPresenterSelector();
        ps.addClassPresenter(PlaybackControlsRow.class, controlsRowPresenter);
        ps.addClassPresenter(ListRow.class, new ListRowPresenter());
        mRowsAdapter = new ArrayObjectAdapter(ps);
        mRowsAdapter.add(controlsRow);
        addOtherRows();
        updatePlaybackRow();
        setAdapter(mRowsAdapter);


        startPlaying();

    }
 
开发者ID:ad-on-is,项目名称:chilly,代码行数:32,代码来源:PlaybackOverlayFragment.java

示例8: setUpRows

import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
private void setUpRows() {
    PlaybackControlsRowPresenter controlsRowPresenter =
            mPlaybackControlHelper.createControlsRowAndPresenter();

    ClassPresenterSelector selector = new ClassPresenterSelector();
    selector.addClassPresenter(PlaybackControlsRow.class, controlsRowPresenter);
    selector.addClassPresenter(ListRow.class, new ListRowPresenter());

    mRowsAdapter = new ArrayObjectAdapter(selector);
    mRowsAdapter.add(mPlaybackControlHelper.getControlsRow());
    mRelatedRecordingsRow = getRelatedRecordingsRow();
    setAdapter(mRowsAdapter);
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:14,代码来源:DvrPlaybackOverlayFragment.java

示例9: initialisePlaybackControlPresenter

import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
private void initialisePlaybackControlPresenter() {
    ClassPresenterSelector presenterSelector = new ClassPresenterSelector();
    mPlaybackControlsRowPresenter = new PlaybackControlsRowPresenter(new DescriptionPresenter());
    mPlaybackControlsRowPresenter.setSecondaryActionsHidden(false);

    presenterSelector.addClassPresenter(PlaybackControlsRow.class, mPlaybackControlsRowPresenter);
    presenterSelector.addClassPresenter(ListRow.class, new ListRowPresenter());

    mRowsAdapter = new ArrayObjectAdapter(presenterSelector);
    setAdapter(mRowsAdapter);
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:12,代码来源:PTVPlaybackOverlayFragment.java

示例10: onCreateControlsRowAndPresenter

import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
@Override
protected void onCreateControlsRowAndPresenter() {
    super.onCreateControlsRowAndPresenter();
    PlaybackControlsRowPresenter presenter = (PlaybackControlsRowPresenter)
            getPlaybackRowPresenter();
    presenter.setProgressColor(getContext().getResources().getColor(
            R.color.player_progress_color));
    presenter.setBackgroundColor(getContext().getResources().getColor(
            R.color.player_background_color));
}
 
开发者ID:googlesamples,项目名称:leanback-showcase,代码行数:11,代码来源:MediaPlayerGlue.java

示例11: setupControlsRowPresenter

import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
/**
 * Use this method to setup the {@link PlaybackControlsRowPresenter}. It'll be called
 * <u>after</u> the {@link PlaybackControlsRowPresenter} has been created and the primary and
 * secondary actions have been added.
 *
 * @param presenter The PlaybackControlsRowPresenter used to display the controls.
 */
public void setupControlsRowPresenter(PlaybackControlsRowPresenter presenter) {
    // TODO: [email protected] move into resources
    presenter.setProgressColor(getContext().getResources().getColor(
            R.color.player_progress_color_default));
    presenter.setBackgroundColor(getContext().getResources().getColor(
            R.color.player_background_color_default));
}
 
开发者ID:bertrandmartel,项目名称:youtubetv,代码行数:15,代码来源:MediaPlayerGlue.java

示例12: createControlsRowAndPresenter

import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
@Override
public PlaybackControlsRowPresenter createControlsRowAndPresenter() {
    PlaybackControlsRowPresenter presenter = super.createControlsRowAndPresenter();
    mControlsRow = getControlsRow();

    // Add secondary actions and change the control row color.
    ArrayObjectAdapter secondaryActions = new ArrayObjectAdapter(
            new ControlButtonPresenterSelector());
    mControlsRow.setSecondaryActionsAdapter(secondaryActions);
    addSecondaryActions(secondaryActions);
    setupControlsRowPresenter(presenter);
    return presenter;
}
 
开发者ID:bertrandmartel,项目名称:youtubetv,代码行数:14,代码来源:MediaPlayerGlue.java

示例13: addPlaybackControlsRow

import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
private void addPlaybackControlsRow() {
    final PlaybackControlsRowPresenter controlsPresenter = mGlue
            .createControlsRowAndPresenter();
    mRowsAdapter = new ArrayObjectAdapter(controlsPresenter);
    mRowsAdapter.add(mGlue.getControlsRow());
    setAdapter(mRowsAdapter);
    setOnItemViewClickedListener(this);
}
 
开发者ID:bertrandmartel,项目名称:youtubetv,代码行数:9,代码来源:VideoPlayerFragment.java

示例14: resetControlsToPrimaryActions

import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
private void resetControlsToPrimaryActions(ItemBridgeAdapter.ViewHolder vh) {
    if (vh == null && getVerticalGridView() != null) {
        vh = (ItemBridgeAdapter.ViewHolder) getVerticalGridView().findViewHolderForPosition(0);
    }
    if (vh == null) {
        mResetControlsToPrimaryActionsPending = true;
    } else if (vh.getPresenter() instanceof PlaybackControlsRowPresenter) {
        mResetControlsToPrimaryActionsPending = false;
        ((PlaybackControlsRowPresenter) vh.getPresenter()).showPrimaryActions(
                (PlaybackControlsRowPresenter.ViewHolder) vh.getViewHolder());
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:13,代码来源:PlaybackOverlaySupportFragment.java

示例15: loadDescriptionAnimator

import android.support.v17.leanback.widget.PlaybackControlsRowPresenter; //导入依赖的package包/类
private void loadDescriptionAnimator() {
    AnimatorUpdateListener listener = new AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator arg0) {
            if (getVerticalGridView() == null) {
                return;
            }
            ItemBridgeAdapter.ViewHolder adapterVh = (ItemBridgeAdapter.ViewHolder)
                    getVerticalGridView().findViewHolderForPosition(0);
            if (adapterVh != null && adapterVh.getViewHolder()
                    instanceof PlaybackControlsRowPresenter.ViewHolder) {
                final Presenter.ViewHolder vh = ((PlaybackControlsRowPresenter.ViewHolder)
                        adapterVh.getViewHolder()).mDescriptionViewHolder;
                if (vh != null) {
                    vh.view.setAlpha((Float) arg0.getAnimatedValue());
                }
            }
        }
    };

    mDescriptionFadeInAnimator = loadAnimator(
            getActivity(), R.animator.lb_playback_description_fade_in);
    mDescriptionFadeInAnimator.addUpdateListener(listener);
    mDescriptionFadeInAnimator.setInterpolator(mLogDecelerateInterpolator);

    mDescriptionFadeOutAnimator = loadAnimator(
            getActivity(), R.animator.lb_playback_description_fade_out);
    mDescriptionFadeOutAnimator.addUpdateListener(listener);
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:30,代码来源:PlaybackOverlaySupportFragment.java


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