Skip to content

Commit 528f540

Browse files
author
zengsong
committed
Merge remote-tracking branch 'origin/master'
2 parents 4e38e3d + 884e20f commit 528f540

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

README-en.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ and support for the linkage, dialog . It's very easy to use , you also can cust
3939
### Gradle
4040

4141
```java
42-
compile 'com.contrarywind:Android-PickerView:4.1.6'
42+
compile 'com.contrarywind:Android-PickerView:4.1.8'
4343
```
4444

4545
### Maven
@@ -48,7 +48,7 @@ compile 'com.contrarywind:Android-PickerView:4.1.6'
4848
<dependency>
4949
<groupId>com.contrarywind</groupId>
5050
<artifactId>Android-PickerView</artifactId>
51-
<version>4.1.2</version>
51+
<version>4.1.8</version>
5252
<type>pom</type>
5353
</dependency>
5454
```

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
startDate.set(2013,0,1);
6262
 endDate.set(2020,11,1);
6363

64+
#### V4.1.8 版本更新说明(2019-4-24)
65+
- 更新gradle版本, wheelview基础库由 compile 改为 api 依赖,避免gradle 5.0+版本无法引入。
66+
- 修复 setTextXOffset 赋值问题。
67+
6468
#### V4.1.7 版本更新说明(2019-1-10)
6569
- 修复 WheelView在初始化时,数据为空导致height=0,造成一直显示不出来的问题。
6670
- 新增取消按钮的点击事件监听入口。
@@ -83,7 +87,7 @@
8387

8488
#### 1.添加Jcenter仓库 Gradle依赖:
8589
```java
86-
compile 'com.contrarywind:Android-PickerView:4.1.7'
90+
compile 'com.contrarywind:Android-PickerView:4.1.8'
8791
```
8892
或者
8993

@@ -92,7 +96,7 @@ compile 'com.contrarywind:Android-PickerView:4.1.7'
9296
<dependency>
9397
<groupId>com.contrarywind</groupId>
9498
<artifactId>Android-PickerView</artifactId>
95-
<version>4.1.7</version>
99+
<version>4.1.8</version>
96100
<type>pom</type>
97101
</dependency>
98102
```

pickerview/src/main/java/com/bigkoo/pickerview/view/WheelTime.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ public void onItemSelected(int index) {
161161
wv_month.setCurrentItem(wv_month.getCurrentItem());
162162
}
163163

164+
int currentIndex = wv_day.getCurrentItem();
164165
int maxItem = 29;
165166
if (ChinaDate.leapMonth(year_num) != 0 && wv_month.getCurrentItem() > ChinaDate.leapMonth(year_num) - 1) {
166167
if (wv_month.getCurrentItem() == ChinaDate.leapMonth(year_num) + 1) {
@@ -175,7 +176,7 @@ public void onItemSelected(int index) {
175176
maxItem = ChinaDate.monthDays(year_num, wv_month.getCurrentItem() + 1);
176177
}
177178

178-
if (wv_day.getCurrentItem() > maxItem - 1) {
179+
if (currentIndex > maxItem - 1) {
179180
wv_day.setCurrentItem(maxItem - 1);
180181
}
181182

@@ -191,6 +192,7 @@ public void onItemSelected(int index) {
191192
public void onItemSelected(int index) {
192193
int month_num = index;
193194
int year_num = wv_year.getCurrentItem() + startYear;
195+
int currentIndex = wv_day.getCurrentItem();
194196
int maxItem = 29;
195197
if (ChinaDate.leapMonth(year_num) != 0 && month_num > ChinaDate.leapMonth(year_num) - 1) {
196198
if (wv_month.getCurrentItem() == ChinaDate.leapMonth(year_num) + 1) {
@@ -205,7 +207,7 @@ public void onItemSelected(int index) {
205207
maxItem = ChinaDate.monthDays(year_num, month_num + 1);
206208
}
207209

208-
if (wv_day.getCurrentItem() > maxItem - 1) {
210+
if (currentIndex > maxItem - 1) {
209211
wv_day.setCurrentItem(maxItem - 1);
210212
}
211213

0 commit comments

Comments
 (0)