https://github.com/samlss/clockloadingview
🕞A clock loading view.
https://github.com/samlss/clockloadingview
android loadingview
Last synced: 11 months ago
JSON representation
🕞A clock loading view.
- Host: GitHub
- URL: https://github.com/samlss/clockloadingview
- Owner: samlss
- License: mit
- Created: 2018-07-24T12:38:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-10T02:30:12.000Z (over 7 years ago)
- Last Synced: 2025-04-08T11:37:59.983Z (about 1 year ago)
- Topics: android, loadingview
- Language: Java
- Homepage:
- Size: 523 KB
- Stars: 7
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ClockLoadingView
A clock loading view(一个时钟loading view).
[](https://github.com/samlss/ClockLoadingView) [](https://github.com/samlss/ClockLoadingView/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:ClockLoadingView:1.1'
}
```
布局中使用:
```
```
代码中使用:
```
clockLoadingView.start(); //开始动画
clockLoadingView.stop(); //结束动画
clockLoadingView.setCircleColor(getResources().getColor(R.color.green)); //设置圆描边的颜色
clockLoadingView.setCenterColor(getResources().getColor(R.color.yellow)); //设置圆心颜色
clockLoadingView.setHourHandColor(getResources().getColor(R.color.orange)); //设置时针颜色
clockLoadingView.setMinHandColor(getResources().getColor(R.color.red)); //设置分针颜色
```
在Activity结束的时候调用一下接口进行释放:
```
@Override
protected void onPause() {
super.onPause();
if (isFinishing()){
clockLoadingView.release();
}
}
```
属性说明:
| 属性 | 说明 |
| ------------- |:-------------:|
| circle_color | 圆的描边颜色 |
| center_color | 圆心颜色 |
| hour_hand_color | 时针颜色 |
| minute_hand_color | 分针颜色 |
如果不能满足你的需要,你可以下载源码自行修改。
## 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:ClockLoadingView:1.1'
}
```
in layout.xml:
```
```
in java code:
```
clockLoadingView.start(); //start animation
clockLoadingView.stop(); //stop animation
clockLoadingView.setCircleColor(getResources().getColor(R.color.green)); //set the circle stroke color
clockLoadingView.setCenterColor(getResources().getColor(R.color.yellow)); //set the circle center color
clockLoadingView.setHourHandColor(getResources().getColor(R.color.orange)); //set the hour hand color
clockLoadingView.setMinHandColor(getResources().getColor(R.color.red)); //set the minute hand color
```
Call the below mehod to release when the activity is finishing.:
```
@Override
protected void onPause() {
super.onPause();
if (isFinishing()){
clockLoadingView.release();
}
}
```
Attributes description:
| attr | description |
| ------------- |:-------------:|
| circle_color | the circle stroke color |
| center_color | the circle center color |
| hour_hand_color | the hour hand color |
| minute_hand_color | the minute hand color |
If you can not meet your needs, you can download the source code to modify it.
[id]: http://example.com/ "Optional Title Here"
## [LICENSE](https://github.com/samlss/PeasLoadingView/blob/master/LICENSE)