Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

圆形加载进度条

NotificationsYou must be signed in to change notification settings

linux-liu/LoadView

Repository files navigation

一个带进度圆形进度条效果图如下:
效果图
###用法直接调用setPercent方法设置进度即可,如下代码模拟下载

publicvoiddownLoad(Viewview) {newTimeDown(12*1000,1000).start();    }privateclassTimeDownextendsCountDownTimer{privatefloati=0;/**         * @param millisInFuture    The number of millis in the future from the call         *                          to {@link #start()} until the countdown is done and {@link #onFinish()}         *                          is called.         * @param countDownInterval The interval along the way to receive         *                          {@link #onTick(long)} callbacks.         */publicTimeDown(longmillisInFuture,longcountDownInterval) {super(millisInFuture,countDownInterval);i=0;loadView.setPercent(0);        }@OverridepublicvoidonTick(longmillisUntilFinished) {Log.i("lx","onTick"+millisUntilFinished);loadView.setPercent(i);i=i+0.083333f;        }@OverridepublicvoidonFinish() {loadView.setPercent(1f);        }    }

支持自定义参数如下:

    <declare-styleablename="LoadView"><!-- 已经load的颜色值-->        <attrname="HasLoadColor"format="color" /><!-- 没有load的颜色值-->        <attrname="NormalLoadColor"format="color" /><!-- 小长方形的宽度-->        <attrname="RectangleWidth"format="dimension" /><!-- 小长方形的高度-->        <attrname="RectangleHeight"format="dimension" /><!-- 小长方形的个数-->        <attrname="RectangleNum"format="integer" /><!-- 内半径大小-->        <attrname="InnerRadius"format="dimension" /><!-- 文字大小-->        <attrname="TextSize"format="dimension" /><!-- 小长方形圆角度-->        <attrname="RectangleRadius"format="dimension" />    </declare-styleable>

###其他
带进度的圆形进度条的实现

About

圆形加载进度条

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp