zoukankan      html  css  js  c++  java
  • HoloCircularProgressBar 使用

    圆形进度条

    <com.pascalwelsch.holocircularprogressbar.HoloCircularProgressBar
                    android:id="@+id/holoCircularProgressBar"
                    android:layout_width="300dp"
                    android:layout_height="300dp"
                    app:marker_progress="1"
                    app:marker_visible="false"
                    app:thumb_visible="false"
                    app:progress="0"
                    />

    其中: mark_progress 为目标进度

       thumb_visible 为走动的指示

    progress 初始的进度位置

       progress_color颜色

    调用动画

    private void animate(final HoloCircularProgressBar progressBar, final Animator.AnimatorListener listener,
                             final float progress, final int duration) {
    
            mProgressBarAnimator = ObjectAnimator.ofFloat(progressBar, "progress", progress);
            mProgressBarAnimator.setDuration(duration);
    
            mProgressBarAnimator.addListener(new Animator.AnimatorListener() {
    
                @Override
                public void onAnimationCancel(final Animator animation) {
                }
    
                @Override
                public void onAnimationEnd(final Animator animation) {
                    progressBar.setProgress(progress);
                }
    
                @Override
                public void onAnimationRepeat(final Animator animation) {
                }
    
                @Override
                public void onAnimationStart(final Animator animation) {
                }
            });
            if (listener != null) {
                mProgressBarAnimator.addListener(listener);
            }
            mProgressBarAnimator.reverse();
            mProgressBarAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
    
                @Override
                public void onAnimationUpdate(final ValueAnimator animation) {
                    progressBar.setProgress((Float) animation.getAnimatedValue());
                }
            });
            progressBar.setMarkerProgress(progress);
            mProgressBarAnimator.start();
        }
  • 相关阅读:
    Coding Souls团队---电梯演讲
    第一次团队会议总结-NABCD分析
    软件工程团队项目介绍
    python进行四舍五入
    python列表元素两两比较
    Linux常用命令
    谷歌日历的正确用法--在谷歌日历中添加农历、天气、中国节假日
    Nose框架的安装
    python中staticmethod装饰器的作用
    python 3.x与python 2.7.x在语法上的区别
  • 原文地址:https://www.cnblogs.com/qingducx/p/5233592.html
Copyright © 2011-2022 走看看