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


Java StringUtils类代码示例

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


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

示例1: setProgress

import io.vov.vitamio.utils.StringUtils; //导入依赖的package包/类
private long setProgress() {
  if (mPlayer == null || mDragging)
    return 0;

  long position = mPlayer.getCurrentPosition();
  long duration = mPlayer.getDuration();
  if (mProgress != null) {
    if (duration > 0) {
      long pos = 1000L * position / duration;
      mProgress.setProgress((int) pos);
    }
    int percent = mPlayer.getBufferPercentage();
    mProgress.setSecondaryProgress(percent * 10);
  }

  mDuration = duration;

  if (mEndTime != null)
    mEndTime.setText(StringUtils.generateTime(mDuration));
  if (mCurrentTime != null)
    mCurrentTime.setText(StringUtils.generateTime(position));

  return position;
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:25,代码来源:MediaController.java

示例2: setProgress

import io.vov.vitamio.utils.StringUtils; //导入依赖的package包/类
private long setProgress() {
    if (mPlayer == null || mDragging)
        return 0;

    long position = mPlayer.getCurrentPosition();
    long duration = mPlayer.getDuration();
    if (mProgress != null) {
        if (duration > 0) {
            long pos = 1000L * position / duration;
            mProgress.setProgress((int) pos);
        }
        int percent = mPlayer.getBufferPercentage();
        mProgress.setSecondaryProgress(percent * 10);
    }

    mDuration = duration;

    if (mEndTime != null)
        mEndTime.setText(StringUtils.generateTime(mDuration));
    if (mCurrentTime != null)
        mCurrentTime.setText(StringUtils.generateTime(position));

    return position;
}
 
开发者ID:WangZhiYao,项目名称:VideoDemo,代码行数:25,代码来源:MediaController.java

示例3: setProgress

import io.vov.vitamio.utils.StringUtils; //导入依赖的package包/类
private long setProgress() {
    if (mPlayer == null || mDragging) return 0;

    long position = mPlayer.getCurrentPosition();
    long duration = mPlayer.getDuration();
    if (mProgress != null) {
        if (duration > 0) {
            long pos = 1000L * position / duration;
            mProgress.setProgress((int) pos);
        }
        int percent = mPlayer.getBufferPercentage();
        mProgress.setSecondaryProgress(percent * 10);
    }

    mDuration = duration;

    if (mEndTime != null) mEndTime.setText(StringUtils.generateTime(mDuration));
    if (mCurrentTime != null) mCurrentTime.setText(StringUtils.generateTime(position));

    return position;
}
 
开发者ID:yuqirong,项目名称:RxNews,代码行数:22,代码来源:MediaController.java

示例4: setProgress

import io.vov.vitamio.utils.StringUtils; //导入依赖的package包/类
private long setProgress() {
        if (mPlayer == null || mDragging)
            return 0;

        long position = mPlayer.getCurrentPosition();
        long duration = mPlayer.getDuration();
        if (mProgress != null) {
            if (duration > 0) {
                long pos = 1000L * position / duration;
                mProgress.setProgress((int) pos);
            }
            int percent = mPlayer.getBufferPercentage();
//      mProgress.setSecondaryProgress(percent * 10);
        }

        mDuration = duration;

        if (mEndTime != null)
            mEndTime.setText(StringUtils.generateTime(mDuration));
        if (mCurrentTime != null)
            mCurrentTime.setText(StringUtils.generateTime(position));

        return position;
    }
 
开发者ID:wuyinlei,项目名称:MyHearts,代码行数:25,代码来源:MediaController.java

示例5: onProgressChanged

import io.vov.vitamio.utils.StringUtils; //导入依赖的package包/类
public void onProgressChanged(SeekBar bar, int progress, boolean fromuser) {
  if (!fromuser)
    return;

  long newposition = (mDuration * progress) / 1000;
  String time = StringUtils.generateTime(newposition);
  if (mInstantSeeking)
    mPlayer.seekTo(newposition);
  if (mInfoView != null)
    mInfoView.setText(time);
  if (mCurrentTime != null)
    mCurrentTime.setText(time);
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:14,代码来源:MediaController.java

示例6: setFlashText

import io.vov.vitamio.utils.StringUtils; //导入依赖的package包/类
private void setFlashText(long seek) {
    String showTime = StringUtils.generateTime(seek) +
            "/" + StringUtils.generateTime(mVideoView.getDuration());
    mTvFast.setText(showTime);
    mSeek = seek;
    mIsFastFinish = true;

    if (mTvFast.getVisibility() != View.VISIBLE) {
        mTvFast.setVisibility(View.VISIBLE);
    }
}
 
开发者ID:WangZhiYao,项目名称:VideoDemo,代码行数:12,代码来源:VideoPlayActivity.java

示例7: onProgressChanged

import io.vov.vitamio.utils.StringUtils; //导入依赖的package包/类
public void onProgressChanged(SeekBar bar, int progress, boolean fromuser) {
    if (!fromuser)
        return;

    long newposition = (mDuration * progress) / 1000;
    String time = StringUtils.generateTime(newposition);
    if (mInstantSeeking)
        mPlayer.seekTo(newposition);
    if (mInfoView != null)
        mInfoView.setText(time);
    if (mCurrentTime != null)
        mCurrentTime.setText(time);
}
 
开发者ID:WangZhiYao,项目名称:VideoDemo,代码行数:14,代码来源:MediaController.java

示例8: initProgress

import io.vov.vitamio.utils.StringUtils; //导入依赖的package包/类
private void initProgress() {
    currentPosition = mVideoView.getCurrentPosition();
    duration = mVideoView.getDuration();
    sb_process.setProgress((int) (100 * currentPosition / duration));
    tv_start.setText(StringUtils.generateTime(currentPosition));
    tv_end.setText(StringUtils.generateTime(duration));
    mHandler.sendEmptyMessageDelayed(MESSAGE_CHANGE_TEXT_PROGRESS, 1000);
}
 
开发者ID:yuqirong,项目名称:RxNews,代码行数:9,代码来源:VideoPlayControlView.java

示例9: onProgressChanged

import io.vov.vitamio.utils.StringUtils; //导入依赖的package包/类
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
    if (fromUser) {
        long currentPosition = progress * duration / seekBar.getMax();
        tv_start.setText(StringUtils.generateTime(currentPosition));
        mVideoView.seekTo(currentPosition);
    }
}
 
开发者ID:yuqirong,项目名称:RxNews,代码行数:9,代码来源:VideoPlayControlView.java

示例10: onStopTrackingTouch

import io.vov.vitamio.utils.StringUtils; //导入依赖的package包/类
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
    // 结束触摸seekbar时
    long currentPosition = seekBar.getProgress() * duration / seekBar.getMax();
    mVideoView.seekTo(currentPosition);
    tv_start.setText(StringUtils.generateTime(currentPosition));
    mVideoView.start();
    mHandler.sendEmptyMessage(MESSAGE_CHANGE_TEXT_PROGRESS);
    mHandler.sendEmptyMessageDelayed(MESSAGE_WINDOW_GONE, DEFAULT_DISMISS_TIME);
}
 
开发者ID:yuqirong,项目名称:RxNews,代码行数:11,代码来源:VideoPlayControlView.java

示例11: onProgressChanged

import io.vov.vitamio.utils.StringUtils; //导入依赖的package包/类
public void onProgressChanged(SeekBar bar, int progress, boolean fromuser) {
    if (!fromuser) return;

    long newposition = (mDuration * progress) / 1000;
    String time = StringUtils.generateTime(newposition);
    if (mInstantSeeking) mPlayer.seekTo(newposition);
    if (mInfoView != null) mInfoView.setText(time);
    if (mCurrentTime != null) mCurrentTime.setText(time);

    if (mOnProgressChangeListener != null) {
        mOnProgressChangeListener.onChange();
    }

}
 
开发者ID:yuqirong,项目名称:RxNews,代码行数:15,代码来源:MediaController.java

示例12: getView

import io.vov.vitamio.utils.StringUtils; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder holder;
    if (convertView == null) {
        convertView = mInflater.inflate(R.layout.video_list_item, null);
        holder = new ViewHolder();
        holder.infoLayout = convertView.findViewById(R.id.info_layout);
        holder.name = (TextView) convertView.findViewById(R.id.media_name);
        holder.size = (TextView) convertView.findViewById(R.id.media_size);
        holder.path = (TextView) convertView.findViewById(R.id.media_path);
        holder.duration = (TextView) convertView.findViewById(R.id.media_duration);
        holder.image = (ImageView) convertView.findViewById(R.id.media_image);
        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }

    Utility.resizeImageViewOnScreenSize(mContext, holder.image, 3, 10, 4, 3);
    ViewGroup.LayoutParams lp = holder.infoLayout.getLayoutParams();
    lp.height = holder.image.getLayoutParams().height;

    MediaInfo mediaInfo = getItem(position);
    holder.name.setText(mediaInfo.getName());
    holder.size.setText(FileManager.sizeAddUnit(mediaInfo.getSize()));
    holder.duration.setText(StringUtils.generateTime(mediaInfo.getDuration()));
    holder.path.setText(mediaInfo.getPath());
    if (mediaInfo.getThumbnailPath() != null) {
        Picasso.with(mContext).load("file://" + mediaInfo.getThumbnailPath())
                .error(R.drawable.image_default_bg).into(holder.image);
    } else {
        holder.image.setImageResource(R.drawable.image_default_bg);
    }

    return convertView;
}
 
开发者ID:hezhubo,项目名称:HPlayer,代码行数:36,代码来源:VideoListAdapter.java

示例13: run

import io.vov.vitamio.utils.StringUtils; //导入依赖的package包/类
@Override
public void run() {
    mHandler.postDelayed(updateSeekBarThread, UPDATE_INTERVAL);
    if (mVideoView.getDuration() != 0) {
        mSeekBar.setProgress((int) (mVideoView.getCurrentPosition() /
                (float) mVideoView.getDuration() * 1000));
        mCurrentTime.setText(StringUtils.generateTime(
                mVideoView.getCurrentPosition()));
        mTotalTime.setText(StringUtils.generateTime(
                mVideoView.getDuration()));
    }
}
 
开发者ID:hezhubo,项目名称:HPlayer,代码行数:13,代码来源:PlayerActivity.java

示例14: run

import io.vov.vitamio.utils.StringUtils; //导入依赖的package包/类
@Override
public void run() {
    mSeekBar.setProgress((int) (currentPosition / (float) duration * 1000));
    mCurrentTime.setText(StringUtils.generateTime(currentPosition));
    mTotalTime.setText(StringUtils.generateTime(duration));
}
 
开发者ID:hezhubo,项目名称:HPlayer,代码行数:7,代码来源:DlnaFragment.java

示例15: sec2time

import io.vov.vitamio.utils.StringUtils; //导入依赖的package包/类
/**
 * 秒转化为常见格式
 *
 * @param time 时间
 * @return
 */
private String sec2time(long time) {
    return StringUtils.generateTime(time);
}
 
开发者ID:WangZhiYao,项目名称:VideoDemo,代码行数:10,代码来源:VideoPlayActivity.java


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