https://github.com/samlss/whirlloadingview
🍩A loading view that includes two rotating arcs.
https://github.com/samlss/whirlloadingview
android loadingview
Last synced: 4 months ago
JSON representation
🍩A loading view that includes two rotating arcs.
- Host: GitHub
- URL: https://github.com/samlss/whirlloadingview
- Owner: samlss
- License: mit
- Created: 2018-08-17T08:10:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-17T08:28:09.000Z (over 7 years ago)
- Last Synced: 2025-03-02T01:43:21.702Z (about 1 year ago)
- Topics: android, loadingview
- Language: Java
- Homepage:
- Size: 268 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WhirlLoadingView
A loading view that includes two rotating arcs(一个包含两条圆弧互相旋转的loading view).
[](https://github.com/samlss/WhirlLoadingView) [](https://github.com/samlss/WhirlLoadingView/blob/master/LICENSE) [](https://blog.csdn.net/Samlss)
* [中文](#%E4%B8%AD%E6%96%87)
* [English](#english)
* [License](#license)

## 中文
### 使用
在根目录的build.gradle添加这一句代码:
```
allprojects {
repositories {
//...
maven { url 'https://jitpack.io' }
}
}
```
在app目录下的build.gradle添加依赖使用:
```
dependencies {
implementation 'com.github.samlss:WhirlLoadingView:1.0'
}
```
布局中使用:
```
```
代码中使用:
```
whirlLoadingView.pause(); //暂停动画
whirlLoadingView.resume(); //恢复动画
whirlLoadingView.start(); //开始动画
whirlLoadingView.stop(); //停止动画
whirlLoadingView.release(); //不需要使用该loading view的时候可手动释放,例如在activity的ondestroy()中
whirlLoadingView.setColor(Color.RED); //圆弧颜色
```
属性说明:
| 属性 | 说明 |
| ------------- |:-------------:|
| loadingColor | 旋转圆弧的颜色 |
| duration | 动画时间 |
| interpolator | 动画加速器 |
### 插值器值interpolator:
* AccelerateDecelerateInterpolator
* AccelerateInterpolator
* DecelerateInterpolator
* BounceInterpolator
* CycleInterpolator
* LinearInterpolator
* AnticipateOvershootInterpolator
* AnticipateInterpolator
* OvershootInterpolator
## English
### Use
Add it in your root build.gradle at the end of repositories:
```
allprojects {
repositories {
//...
maven { url 'https://jitpack.io' }
}
}
```
Add it in your app build.gradle at the end of repositories:
```
dependencies {
implementation 'com.github.samlss:WhirlLoadingView:1.0'
}
```
in layout.xml:
```
```
in java code:
```
whirlLoadingView.pause(); //pause animation
whirlLoadingView.resume(); //resume animation
whirlLoadingView.start(); //start animation
whirlLoadingView.stop(); //stop animation
whirlLoadingView.release(); //Can 'released' when you don't need to use the loading view, for example in the activity's onDestroy()
whirlLoadingView.setColor(Color.RED); //set the color of the arcs
```
Attributes description:
| attr | description |
| ------------- |:-------------:|
| loadingColor | the color of the rotating arcs |
| duration | the animation duration |
| interpolator | the animation interpolator |
### interpolator:
* AccelerateDecelerateInterpolator
* AccelerateInterpolator
* DecelerateInterpolator
* BounceInterpolator
* CycleInterpolator
* LinearInterpolator
* AnticipateOvershootInterpolator
* AnticipateInterpolator
* OvershootInterpolator
[id]: http://example.com/ "Optional Title Here"
## [LICENSE](https://github.com/samlss/WhirlLoadingView/blob/master/LICENSE)