Skip to content

Commit 397856d

Browse files
committed
更新到2.0版本
1. 代码重构+优化 2. 增加所有xml配置项的代码设置方法(mCountdownView.dynamicShow(DynamicConfig dynamicConfig)) 3. 增加代码动态配置的Demo界面 4. fix #8 4. fix #9
1 parent 0513f3f commit 397856d

File tree

2 files changed

+44
-32
lines changed

2 files changed

+44
-32
lines changed

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,20 @@
88
# CountdownView
99
Android Countdown Widget,Use canvas draw,Supports Multiple styles
1010

11-
### screenshot
12-
![](https://raw.githubusercontent.com/iwgang/CountdownView/master/screenshot/screenshot.gif)
13-
![](https://raw.githubusercontent.com/iwgang/CountdownView/master/screenshot/screenshot2.png)
11+
[Download demo apk](https://raw.githubusercontent.com/iwgang/CountdownView/master/Demo_2.0.apk.apk)
1412

15-
### gradle
16-
compile 'com.github.iwgang:countdownview:1.2'
13+
### Screenshot
14+
![](https://raw.githubusercontent.com/iwgang/CountdownView/master/screenshot/g_main.gif)
1715

18-
### code
16+
![](https://raw.githubusercontent.com/iwgang/CountdownView/master/screenshot/g_config.gif)
17+
![](https://raw.githubusercontent.com/iwgang/CountdownView/master/screenshot/g_config2.gif)
18+
19+
<img src="https://raw.githubusercontent.com/iwgang/CountdownView/master/screenshot/s_list.jpg" width="400px" height="650px"/>
20+
21+
### Gradle
22+
compile 'com.github.iwgang:countdownview:2.0'
23+
24+
### Code
1925
```
2026
CountdownView mCvCountdownView = (CountdownView)findViewById(R.id.cv_countdownViewTest1);
2127
mCvCountdownView.start(995550000); // Millisecond
@@ -26,7 +32,7 @@ for (int time=0; time<1000; time++) {
2632
}
2733
```
2834

29-
### layout
35+
### Layout
3036
``` xml
3137
<cn.iwgang.countdownview.CountdownView
3238
android:layout_width="wrap_content"
@@ -49,7 +55,7 @@ for (int time=0; time<1000; time++) {
4955
app:suffixMillisecond="毫秒" />
5056
```
5157

52-
### customization
58+
### Customization
5359
attr | type | default
5460
--- | --- | ---
5561
isHideTimeBackground | boolean | true
@@ -88,8 +94,8 @@ suffixSecondLeftMargin | dimension | 0
8894
suffixSecondRightMargin | dimension | 0
8995
suffixMillisecondLeftMargin | dimension | 0
9096

91-
### artifice
92-
1. multiple countdownView specified value
97+
### Other
98+
* **Multiple countdownView specified value**
9399
```
94100
// step 1
95101
mCvCountdownView.setTag(R.id.name, uid);
@@ -102,15 +108,15 @@ suffixMillisecondLeftMargin | dimension | 0
102108
}
103109
}
104110
```
105-
2. dynamic show
111+
* **Dynamic show**
106112
```
107-
customTimeShow(boolean isShowDay, boolean isShowHour, boolean isShowMinute, boolean isShowSecond, boolean isShowMillisecond)
113+
dynamicShow(DynamicConfig dynamicConfig)
108114
```
109-
3. countdown complete callback
115+
* **Countdown complete callback**
110116
```
111117
setOnCountdownEndListener(OnCountdownEndListener onCountdownEndListener);
112118
```
113-
4. interval callback
119+
* **Interval callback**
114120
```
115121
setOnCountdownIntervalListener(long interval, OnCountdownIntervalListener onCountdownIntervalListener);
116-
```
122+
```

README_CN.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
[![Android Gems](http://www.android-gems.com/badge/iwgang/CountdownView.svg?branch=master)](http://www.android-gems.com/lib/iwgang/CountdownView)
22
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-CountdownView-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/2641)
3-
[![@iwgang](https://img.shields.io/badge/微博-%40iwgang-blue.svg)](http://weibo.com/iwgang)
3+
[![@iwgang](https://img.shields.io/badge/weibo-%40iwgang-blue.svg)](http://weibo.com/iwgang)
44

55
#### [English](https://github.com/iwgang/CountdownView/blob/master/README.md)
66

77

88
# CountdownView
9-
Android 倒计时控件,使用Canvas绘制,支持多种样式
9+
Android倒计时控件,使用Canvas绘制,支持多种样式
1010

11-
### screenshot
12-
![](https://raw.githubusercontent.com/iwgang/CountdownView/master/screenshot/screenshot.gif)
13-
![](https://raw.githubusercontent.com/iwgang/CountdownView/master/screenshot/screenshot2.png)
11+
[下载DemoAPK](https://raw.githubusercontent.com/iwgang/CountdownView/master/Demo_2.0.apk.apk)
1412

15-
### gradle
16-
compile 'com.github.iwgang:countdownview:1.2'
13+
### Screenshot
14+
![](https://raw.githubusercontent.com/iwgang/CountdownView/master/screenshot/g_main.gif)
1715

18-
### code
16+
![](https://raw.githubusercontent.com/iwgang/CountdownView/master/screenshot/g_config.gif)
17+
![](https://raw.githubusercontent.com/iwgang/CountdownView/master/screenshot/g_config2.gif)
18+
19+
<img src="https://raw.githubusercontent.com/iwgang/CountdownView/master/screenshot/s_list.jpg" width="400px" height="650px"/>
20+
21+
### Gradle
22+
compile 'com.github.iwgang:countdownview:2.0'
23+
24+
### Code
1925
```
2026
CountdownView mCvCountdownView = (CountdownView)findViewById(R.id.cv_countdownViewTest1);
2127
mCvCountdownView.start(995550000); // 毫秒
@@ -26,7 +32,7 @@ for (int time=0; time<1000; time++) {
2632
}
2733
```
2834

29-
### layout
35+
### Layout
3036
``` xml
3137
<cn.iwgang.countdownview.CountdownView
3238
android:layout_width="wrap_content"
@@ -49,7 +55,7 @@ for (int time=0; time<1000; time++) {
4955
app:suffixMillisecond="毫秒" />
5056
```
5157

52-
### customization
58+
### Customization
5359
参数 | 类型 | 默认值
5460
--- | --- | ---
5561
isHideTimeBackground | boolean | true
@@ -88,8 +94,8 @@ suffixSecondLeftMargin | dimension | 0
8894
suffixSecondRightMargin | dimension | 0
8995
suffixMillisecondLeftMargin | dimension | 0
9096

91-
### 技巧
92-
1. 多个CountdownView时,给每个指定值
97+
### 其它
98+
* **多个CountdownView时,给每个指定值**
9399
```
94100
// 第1步,设置tag
95101
mCvCountdownView.setTag(R.id.name, uid);
@@ -102,15 +108,15 @@ suffixMillisecondLeftMargin | dimension | 0
102108
}
103109
}
104110
```
105-
2. 动态显示/隐藏某些时间 (如:开始显示时、分、秒,后面到指定时间改成分、秒、毫秒)
111+
* **动态显示设置, 支持所有xml中的配置项来使用java代码设置**
106112
```
107-
customTimeShow(boolean isShowDay, boolean isShowHour, boolean isShowMinute, boolean isShowSecond, boolean isShowMillisecond)
113+
dynamicShow(DynamicConfig dynamicConfig)
108114
```
109-
3. 倒计时结束后回调
115+
* **倒计时结束后回调**
110116
```
111117
setOnCountdownEndListener(OnCountdownEndListener onCountdownEndListener);
112118
```
113-
4. 指定间隔时间回调
119+
* **指定间隔时间回调**
114120
```
115121
setOnCountdownIntervalListener(long interval, OnCountdownIntervalListener onCountdownIntervalListener);
116-
```
122+
```

0 commit comments

Comments
 (0)