代码拉取完成,页面将自动刷新
该三方开源库从github fork过来
fork地址:https://github.com/timqi/SectorProgressView
fork版本号/日期:0.9.9 / 2021/2/7
效果展示
添加库的依赖
方式一: 添加har包到lib文件夹内 在entry的gradle内添加如下代码 implementation fileTree(dir: 'libs', include: ['.jar', '.har'])
方式二: allprojects { repositories{ mavenCentral() } } implementation 'io.openharmony.tpc.thirdlib:SectorProgressView:1.0.0'
<com.timqi.sectorprogressview.ColorfulRingProgressView
ohos:id="$+id:crpv"
ohos:width="match_parent"
ohos:height="match_parent"
app:bgColor="#e1e1e1"
app:fgColorEnd="#ff4800"
app:fgColorStart="#ffe400"
app:percent="75"
app:startAngle="0"
app:strokeWidth="21vp" />
crpv = (ColorfulRingProgressView) findViewById(R.id.crpv);
crpv.setPercent(75);
crpv.setStartAngle(0);
crpv.setBgColor(0xffe1e1e1);
crpv.setFgColorStart(0xffffe400);
crpv.setFgColorEnd(0xffff4800);
crpv.setStrokeWidthDp(21);
<com.timqi.sectorprogressview.SectorProgressView
ohos:id="$+id:spv"
ohos:width="200vp"
ohos:height="200vp"
ohos:horizontal_center="true"
ohos:top_margin="40vp"
app:bgColor="#e1e1e1"
app:fgColorEnd="#ff4800"
app:fgColorStart="#ffe400"
app:percent="25"
app:startAngle="0" />
spv = (SectorProgressView) findViewById(R.id.spv);
spv.setPercent(25);
spv.setStartAngle(0);
spv.setBgColor(0xffe5e5e5);
spv.setFgColor(0xffff765c);
This library add a API for indeterminate status of SectorProgressView and ColorfulRingProgressView. Config your angle or percent params and invoke animateIndeterminate
animateIndeterminate()
// if you want custom the duration or TimeInterpolator
animateIndeterminate(int durationOneCircle, TimeInterpolator interpolator)
// to stop animate
stopAnimateIndeterminate()
download demo apk to have a taste.
Author
========
License
=======
Copyright 2017 Tim Qi
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.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型