5 Star 1 Fork 0

HarmonyOS-TPC / SectorProgressView

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

该三方开源库从github fork过来

fork地址:https://github.com/timqi/SectorProgressView

fork版本号/日期:0.9.9 / 2021/2/7

SectorProgressView

效果展示

添加库的依赖

方式一: 添加har包到lib文件夹内 在entry的gradle内添加如下代码 implementation fileTree(dir: 'libs', include: ['.jar', '.har'])

方式二: allprojects { repositories{ mavenCentral() } } implementation 'io.openharmony.tpc.thirdlib:SectorProgressView:1.0.0'

How to use:

The ColorfulRingProgressView

  • Define views in xml
 <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" />
  • parameters description

parameters description

  • You can custom view using java code
crpv = (ColorfulRingProgressView) findViewById(R.id.crpv);
crpv.setPercent(75);
crpv.setStartAngle(0);
crpv.setBgColor(0xffe1e1e1);
crpv.setFgColorStart(0xffffe400);
crpv.setFgColorEnd(0xffff4800);
crpv.setStrokeWidthDp(21);

The SectorProgressView

  • Define views in xml
<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" />
  • You can custom view using java code
spv = (SectorProgressView) findViewById(R.id.spv);
spv.setPercent(25);
spv.setStartAngle(0);
spv.setBgColor(0xffe5e5e5);
spv.setFgColor(0xffff765c);

Indeterminate status

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.

Integration

  • Using gradle. Add the dependency in your app.gradle



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.
该三方开源库从github fork过来 fork地址:https://github.com/timqi/SectorProgressView fork版本号/日期:0.9.9 / 2021/2/7 SectorProgressView ================== 效果展示 <img src="https://gitee.com/openharmony-tpc/SectorProgressView/raw/master/SectorProgressView2.gif" width="40%"/> <img src="https://gitee.com/openharmony-tpc/SectorProgressView/raw/master/SectorProgressView1.gif" width="40%"/> 添加库的依赖 方式一: 添加har包到lib文件夹内 在entry的gradle内添加如下代码 implementation fileTree(dir: 'libs', include: ['.jar', '.har']) 方式二: allprojects { repositories{ mavenCentral() } } implementation 'io.openharmony.tpc.thirdlib:SectorProgressView:1.0.0' How to use: =========== ## The ColorfulRingProgressView - Define views in xml ```xml <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" /> ``` - parameters description ![parameters description](https://github.com/timqi/SectorProgressView/raw/master/art/d.png) - You can custom view using java code ```java crpv = (ColorfulRingProgressView) findViewById(R.id.crpv); crpv.setPercent(75); crpv.setStartAngle(0); crpv.setBgColor(0xffe1e1e1); crpv.setFgColorStart(0xffffe400); crpv.setFgColorEnd(0xffff4800); crpv.setStrokeWidthDp(21); ``` ## The SectorProgressView - Define views in xml ```xml <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" /> ``` - You can custom view using java code ```java spv = (SectorProgressView) findViewById(R.id.spv); spv.setPercent(25); spv.setStartAngle(0); spv.setBgColor(0xffe5e5e5); spv.setFgColor(0xffff765c); ``` ## Indeterminate status This library add a API for indeterminate status of SectorProgressView and ColorfulRingProgressView. Config your angle or percent params and invoke animateIndeterminate ```java 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. Integration ============ - Using gradle. Add the dependency in your app.gradle ``` 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. ```

简介

a simple progress prompt or chart widget of android using circle and a sector 展开 收起
Java 等 2 种语言
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/HarmonyOS-tpc/SectorProgressView.git
git@gitee.com:HarmonyOS-tpc/SectorProgressView.git
HarmonyOS-tpc
SectorProgressView
SectorProgressView
master

搜索帮助