當前位置: 首頁>>代碼示例>>Java>>正文


Java ProgressBar.setMax方法代碼示例

本文整理匯總了Java中android.widget.ProgressBar.setMax方法的典型用法代碼示例。如果您正苦於以下問題:Java ProgressBar.setMax方法的具體用法?Java ProgressBar.setMax怎麽用?Java ProgressBar.setMax使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.ProgressBar的用法示例。


在下文中一共展示了ProgressBar.setMax方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: calcProgressToViewAndMark

import android.widget.ProgressBar; //導入方法依賴的package包/類
public static void calcProgressToViewAndMark(ProgressBar bar, long offset, long total,
                                             boolean anim) {
    final int contentLengthOnInt = reducePrecision(total);
    final int shrinkRate = contentLengthOnInt == 0
            ? 1 : (int) (total / contentLengthOnInt);
    bar.setTag(shrinkRate);
    final int progress = (int) (offset / shrinkRate);


    bar.setMax(contentLengthOnInt);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
        bar.setProgress(progress, anim);
    } else {
        bar.setProgress(progress);
    }
}
 
開發者ID:lingochamp,項目名稱:okdownload,代碼行數:17,代碼來源:ProgressUtil.java

示例2: 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

示例3: 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:gaolhjy,項目名稱:cniao5,代碼行數:8,代碼來源:ViewHolder.java

示例4: onPreExecute

import android.widget.ProgressBar; //導入方法依賴的package包/類
@Override
protected void onPreExecute() {
	super.onPreExecute();
	ProgressBar bar = (ProgressBar) activity.progressDialog.findViewById(R.id.progressBar);
	bar.setMax(1686);
	bar.setProgress(0);
	activity.progressDialog.setTitle("Extracting pages...");
}
 
開發者ID:sdrausty,項目名稱:buildAPKsApps,代碼行數:9,代碼來源:ExtractZipTask.java

示例5: realOnBindViewHolder

import android.widget.ProgressBar; //導入方法依賴的package包/類
@Override
public void realOnBindViewHolder(RecyclerViewHolder holder, int position)
{
	ImageView iv_level_icon = holder.findViewById(R.id.iv_level_icon);
	TextView tv_grade_name = holder.findViewById(R.id.tv_grade_name);
	TextView tv_point_range = holder.findViewById(R.id.tv_point_range);
	ProgressBar pb_exp = holder.findViewById(R.id.pb_exp);
	
	Grade grade = realGetItem(position);
	String range_string = getString(R.string.grade_exp_range, grade.getOffset(), grade.getEnd());
	int level_icon = getResources().getIdentifier("level_" + (++position), "drawable", this.getPackageName());
	iv_level_icon.setImageResource(level_icon);
	
	tv_grade_name.setText(grade.getGradeName());
	tv_point_range.setText(range_string);
	
	if (mCurrentExp >= grade.getOffset() && mCurrentExp <= grade.getEnd())
	{
		pb_exp.setVisibility(View.VISIBLE);
		pb_exp.setMax(grade.getEnd() - grade.getOffset());
		pb_exp.setProgress(mCurrentExp - grade.getOffset());
		
		tv_grade_name.getPaint().setFakeBoldText(true);
	}
	else
	{
		pb_exp.setVisibility(View.GONE);
		
		tv_grade_name.getPaint().setFakeBoldText(false);
	}
	
}
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:33,代碼來源:UserGradeListActivity.java

示例6: onCreate

import android.widget.ProgressBar; //導入方法依賴的package包/類
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_playback);

    PLUploadSetting uploadSetting = new PLUploadSetting();

    mVideoUploadManager = new PLShortVideoUploader(getApplicationContext(), uploadSetting);
    mVideoUploadManager.setUploadProgressListener(this);
    mVideoUploadManager.setUploadResultListener(this);

    mUploadBtn = (Button) findViewById(R.id.upload_btn);
    mUploadBtn.setText(R.string.upload);
    mUploadBtn.setOnClickListener(new UploadOnClickListener());
    mProgressBarDeterminate = (ProgressBar) findViewById(R.id.progressBar);
    mProgressBarDeterminate.setMax(100);
    mVideoView = (PLVideoTextureView) findViewById(R.id.video);
    mVideoPath = getIntent().getStringExtra(MP4_PATH);
    mVideoView.setLooping(true);
    mVideoView.setAVOptions(new AVOptions());
    mVideoView.setVideoPath(mVideoPath);
    MediaController mediaController = new MediaController(this, true, false);
    mediaController.setOnClickSpeedAdjustListener(mOnClickSpeedAdjustListener);
    mVideoView.setMediaController(mediaController);

    mVideoView.setOnInfoListener(mOnInfoListener);
    mVideoView.setOnVideoSizeChangedListener(mOnVideoSizeChangedListener);
    mVideoView.setOnBufferingUpdateListener(mOnBufferingUpdateListener);
    mVideoView.setOnCompletionListener(mOnCompletionListener);
    mVideoView.setOnErrorListener(mOnErrorListener);
    mVideoView.setOnVideoFrameListener(mOnVideoFrameListener);
    mVideoView.setOnAudioFrameListener(mOnAudioFrameListener);
}
 
開發者ID:pili-engineering,項目名稱:PLDroidShortVideo,代碼行數:37,代碼來源:PlaybackActivity.java

示例7: setMax

import android.widget.ProgressBar; //導入方法依賴的package包/類
public ViewHolder setMax(int viewId, int max)
{
    ProgressBar view = getView(viewId);
    view.setMax(max);
    return this;
}
 
開發者ID:ZhuoKeTeam,項目名稱:JueDiQiuSheng,代碼行數:7,代碼來源:ViewHolder.java

示例8: setMax

import android.widget.ProgressBar; //導入方法依賴的package包/類
public ViewHolder setMax(int viewId, int max) {
    ProgressBar view = getView(viewId);
    view.setMax(max);
    return this;
}
 
開發者ID:codeccc,項目名稱:baselibrary-master,代碼行數:6,代碼來源:ViewHolder.java

示例9: onCreate

import android.widget.ProgressBar; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mGestureRefreshLayout = (GestureRefreshLayout) findViewById(R.id.gesture_refresh_layout);
    mRefreshText = (TextView) findViewById(R.id.refresh_text);
    mProgressBar = (ProgressBar) findViewById(R.id.progress_bar);
    mProgressBar.setMax(100);
    mGestureRefreshLayout.setTranslateContent(true);//是否移動ContentView
    mGestureRefreshLayout.setOnLayoutTranslateCallback(new GestureRefreshLayout.OnLayoutTranslateCallback() {
        @Override
        public void onLayoutTranslate(int movementTop) {
            if (movementTop >= mProgressBar.getTop() && movementTop <= mProgressBar.getHeight()) {
                //ViewCompat.setTranslationX(mProgressBar, t);
                mProgressBar.layout(mProgressBar.getLeft(), movementTop, mProgressBar.getWidth(), movementTop + mProgressBar.getHeight());
            }
        }
    });
    mGestureRefreshLayout.setEnabled(false);
    mGestureRefreshLayout.setOnGestureChangeListener(new GestureRefreshLayout.OnGestureStateChangeListener() {
        @Override
        public void onStartDrag(float startY) {
            mRefreshText.setText("下拉刷新");
        }

        @Override
        public void onDragging(float draggedDistance, float releaseDistance) {
            //releaseDistance=RefreshView.h+64
            mProgressBar.setProgress((int) (draggedDistance/releaseDistance*100));
            Log.d(TAG, "onDragging: "+draggedDistance+","+releaseDistance);
            if (draggedDistance>releaseDistance){
                mRefreshText.setText("釋放更新");
            }else {
                mRefreshText.setText("下拉刷新...");
            }
            // 超過定義的同步距離就意味著可以釋放刷新了

        }

        @Override
        public void onFinishDrag(float endY) {
            mRefreshText.setText("正在更新...");
        }
    });
    mGestureRefreshLayout.setOnRefreshListener(this);
}
 
開發者ID:Bvin,項目名稱:gesture-refresh-layout,代碼行數:47,代碼來源:MainActivity.java

示例10: 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:VK2012,項目名稱:AppCommonFrame,代碼行數:7,代碼來源:ViewHolder.java

示例11: setProgress

import android.widget.ProgressBar; //導入方法依賴的package包/類
public RvHolder setProgress(int viewId, int progress, int max) {
    ProgressBar view = getView(viewId);
    view.setMax(max);
    view.setProgress(progress);
    return this;
}
 
開發者ID:fengdongfei,項目名稱:CXJPadProject,代碼行數:7,代碼來源:RvHolder.java

示例12: setMax

import android.widget.ProgressBar; //導入方法依賴的package包/類
public BaseViewHolder setMax(int viewId, int max) {
    ProgressBar view = getView(viewId);
    view.setMax(max);
    return this;
}
 
開發者ID:yangchong211,項目名稱:YCBaseAdapter,代碼行數:6,代碼來源:BaseViewHolder.java

示例13: 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 BaseAdapterHelper for chaining.
 */
public BaseAdapterHelper setProgress(int viewId, int progress, int max) {
    ProgressBar view = retrieveView(viewId);
    view.setMax(max);
    view.setProgress(progress);
    return this;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:15,代碼來源:BaseAdapterHelper.java

示例14: 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:weiwenqiang,項目名稱:GitHub,代碼行數:15,代碼來源:BaseViewHolder.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 BaseViewHolder for chaining.
 */
public BaseViewHolder setProgress(@IdRes int viewId, int progress, int max) {
    ProgressBar view = getView(viewId);
    view.setMax(max);
    view.setProgress(progress);
    return this;
}
 
開發者ID:GaoGersy,項目名稱:MultiSelecter,代碼行數:15,代碼來源:BaseViewHolder.java


注:本文中的android.widget.ProgressBar.setMax方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。