本文整理匯總了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);
}
}
示例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);
}
}
示例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;
}
示例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...");
}
示例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);
}
}
示例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);
}
示例7: setMax
import android.widget.ProgressBar; //導入方法依賴的package包/類
public ViewHolder setMax(int viewId, int max)
{
ProgressBar view = getView(viewId);
view.setMax(max);
return this;
}
示例8: setMax
import android.widget.ProgressBar; //導入方法依賴的package包/類
public ViewHolder setMax(int viewId, int max) {
ProgressBar view = getView(viewId);
view.setMax(max);
return this;
}
示例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);
}
示例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;
}
示例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;
}
示例12: setMax
import android.widget.ProgressBar; //導入方法依賴的package包/類
public BaseViewHolder setMax(int viewId, int max) {
ProgressBar view = getView(viewId);
view.setMax(max);
return this;
}
示例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;
}
示例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;
}
示例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;
}