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


Java SeekBar.setThumbOffset方法代码示例

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


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

示例1: initControllerView

import android.widget.SeekBar; //导入方法依赖的package包/类
private void initControllerView(View v) {

    mPauseButton = (ImageButton) v.findViewById(R.id.media_controller_play_pause);
    mTvPlay = (ImageView) v.findViewById(R.id.media_controller_tv_play);
    if (mPauseButton != null && mTvPlay != null) {
      mPauseButton.requestFocus();
      mPauseButton.setOnClickListener(mPauseListener);
      mTvPlay.requestFocus();
      mTvPlay.setOnClickListener(v13 -> {
        doPauseResume();
        show(sDefaultTimeout);
      });
    }

    mProgress = (SeekBar) v.findViewById(R.id.media_controller_seekbar);
    if (mProgress != null) {
      if (mProgress instanceof SeekBar) {
        SeekBar seeker = (SeekBar) mProgress;
        seeker.setOnSeekBarChangeListener(mSeekListener);
        seeker.setThumbOffset(1);
      }
      mProgress.setMax(1000);
    }

    mEndTime = (TextView) v.findViewById(R.id.media_controller_time_total);
    mCurrentTime = (TextView) v
        .findViewById(R.id.media_controller_time_current);
    mTitleView = (TextView) v.findViewById(R.id.media_controller_title);
    if (mTitleView != null) {
      mTitleView.setText(mTitle);
    }

    LinearLayout mDanmakuLayout = (LinearLayout) v.findViewById(
        R.id.media_controller_danmaku_layout);
    ImageView mDanmakuImage = (ImageView) v.findViewById(R.id.media_controller_danmaku_switch);
    TextView mDanmakuText = (TextView) v.findViewById(R.id.media_controller_danmaku_text);
    mDanmakuLayout.setOnClickListener(v1 -> {

      if (mDanmakuShow) {
        mDanmakuImage.setImageResource(R.drawable.bili_player_danmaku_is_open);
        mDanmakuText.setText("弹幕开");
        mDanmukuSwitchListener.setDanmakushow(true);
        mDanmakuShow = false;
      } else {
        mDanmakuImage.setImageResource(R.drawable.bili_player_danmaku_is_closed);
        mDanmakuText.setText("弹幕关");
        mDanmukuSwitchListener.setDanmakushow(false);
        mDanmakuShow = true;
      }
    });

    mBack = (ImageView) v.findViewById(R.id.media_controller_back);
    mBack.setOnClickListener(v12 -> mVideoBackListener.back());
  }
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:55,代码来源:MediaController.java

示例2: initControllerView

import android.widget.SeekBar; //导入方法依赖的package包/类
private void initControllerView(View v) {
    // By default these are hidden.
    mPrevButton = (ImageButton) v.findViewById(PRV_BUTTON_ID);
    if (mPrevButton != null) {
        mPrevButton.setVisibility(View.GONE);
    }
    mNextButton = (ImageButton) v.findViewById(NEXT_BUTTON_ID);
    if (mNextButton != null) {
        mNextButton.setVisibility(View.GONE);
    }

    mFfwdButton = (ImageButton) v.findViewById(FFWD_BUTTON_ID);
    if (mFfwdButton != null) {
        mFfwdButton.setOnClickListener(mFfwdListener);
        if (!mFromXml) {
            mFfwdButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);
        }
    }

    mRewButton = (ImageButton) v.findViewById(REW_BUTTON_ID);
    if (mRewButton != null) {
        mRewButton.setOnClickListener(mRewListener);
        if (!mFromXml) {
            mRewButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);
        }
    }
    mPauseButton = (ImageButton) v.findViewById(PAUSE_BUTTON_ID);
    if (mPauseButton != null) {
        mPauseButton.requestFocus();
        mPauseButton.setOnClickListener(mPauseListener);
    }

    mProgress = (ProgressBar) v.findViewById(MEDIACONTROLLER_PROGRESS_ID);
    if (mProgress != null) {
        if (mProgress instanceof SeekBar) {
            SeekBar seeker = (SeekBar) mProgress;
            seeker.setOnSeekBarChangeListener(mSeekListener);
            seeker.setThumbOffset(1);
        }
        mProgress.setMax(1000);
        mProgress.setEnabled(!mDisableProgress);
    }

    mEndTime = (TextView) v.findViewById(END_TIME_ID);
    mCurrentTime = (TextView) v.findViewById(CURRENT_TIME_ID);
}
 
开发者ID:pili-engineering,项目名称:PLDroidShortVideo,代码行数:47,代码来源:MediaController.java

示例3: initControllerView

import android.widget.SeekBar; //导入方法依赖的package包/类
private void initControllerView(View view) {
    mIbPause = (ImageButton) view.findViewById(R.id.media_controller_play_pause);
    mTvPlay = (ImageView) view.findViewById(R.id.media_controller_tv_play);
    if (mIbPause != null && mTvPlay != null){
        mIbPause.requestFocus();
        mTvPlay.setOnClickListener(v -> {
            doPauseResume();
            show(sDefaultTimeout);
        });
    }

    mProgressBar = (SeekBar) view.findViewById(R.id.media_controller_seekbar);
    if (mProgressBar != null){
        if (mProgressBar instanceof SeekBar){
            SeekBar seekBar = (SeekBar) mProgressBar;
            seekBar.setOnSeekBarChangeListener(mSeekBarChangeListener);
            seekBar.setThumbOffset(1);
        }
        mProgressBar.setMax(1000);
    }

    mEndTime = (TextView) view.findViewById(R.id.media_controller_time_total);
    mCurrentTime = (TextView) view.findViewById(R.id.media_controller_time_current);
    mTitleView = (TextView) view.findViewById(R.id.media_controller_title);
    if (mTitleView != null)
        mTitleView.setText(mTitle);

    LinearLayout llDanmuku = (LinearLayout) view.findViewById(R.id.media_controller_danmaku_layout);
    ImageView ivDanmuku = (ImageView) view.findViewById(R.id.media_controller_danmaku_switch);
    TextView tvDanmuku = (TextView) view.findViewById(R.id.media_controller_danmaku_text);
    llDanmuku.setOnClickListener(v -> {
        if (mDanmakuShow){
            ivDanmuku.setImageResource(R.drawable.bili_player_danmaku_is_open);
            tvDanmuku.setText("弹幕开");
            mDanmakuSwitchListener.setDanmakuShow(true);
            mDanmakuShow = false;
        } else {
            ivDanmuku.setImageResource(R.drawable.bili_player_danmaku_is_closed);
            tvDanmuku.setText("弹幕关");
            mDanmakuSwitchListener.setDanmakuShow(false);
            mDanmakuShow = true;
        }
    });

    mIvBack = (ImageView) view.findViewById(R.id.media_controller_back);
    mIvBack.setOnClickListener(v -> mVideoBackListener.back());
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:48,代码来源:MediaController.java


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