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


Java NumberProgressBar类代码示例

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


NumberProgressBar类属于com.daimajia.numberprogressbar包,在下文中一共展示了NumberProgressBar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.daimajia.numberprogressbar.NumberProgressBar; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mPresenter = new WebPresenter(this);

    numberProgressBar = (NumberProgressBar) findViewById(R.id.number_progress_bar);
    webView = (WebView) findViewById(R.id.web_view);
    layoutWeb = (LinearLayout) findViewById(R.id.layout_web);

    Intent intent = getIntent();
    webTitle = intent.getStringExtra(WEB_TITLE);
    webUrl = intent.getStringExtra(WEB_URL);
    mToolbar.setTitle(webTitle);

    mPresenter.setWebViewSetting(webView, webUrl);
}
 
开发者ID:ChristianFF,项目名称:Lumei.a,代码行数:17,代码来源:WebActivity.java

示例2: onCreateView

import com.daimajia.numberprogressbar.NumberProgressBar; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater layoutInflater,
                         ViewGroup parent,
                         Bundle savedInstanceState
                         ){
    View ret = layoutInflater.inflate(R.layout.layout_now_playing,parent,false);
    view = ret;
    contentView = view.findViewById(R.id.id_now_playing_wrapper);
    seekView = view.findViewById(R.id.id_seeker_wrapper);
    progressView = (NumberProgressBar) view.findViewById(R.id.id_progress_view);
    seeker = (NumberProgressBar) view.findViewById(R.id.id_seeker);
    seekerTitle = (TextView) view.findViewById(R.id.id_seeker_title);
    seekerHint = (TextView) view.findViewById(R.id.id_seeker_hint);
    currentTime = (TextView) view.findViewById(R.id.current_time);
    totalTime = (TextView) view.findViewById(R.id.total_time);
    title = (TextView) view.findViewById(R.id.id_now_playing_text_view_title);
    album = (TextView) view.findViewById(R.id.id_now_playing_text_view_album);
    artist = (TextView) view.findViewById(R.id.id_now_playing_text_view_artist);
    volume = VolumeUtil.getStaticInstance(getActivity());

    loadTheme();
    return ret;
}
 
开发者ID:SpongeBobSun,项目名称:Prodigal,代码行数:24,代码来源:NowPlayingFragment.java

示例3: onCreate

import com.daimajia.numberprogressbar.NumberProgressBar; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    bnp = (NumberProgressBar)findViewById(R.id.numberbar1);
    bnp.setOnProgressBarListener(this);
    timer = new Timer();
    timer.schedule(new TimerTask() {
        @Override
        public void run() {
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    bnp.incrementProgressBy(1);
                }
            });
        }
    }, 1000, 100);
}
 
开发者ID:daimajia,项目名称:NumberProgressBar,代码行数:21,代码来源:MainActivity.java

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

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

示例6: getView

import com.daimajia.numberprogressbar.NumberProgressBar; //导入依赖的package包/类
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
    VH holder = null;
    final Job job = mData.get(position);
    if(convertView == null){
        convertView = LayoutInflater.from(mContext).inflate(R.layout.item_download,parent,false);
        holder = new VH();
        holder.btn = (Button) convertView.findViewById(R.id.btn_download);
        holder.progress = (NumberProgressBar) convertView.findViewById(R.id.progress);
        convertView.setTag(holder);
    } else{
        holder = (VH) convertView.getTag();
    }
    holder.btn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            new DownloadTask(mContext, position).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, job.url);
        }
    });
    if(job.progress == 100){
        holder.btn.setText("完成");
    } else{
        holder.btn.setText("下载");
    }
    holder.progress.setProgress(job.progress);
    return convertView;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:28,代码来源:DownloadAdapter.java

示例7: onCreate

import com.daimajia.numberprogressbar.NumberProgressBar; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    tvMsg = (TextView) findViewById(R.id.tv_msg);
    findViewById(R.id.btn_rx).setOnClickListener(this);
    findViewById(R.id.btn_rx_mu_down).setOnClickListener(this);
    findViewById(R.id.btn_rx_uploade).setOnClickListener(this);
    img = (ImageView) findViewById(R.id.img);
    progressBar = (NumberProgressBar) findViewById(R.id.number_progress_bar);


    /*初始化数据*/
    manager = new HttpManager(this, this);

    postEntity = new SubjectPostApi();
    postEntity.setAll(true);

    /*上传接口内部接口有token验证,所以需要换成自己的接口测试,检查file文件是否手机存在*/
    uplaodApi = new UploadApi();
    File file = new File("/storage/emulated/0/Download/11.jpg");
    RequestBody requestBody = RequestBody.create(MediaType.parse("image/jpeg"), file);
    MultipartBody.Part part = MultipartBody.Part.createFormData("file_name", file.getName(), new ProgressRequestBody
            (requestBody,
                    new UploadProgressListener() {
                        @Override
                        public void onProgress(long currentBytesCount, long totalBytesCount) {
                            tvMsg.setText("提示:上传中");
                            progressBar.setMax((int) totalBytesCount);
                            progressBar.setProgress((int) currentBytesCount);
                        }
                    }));
    uplaodApi.setPart(part);
}
 
开发者ID:wzgiceman,项目名称:RxRetrofit-tokean,代码行数:35,代码来源:MainActivity.java

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

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

示例10: createDialog

import com.daimajia.numberprogressbar.NumberProgressBar; //导入依赖的package包/类
public Dialog createDialog(Context context,boolean isCancel) {
    View view = LayoutInflater.from(context).inflate(R.layout.dialog_update, null);// 得到加载view
    progressBar = (NumberProgressBar) view.findViewById(R.id.progress_bar);
    dialog = new Dialog(context);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);  //http://blog.csdn.net/u011747761/article/details/47419419
    dialog.setCancelable(isCancel);
    dialog.setCanceledOnTouchOutside(isCancel);
    dialog.show();
    dialog.addContentView(view, new RelativeLayout.LayoutParams(
            DensityConversionUtil.dpToPx(context, 250),
            DensityConversionUtil.dpToPx(context, 100)));
    return dialog;
}
 
开发者ID:LonelyMushroom,项目名称:LonelyM-ViewLib,代码行数:14,代码来源:DialogUpdateWidget.java

示例11: initView

import com.daimajia.numberprogressbar.NumberProgressBar; //导入依赖的package包/类
private void initView() {
        titleBackIBtn = (ImageButton) findViewById(R.id.video_detail_back_imv);
        mWebView = (WebView) findViewById(R.id.video_item_webview);
        mNumberProgressBar = (NumberProgressBar) findViewById(R.id.progressbar);
//        mVideoDescTv = (TextView) findViewById(R.id.video_detail_desc_tv);
//        mVideoPublishedAtTv = (TextView) findViewById(R.id.video_detail_publish_time_tv);
//        mVideoCreateAtTv = (TextView) findViewById(R.id.video_detail_create_time_tv);
//        mVideoSourceTv = (TextView) findViewById(R.id.video_detail_source_tv);
//        mVideoWhoTv = (TextView) findViewById(R.id.video_detail_who_tv);
    }
 
开发者ID:absentm,项目名称:myapplication,代码行数:11,代码来源:FindVideoDetailAty.java

示例12: initView

import com.daimajia.numberprogressbar.NumberProgressBar; //导入依赖的package包/类
private void initView() {
    titlBackIbtn = (ImageButton) findViewById(R.id.title_gank_detail_back_ibtn);
    mMarqueeTextView = (MarqueeTextView) findViewById(R.id.title_detail_gank_class_tv);
    mMarqueeTextView.setEllipsize(TextUtils.TruncateAt.MARQUEE);
    mMarqueeTextView.setSingleLine(true);
    mShareIbtn = (ImageButton) findViewById(R.id.title_detail_gank_share_ibtn);
    mNumberProgressBar = (NumberProgressBar) findViewById(R.id.find_gank_detail_numpbar);
    mWebView = (WebView) findViewById(R.id.find_gank_detail_wv);
}
 
开发者ID:absentm,项目名称:myapplication,代码行数:10,代码来源:FindGankDetailAty.java

示例13: FaceDetect

import com.daimajia.numberprogressbar.NumberProgressBar; //导入依赖的package包/类
public FaceDetect(Activity activity) {
    this.context = activity;
    trackedFaces = new LinkedList<>();
    progressHappy = (NumberProgressBar) activity.findViewById(R.id.progress_happy);
    progressAnger = (NumberProgressBar) activity.findViewById(R.id.progress_anger);
    progressSurprise = (NumberProgressBar) activity.findViewById(R.id.progress_surprise);
    progressNeutral = (NumberProgressBar) activity.findViewById(R.id.progress_neutral);
    progressDisgust = (NumberProgressBar) activity.findViewById(R.id.progress_disgust);

    detectorNameCamera = new String[2];
    detectorNameCamera[FRONT_CAMERA] = "front camera";
    detectorNameCamera[BACK_CAMERA] = "back camera";
}
 
开发者ID:rafaelaaraujo,项目名称:Face-detect-framework,代码行数:14,代码来源:FaceDetect.java

示例14: onCreate

import com.daimajia.numberprogressbar.NumberProgressBar; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    tvMsg = (TextView) findViewById(R.id.tv_msg);
    findViewById(R.id.btn_simple).setOnClickListener(this);
    findViewById(R.id.btn_rx).setOnClickListener(this);
    findViewById(R.id.btn_rx_mu_down).setOnClickListener(this);
    findViewById(R.id.btn_rx_uploade).setOnClickListener(this);
    img=(ImageView)findViewById(R.id.img);
    progressBar=(NumberProgressBar)findViewById(R.id.number_progress_bar);
}
 
开发者ID:wzgiceman,项目名称:RxjavaRetrofitDemo-master,代码行数:13,代码来源:MainActivity.java

示例15: onCreate

import com.daimajia.numberprogressbar.NumberProgressBar; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mPresenter = new VideoPresenter(this);

    webVideoView = (WebVideoView) findViewById(R.id.web_video_view);
    numberProgressBar = (NumberProgressBar) findViewById(R.id.number_progress_bar);
    mToolbar.setBackgroundColor(Color.TRANSPARENT);
    mAppBarLayout.setBackgroundColor(Color.TRANSPARENT);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        mAppBarLayout.setElevation(0);
    }

    Intent intent = getIntent();
    if (intent == null) {
        finish();
    }
    if (TextUtils.isEmpty(intent.getStringExtra(WEB_TITLE))) {
        setTitle(getString(R.string.app_name));
    } else {
        setTitle(getIntent().getStringExtra(WEB_TITLE));
    }
    if (TextUtils.isEmpty(intent.getStringExtra(WEB_URL))) {
        finish();
    } else {
        mPresenter.loadWebVideo(webVideoView, getIntent().getStringExtra(WEB_URL));
    }
}
 
开发者ID:ChristianFF,项目名称:Lumei.a,代码行数:29,代码来源:WebVideoActivity.java


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