https://github.com/samlss/fanloadingview
🌀A fan rotation loading view(一个风扇旋转的loading view).
https://github.com/samlss/fanloadingview
android loadingview
Last synced: about 1 year ago
JSON representation
🌀A fan rotation loading view(一个风扇旋转的loading view).
- Host: GitHub
- URL: https://github.com/samlss/fanloadingview
- Owner: samlss
- License: mit
- Created: 2018-08-13T07:40:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-13T08:15:54.000Z (over 7 years ago)
- Last Synced: 2025-01-12T14:32:42.159Z (about 1 year ago)
- Topics: android, loadingview
- Language: Java
- Homepage:
- Size: 223 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FanLoadingView
A fan rotation loading view(一个风扇旋转的loading view).
[](https://github.com/samlss/FanLoadingView) [](https://github.com/samlss/FanLoadingView/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:FanLoadingView:1.0'
}
```
布局中使用:
```
```
代码中使用:
```
fanLoadingView.pause(); //暂停动画
fanLoadingView.resume(); //恢复动画
fanLoadingView.start(); //开始动画
fanLoadingView.stop(); //停止动画
fanLoadingView.setColor(Color.RED); //设置风扇主体颜色
```
属性说明:
| 属性 | 说明 |
| ------------- |:-------------:|
| main_color | 风扇主体颜色 |
| 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:FanLoadingView:1.0'
}
```
in layout.xml:
```
```
in java code:
```
fanLoadingView.pause(); //pause animation
fanLoadingView.resume(); //resume animation
fanLoadingView.start(); //start animation
fanLoadingView.stop(); //stop animation
fanLoadingView.setColor(Color.RED); //set the color of fan
```
Attributes description:
| attr | description |
| ------------- |:-------------:|
| main_color | the color |
| interpolator | the animator interpolator |
### interpolator:
* AccelerateDecelerateInterpolator
* AccelerateInterpolator
* DecelerateInterpolator
* BounceInterpolator
* CycleInterpolator
* LinearInterpolator
* AnticipateOvershootInterpolator
* AnticipateInterpolator
* OvershootInterpolator
[id]: http://example.com/ "Optional Title Here"
## [LICENSE](https://github.com/samlss/FanLoadingView/blob/master/LICENSE)