# materialish-progress **Repository Path**: hihopeorg/materialish-progress ## Basic Information - **Project Name**: materialish-progress - **Description**: No description available - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-02-27 - **Last Updated**: 2021-10-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MaterialishProgress 本项目是基于开源项目Materialish-Progress进行ohos化的移植和开发的,可以通过项目标签以及github地址(https://github.com/nico2sh/materialish-progress ) 追踪到原项目版本 #### 项目介绍 - 项目名称:Material风格的旋转Progress - 所属系列:ohos的第三方组件适配移植 - 功能:可以旋转的Progress,可以设置progress的颜色,宽度,进度监听等。 - 项目移植状态:完成 - 调用差异:无 - 项目作者和维护人:hihope - 联系方式:hihope@hoperun.com - 原项目Doc地址:https://github.com/nico2sh/materialish-progres - 原项目基线版本:无基线版本 - 编程语言:Java #### 演示效果 ![Image text](/screenshot/Materialish-Progress.gif) #### 安装教程 方法1. 1. 下载har包MaterialishProgress.har。 2. 启动 DevEco Studio,将下载的har包,导入工程目录“entry->libs”下。 3. 在moudle级别下的build.gradle文件中添加依赖,在dependences标签中增加对libs目录下har包的引用。 ``` repositories { flatDir { dirs 'libs' } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) implementation(name: 'MaterialishProgress', ext: 'har') …… } ``` 方法2. 1. 在工程的build.gradle的allprojects中,添加HAR所在的Maven仓地址 ``` repositories { maven { url 'http://106.15.92.248:8081/repository/Releases/' } } ``` 2. 在应用模块的build.gradle的dependencies闭包中,添加如下代码: ``` dependencies { implementation 'com.pnikosis.ohos:materialish-progress:1.0.1' } ``` #### 使用说明 1. 我们可以像这样在xml中定义:(记得添加```xmlns:wheel="http://schemas.huawei.com/apk/res/ohos""```) ```xml ``` 2. 你可以这样去设置进度改变的回调。 ```java progressWheelLinear.setCallback(new ProgressWheel.ProgressCallback() { @Override public void onProgressUpdate(float progress) { linearValue.setText(String.format("%.2f", progress)); } }); ``` 如果要使wheel旋转,你可以调用```spin()``` 方法,如果你设了一个进度值,wheel将停止旋转。 ### Fill radius 如果你想旋转的ProgressWheel充满整个layout,而不是设置一个固定的大小,你可以使用 ```matProg_fillRadius```. ```xml ``` ### 自定义属性介绍: * matProg_progressIndeterminate: boolean, ProgressWheel是否立刻转动。 * matProg_barColor: color, 进度条颜色 * matProg_barWidth: dimension, 进度条宽度 * matProg_rimColor: color, 进度条背景色 * matProg_rimWidth: dimension, 进度条背景宽度 * matProg_spinSpeed: float, 旋转速度,如果设为1.0,表示1s转1圈。 * matProg_barSpinCycleTime: integer, 完成动画所需的时间。 * matProg_circleRadius: dimension,progress wheel的半径, 如果你设了fillRadius为true,将会被忽略。 * matProg_fillRadius: boolean, 如果你想progress wheel充满整个布局,你可以设为True。 * matProg_linearProgress: boolean, 如果你想确定的进度值有一个线性变化,你可以设为True。 #### 版本迭代 - v1.0.1 #### 版权和许可信息 ------- Copyright Apache License 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.