# WhorlView **Repository Path**: HarmonyOS-tpc/WhorlView ## Basic Information - **Project Name**: WhorlView - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-04-01 - **Last Updated**: 2023-04-17 ## Categories & Tags **Categories**: harmonyos-loading **Tags**: None ## README # WhorlView 一个加载View ## 预览 ![https://raw.githubusercontent.com/Kyson/WhorlView/master/art/whorl_progress_showcase.gif](https://raw.githubusercontent.com/Kyson/WhorlView/master/art/whorl_progress_showcase.gif) ## 如何编译 >+ entry的config.json的"visible": false 需要删除后模拟器才可运行 >+ 将项目根目录的build.gradle文件中dependencies→classpath版本改为对应的版本(即你的IDE新建项目中所用的版本),必要时还需修改maven ## 使用 ### step1 ``` 方式一: 通过library生成har包,添加har包到libs文件夹内 在entry的gradle内添加如下代码 implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) 方式二: allprojects{ repositories{ mavenCentral() } } implementation 'io.openharmony.tpc.thirdlib:WhorlView-Library:1.0.0' ``` ### step2 在xml中添加WhorlView ```xml ``` ### step3 开始动画 ```java WhorlView whorlView1 = (WhorlView) findComponentById(ResourceTable.Id_whorl2); whorlView1.start(); ``` ## XML自定义属性 |属性|类型|说明|默认值| |---|---|---|---| |circle_colors|string|圆弧颜色|由外向内依次为红绿蓝| |circle_speed|int|转圈速度|270度每秒| |parallax|enum|视差效果|72度每秒| |sweepAngle|float|弧度|90度| |strokeWidth|float|弧宽|5f| > whorlview_circle_colors属性值应该为<色值>\_<色值>\_<色值>,以\_为分隔符,其中色值为#开头的6位或8位16进制数 ## API 提供的api就两个,开始和停止。 `whorlView.start();` `whorlView.stop();` ## License Copyright (c) 2015 Kyson Licensed under the Apache License, Version 2.0