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


Java ProgressBar.setProgress方法代码示例

本文整理汇总了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();
}
 
开发者ID:ynztlxdeai,项目名称:TextReader,代码行数:18,代码来源:PageFactory.java

示例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);
}
 
开发者ID:quaap,项目名称:LaunchTime,代码行数:18,代码来源:ColorChooser.java

示例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);
    }
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:11,代码来源:VideoPresenter.java

示例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;
}
 
开发者ID:pao11,项目名称:BaseAdapterRel,代码行数:8,代码来源:ViewHolder.java

示例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);
    }
}
 
开发者ID:lingochamp,项目名称:okdownload,代码行数:14,代码来源:ProgressUtil.java

示例6: setProgress

import android.widget.ProgressBar; //导入方法依赖的package包/类
public BaseViewHolder setProgress(int viewId, int progress) {
    ProgressBar view = getView(viewId);
    view.setProgress(progress);
    return this;
}
 
开发者ID:yangchong211,项目名称:YCBaseAdapter,代码行数:6,代码来源:BaseViewHolder.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:GoogleVR,代码行数:15,代码来源:BaseViewHolder.java

示例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;
}
 
开发者ID:wp521,项目名称:MyFire,代码行数:7,代码来源:ViewHolderHelper.java

示例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;
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:7,代码来源:ViewHolder.java

示例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();
}
 
开发者ID:RahulJanagouda,项目名称:StatusStories,代码行数:7,代码来源:StoryStatusView.java

示例11: setProgress

import android.widget.ProgressBar; //导入方法依赖的package包/类
public ViewHolder setProgress(int viewId, int progress)
{
    ProgressBar view = getView(viewId);
    view.setProgress(progress);
    return this;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:ViewHolder.java

示例12: setProgress

import android.widget.ProgressBar; //导入方法依赖的package包/类
public ViewHolder setProgress(int viewId, int progress) {
    ProgressBar view = getView(viewId);
    view.setProgress(progress);
    return this;
}
 
开发者ID:GuoZhaoHui628,项目名称:SliderStatusBar,代码行数:6,代码来源:ViewHolder.java

示例13: setProgress

import android.widget.ProgressBar; //导入方法依赖的package包/类
public XViewHolder setProgress(@IdRes int viewId, int progress) {
    ProgressBar view = getView(viewId);
    view.setProgress(progress);
    return this;
}
 
开发者ID:youth5201314,项目名称:XFrame,代码行数:6,代码来源:XViewHolder.java

示例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();
}
 
开发者ID:RahulJanagouda,项目名称:StatusStories,代码行数:7,代码来源:StoryStatusView.java

示例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);

}
 
开发者ID:Aarthas,项目名称:android_Json2view,代码行数:15,代码来源:AdapterHelper.java


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