Skip to content

Commit 4549219

Browse files
author
imkarl
committed
Update README.md
1 parent 039edf7 commit 4549219

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,83 @@
11
# WaitView
22
显示等待加载状态的View
3+
4+
[![](https://jitpack.io/v/imkarl/WaitView.svg)](https://jitpack.io/#imkarl/WaitView)
5+
6+
7+
# Introduce
8+
9+
- 默认状态
10+
11+
![](https://github.com/ImKarl/WaitView/blob/master/captures/layout_default.png)
12+
13+
- 等待加载的状态
14+
15+
![](https://github.com/ImKarl/WaitView/blob/master/captures/layout_waitview.png)
16+
17+
18+
# Features
19+
20+
- 简单高效,一句话完成所有控件的状态切换、恢复
21+
- 兼容性强,支持所有系统控件、自定义控件
22+
- 可定制性,自定义渲染规则,按需配置
23+
24+
25+
# Usage
26+
27+
Gradle:
28+
29+
```
30+
compile 'com.github.ImKarl:WaitView:{latestVersion}'
31+
```
32+
33+
34+
# Sample
35+
36+
- 渲染
37+
38+
```
39+
单个View
40+
WaitViewController.from(mRootView).render();
41+
42+
所有子View
43+
WaitViewController.from(mRootView).renderChilds();
44+
```
45+
46+
47+
- 移除
48+
49+
```
50+
单个View
51+
WaitViewController.from(mRootView).remove();
52+
53+
所有子View
54+
WaitViewController.from(mRootView).removeChilds();
55+
```
56+
57+
58+
- 额外的可配置项
59+
60+
```
61+
WaitViewController controller = WaitViewController.from(mRootView);
62+
63+
颜色:@ColorInt
64+
controller.color(color);
65+
66+
透明度:@IntRange(from=0, to=255)
67+
controller.alpha(alpha);
68+
69+
圆角半径:radius
70+
controller.radius(radius);
71+
72+
绘制区域:如 new Rect(0, 0, view.getWidth(), view.getHeight())
73+
controller.drawRect(rect);
74+
controller.drawRect(width, height);
75+
76+
过滤器:如 new SimpleOnWaitViewFilter()
77+
controller.filter(filter);
78+
```
79+
80+
81+
- 更详细的案例
82+
83+
请查看 [sample](https://github.com/ImKarl/WaitView/blob/master/library/src/java/cn/imkarl/waitview/sample/MainActivity.java)

captures/layout_default.png

11.3 KB
Loading

captures/layout_waitview.png

4.65 KB
Loading

0 commit comments

Comments
 (0)