當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。