An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

# WhirlLoadingView
A loading view that includes two rotating arcs(一个包含两条圆弧互相旋转的loading view).

[![Api reqeust](https://img.shields.io/badge/api-11+-green.svg)](https://github.com/samlss/WhirlLoadingView) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/samlss/WhirlLoadingView/blob/master/LICENSE) [![Blog](https://img.shields.io/badge/samlss-blog-orange.svg)](https://blog.csdn.net/Samlss)


* [中文](#%E4%B8%AD%E6%96%87)
* [English](#english)
* [License](#license)


![gif](https://github.com/samlss/WhirlLoadingView/blob/master/screenshots/screenshot.gif)

## 中文

### 使用

在根目录的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)