本文整理汇总了Java中com.daimajia.numberprogressbar.NumberProgressBar.setProgress方法的典型用法代码示例。如果您正苦于以下问题:Java NumberProgressBar.setProgress方法的具体用法?Java NumberProgressBar.setProgress怎么用?Java NumberProgressBar.setProgress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.daimajia.numberprogressbar.NumberProgressBar
的用法示例。
在下文中一共展示了NumberProgressBar.setProgress方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import com.daimajia.numberprogressbar.NumberProgressBar; //导入方法依赖的package包/类
private void initialize(){
LayoutInflater layoutInflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
layoutInflater.inflate(R.layout.schedule_widget, this, true);
timeLineView = (TimeLineView) findViewById(R.id.timeline);
tvTime = (TextView) findViewById(R.id.tvTime);
tvTimeAMPM = (TextView) findViewById(R.id.tvTimeAMPM);
tvCourseName = (TextView) findViewById(R.id.tvCourseName);
tvVenue= (TextView) findViewById(R.id.tvVenue);
progressAttendance = (NumberProgressBar) findViewById(R.id.progressAttendance);
progressAttendance.setProgressTextColor(ContextCompat.getColor(getContext(), R.color.text_secondary));
progressAttendance.setReachedBarColor(ContextCompat.getColor(getContext(), R.color.text_secondary));
progressAttendance.setMax(100);
progressAttendance.setProgress(0);
}
示例2: _switchViews
import com.daimajia.numberprogressbar.NumberProgressBar; //导入方法依赖的package包/类
/**
* 更新视图
* @param holder
* @param item
*/
private void _switchViews(BaseViewHolder holder, VideoInfo item) {
switch (item.getDownloadStatus()) {
case DownloadStatus.DOWNLOADING:
NumberProgressBar pbDownload = holder.getView(R.id.pb_download);
if (!holder.isVisible(R.id.pb_download) || !holder.isSelected(R.id.btn_download)) {
holder.setVisible(R.id.pb_download, true)
.setSelected(R.id.btn_download, true)
.setText(R.id.tv_total_size, StringUtils.convertStorageNoB(item.getTotalSize()))
.setTextColor(R.id.tv_speed, ContextCompat.getColor(mContext, R.color.download_normal));
pbDownload.setMax((int) item.getTotalSize());
}
holder.setText(R.id.tv_load_size, StringUtils.convertStorageNoB(item.getLoadedSize()) + "/")
.setText(R.id.tv_speed, StringUtils.convertStorageNoB(item.getDownloadSpeed()) + "/s");
pbDownload.setProgress((int) item.getLoadedSize());
break;
case DownloadStatus.STOP:
if (holder.isVisible(R.id.pb_download) || holder.isSelected(R.id.btn_download)) {
holder.setVisible(R.id.pb_download, false)
.setSelected(R.id.btn_download, false)
.setText(R.id.tv_speed, "下载暂停")
.setTextColor(R.id.tv_speed, ContextCompat.getColor(mContext, R.color.download_stop));
}
break;
case DownloadStatus.COMPLETE:
mRxBus.post(item);
case DownloadStatus.CANCEL:
// 移除
removeItem(item);
break;
case DownloadStatus.ERROR:
holder.setText(R.id.tv_speed, "异常出错,请重新下载")
.setVisible(R.id.pb_download, false)
.setSelected(R.id.btn_download, false)
.setTextColor(R.id.tv_speed, ContextCompat.getColor(mContext, R.color.download_error));
break;
}
}
示例3: onCreate
import com.daimajia.numberprogressbar.NumberProgressBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_loader);
progressBar = (NumberProgressBar)findViewById(R.id.number_progress_bar);
commentsText = (TextView)findViewById(R.id.commentsText);
if (getIntent().getBooleanExtra("firstPremiumLoad", false))
((TextView)findViewById(R.id.loaderPremiumText)).setVisibility(View.VISIBLE);
progressBar.setMax(100);
updateHandler = new Handler(new Handler.Callback() {
@Override
public boolean handleMessage(Message msg) {
switch (msg.arg1) {
case LOAD_ERROR: {
commentsText.setText(msg.arg2);
progressBar.setProgress(100);
} break;
case DOWNLOAD_PROGRESS: {
commentsText.setText(R.string.downloading_csv_text);
progressBar.setProgress(msg.arg2);
} break;
case PARSE_PROGRESS: {
commentsText.setText(R.string.parsing_csv_text);
progressBar.setProgress(msg.arg2);
} break;
case LOADING_SUCCESS: {
commentsText.setText(R.string.successfully_loaded);
progressBar.setProgress(100);
Message end = new Message();
end.arg1 = SWITCH_TO_RESULT;
updateHandler.sendMessageDelayed(end,500);
} break;
case SWITCH_TO_RESULT: {
if (!BuildConfig.DEBUG)
Answers.getInstance().logCustom(new CustomEvent("Time servers loading")
.putCustomAttribute("Time servers loading", stopwatch.getElapsedTime()));
if (PropertiesService.getConnectOnStart()) {
Server randomServer = getRandomServer();
if (randomServer != null) {
newConnecting(randomServer, true, true);
} else {
startActivity(new Intent(LoaderActivity.this, HomeActivity.class));
}
} else {
startActivity(new Intent(LoaderActivity.this, HomeActivity.class));
}
}
}
return true;
}
});
progressBar.setProgress(0);
}