自定义圆形进度条 自定义倒计时进度条。继承自Textview,可以顺序旋转,可以倒叙旋转,可以设置进度条颜色,填充颜色,可以设置进度条宽度,可以设置填充颜色点击效果,文字点击效果。
: http://www.yanzhenjie.com : http://blog.csdn.net/yanzhenjie1003
TextViewTextView
CircleTextProgressbar
start()``reStart()
OK
setProgress()
progress
// 0-100
progressBar.setProgressType(CircleTextProgressbar.ProgressType.COUNT);
//
progressBar.setProgressLineWidth(30);//
// 3000
progressBar.setTimeMillis(3500);
//
progressBar.setProgressColor(Color.RED);
//
progressBar.setOutLineColor(Color.RED);
//
progressBar.setInCircleColor(Color.RED);
//
progressBar.start();
// 100
progressBar.setProgress(100);
//
progressBar1.setCountdownProgressListener(1, progressListener);
progressBar2.setCountdownProgressListener(2, progressListener);
OnCountdownProgressListener progressListener = new OnCountdownProgressListener() {
@Override
public void onProgress(int what, int progress) {
if (what == 1) {
progressBar1.setText(progress + "%");
} else if (what == 2) {
progressBar2.setText(progress + "%");
}
// 1000
}
};
CircleTextProgressbar``ReletiveLayot
ReletiveLayot``CircleTextProgressbar``onMeasure()
xmlCircleTextProgressbar``50dp
Copyright 2016 Yan Zhenjie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.