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


Java NumberProgressBar.setMax方法代码示例

本文整理汇总了Java中com.daimajia.numberprogressbar.NumberProgressBar.setMax方法的典型用法代码示例。如果您正苦于以下问题:Java NumberProgressBar.setMax方法的具体用法?Java NumberProgressBar.setMax怎么用?Java NumberProgressBar.setMax使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.daimajia.numberprogressbar.NumberProgressBar的用法示例。


在下文中一共展示了NumberProgressBar.setMax方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
 
开发者ID:saurabhsjoshi,项目名称:VITacademics-for-Android,代码行数:18,代码来源:ScheduleView.java

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

示例3: initView

import com.daimajia.numberprogressbar.NumberProgressBar; //导入方法依赖的package包/类
private void initView() {
    tv_size = (TextView) findViewById(R.id.tv_size);
    number_progress_bar = (NumberProgressBar) findViewById(R.id.number_progress_bar);
    number_progress_bar.setMax(100);

    path = FileUtils.getSDCardPath() + "/" + System.currentTimeMillis() + ".apk";

    //下载
    url = getIntent().getStringExtra("url");
    if (!TextUtils.isEmpty(url)) {
        //下载
        RxVolley.download(path, url, new ProgressListener() {
            @Override
            public void onProgress(long transferredBytes, long totalSize) {
                //L.i("transferredBytes:" + transferredBytes + "totalSize:" + totalSize);
                Message msg = new Message();
                msg.what = HANDLER_LODING;
                Bundle bundle = new Bundle();
                bundle.putLong("transferredBytes", transferredBytes);
                bundle.putLong("totalSize", totalSize);
                msg.setData(bundle);
                handler.sendMessage(msg);
            }
        }, new HttpCallback() {
            @Override
            public void onSuccess(String t) {
                handler.sendEmptyMessage(HANDLER_OK);
            }

            @Override
            public void onFailure(VolleyError error) {
                handler.sendEmptyMessage(HANDLER_ON);
            }
        });
    }
}
 
开发者ID:lijizhi,项目名称:studydemo,代码行数:37,代码来源:UpdatActivity.java

示例4: initView

import com.daimajia.numberprogressbar.NumberProgressBar; //导入方法依赖的package包/类
private void initView() {
    mNumberProgressBar = (NumberProgressBar) findViewById(R.id.number_progress_bar);
    mNumberProgressBar.setMax(100);

    mTvTextSize = (TextView) findViewById(R.id.tv_size);

    path = getExternalCacheDir() + "/" + System.currentTimeMillis() + ".apk";

    //下载
    url = getIntent().getStringExtra("url");
    if (!TextUtils.isEmpty(url)) {
        //下载
        RxVolley.download(path, url, new ProgressListener() {
            @Override
            public void onProgress(long transferredBytes, long totalSize) {
                Message message = new Message();
                message.what = HANDLER_LOADING;
                Bundle bundle = new Bundle();
                bundle.putLong("transferedBytes", transferredBytes);
                bundle.putLong("totalSize", totalSize);
                message.setData(bundle);
                mHandler.sendMessage(message);
            }
        }, new HttpCallback() {
            @Override
            public void onSuccess(String t) {
                LogUtil.e("成功");
                mHandler.sendEmptyMessage(HANDLER_OK);
            }

            @Override
            public void onFailure(VolleyError error) {
                LogUtil.e("失败");
                mHandler.sendEmptyMessage(HANDLER_FAIL);
            }
        });
    }
}
 
开发者ID:Hultron,项目名称:LifeHelper,代码行数:39,代码来源:UpdateActivity.java

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


}
 
开发者ID:MaxSmile,项目名称:EasyVPN-Free,代码行数:62,代码来源:LoaderActivity.java


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