本文整理汇总了Java中android.widget.ProgressBar.setProgress方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressBar.setProgress方法的具体用法?Java ProgressBar.setProgress怎么用?Java ProgressBar.setProgress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ProgressBar
的用法示例。
在下文中一共展示了ProgressBar.setProgress方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertBetteryBitmap
import android.widget.ProgressBar; //导入方法依赖的package包/类
public void convertBetteryBitmap() {
batteryView = (ProgressBar) LayoutInflater.from(mContext).inflate(R.layout.layout_battery_progress, null);
batteryView.setProgressDrawable(ContextCompat.getDrawable(mContext,
SettingManager.getInstance().getReadTheme() < 4 ?
R.drawable.seekbar_battery_bg : R.drawable.seekbar_battery_night_bg));
batteryView.setProgress(battery);
batteryView.setDrawingCacheEnabled(true);
batteryView.measure(View.MeasureSpec.makeMeasureSpec(ScreenUtils.dpToPxInt(26), View.MeasureSpec.EXACTLY),
View.MeasureSpec.makeMeasureSpec(ScreenUtils.dpToPxInt(14), View.MeasureSpec.EXACTLY));
batteryView.layout(0, 0, batteryView.getMeasuredWidth(), batteryView.getMeasuredHeight());
batteryView.buildDrawingCache();
//batteryBitmap = batteryView.getDrawingCache();
// tips: @link{https://github.com/JustWayward/BookReader/issues/109}
batteryBitmap = Bitmap.createBitmap(batteryView.getDrawingCache());
batteryView.setDrawingCacheEnabled(false);
batteryView.destroyDrawingCache();
}
示例2: animateProgress2
import android.widget.ProgressBar; //导入方法依赖的package包/类
private void animateProgress2(final ProgressBar b, int newval) {
int cval = b.getProgress();
int i = 0;
while (cval != newval && i < 255) { //'i' is a safety in case there's a miss
cval += Math.signum(newval - cval);
final int prog = cval;
b.postDelayed(new Runnable() {
@Override
public void run() {
b.setProgress(prog);
}
}, i++);
}
b.setProgress(newval);
}
示例3: setResume
import android.widget.ProgressBar; //导入方法依赖的package包/类
public void setResume(boolean display, int max, int resumePosition, ProgressBar resume){
if (display) {
resume.setMax(max);
resume.setProgress(resumePosition == PlayerActivity.LAST_POSITION_END ? max : resumePosition);
resume.setIndeterminate(false);
resume.setVisibility(View.VISIBLE);
} else { //no progress slider for resume, but simple label icon instead
resume.setVisibility(View.GONE);
}
}
示例4: setProgress
import android.widget.ProgressBar; //导入方法依赖的package包/类
public ViewHolder setProgress(int viewId, int progress, int max)
{
ProgressBar view = getView(viewId);
view.setMax(max);
view.setProgress(progress);
return this;
}
示例5: updateProgressToViewWithMark
import android.widget.ProgressBar; //导入方法依赖的package包/类
public static void updateProgressToViewWithMark(ProgressBar bar, long currentOffset,
boolean anim) {
if (bar.getTag() == null) return;
final int shrinkRate = (int) bar.getTag();
final int progress = (int) ((currentOffset) / shrinkRate);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
bar.setProgress(progress, anim);
} else {
bar.setProgress(progress);
}
}
示例6: setProgress
import android.widget.ProgressBar; //导入方法依赖的package包/类
public BaseViewHolder setProgress(int viewId, int progress) {
ProgressBar view = getView(viewId);
view.setProgress(progress);
return this;
}
示例7: setProgress
import android.widget.ProgressBar; //导入方法依赖的package包/类
/**
* Sets the progress and max of a ProgressBar.
*
* @param viewId The view id.
* @param progress The progress.
* @param max The max value of a ProgressBar.
* @return The BaseViewHolder for chaining.
*/
public BaseViewHolder setProgress(int viewId, int progress, int max) {
ProgressBar view = getView(viewId);
view.setMax(max);
view.setProgress(progress);
return this;
}
示例8: setProgress
import android.widget.ProgressBar; //导入方法依赖的package包/类
public ViewHolderHelper setProgress(int viewId, int progress, int max) {
ProgressBar view = getView(viewId);
view.setMax(max);
view.setProgress(progress);
return this;
}
示例9: setProgress
import android.widget.ProgressBar; //导入方法依赖的package包/类
public ViewHolder setProgress(int viewId, int progress, int max) {
ProgressBar view = getView(viewId);
view.setMax(max);
view.setProgress(progress);
return this;
}
示例10: skip
import android.widget.ProgressBar; //导入方法依赖的package包/类
public void skip() {
if (isComplete) return;
ProgressBar p = progressBars.get(current);
p.setProgress(p.getMax());
animators.get(current).cancel();
}
示例11: setProgress
import android.widget.ProgressBar; //导入方法依赖的package包/类
public ViewHolder setProgress(int viewId, int progress)
{
ProgressBar view = getView(viewId);
view.setProgress(progress);
return this;
}
示例12: setProgress
import android.widget.ProgressBar; //导入方法依赖的package包/类
public ViewHolder setProgress(int viewId, int progress) {
ProgressBar view = getView(viewId);
view.setProgress(progress);
return this;
}
示例13: setProgress
import android.widget.ProgressBar; //导入方法依赖的package包/类
public XViewHolder setProgress(@IdRes int viewId, int progress) {
ProgressBar view = getView(viewId);
view.setProgress(progress);
return this;
}
示例14: pause
import android.widget.ProgressBar; //导入方法依赖的package包/类
public void pause() {
if (isComplete) return;
ProgressBar p = progressBars.get(current);
p.setProgress(p.getProgress());
animators.get(current).pause();
}
示例15: setProgress
import android.widget.ProgressBar; //导入方法依赖的package包/类
/**
* Sets the progress and max of a ProgressBar.
*
* @param viewId The view id.
* @param progress The progress.
* @param max The max value of a ProgressBar.
* @return The void for chaining.
*/
public void setProgress(int viewId, int progress, int max) {
ProgressBar view = retrieveView(viewId);
view.setMax(max);
view.setProgress(progress);
}