diff --git a/ChangeLog.md b/ChangeLog.md index 1cb8bb24..f046f19a 100755 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,8 @@ +### v1.5.2 - 2017.05.14 +有童鞋反应动画太慢,移除选择器默认的动画; +DoublePicker支持设置前缀及后缀标签; +修复联动选择器不滑动(使用默认项)就确定时的奔溃问题; +修复setXXRangeStart()及setXXRangeEnd()二者调用顺序颠倒出现的问题; ### v1.5.1 - 2017.05.03 日期时间选择器支持设置各项平分布局; 顶部按钮文字颜色默认调整为青蓝风格; diff --git a/app/build.gradle b/app/build.gradle index 50827ab4..522f13f7 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -26,11 +26,11 @@ dependencies { compile project(':library:WheelPicker') compile project(':library:FilePicker') compile project(':library:ColorPicker') -// compile files('libs/AndroidPicker-1.5.1.jar') +// compile files('libs/AndroidPicker-1.5.2.jar') // compile 'cn.qqtheme.framework:WheelPicker:latest.release' // compile 'cn.qqtheme.framework:FilePicker:latest.release' // compile 'cn.qqtheme.framework:ColorPicker:latest.release' -// compile 'com.github.gzu-liyujiang.AndroidPicker:WheelPicker:1.5.1' -// compile 'com.github.gzu-liyujiang.AndroidPicker:FilePicker:1.5.1' -// compile 'com.github.gzu-liyujiang.AndroidPicker:ColorPicker:1.5.1' +// compile 'com.github.gzu-liyujiang.AndroidPicker:WheelPicker:1.5.2' +// compile 'com.github.gzu-liyujiang.AndroidPicker:FilePicker:1.5.2' +// compile 'com.github.gzu-liyujiang.AndroidPicker:ColorPicker:1.5.2' } diff --git a/app/src/main/java/cn/qqtheme/androidpicker/MainActivity.java b/app/src/main/java/cn/qqtheme/androidpicker/MainActivity.java index 48c31502..6f71d44c 100755 --- a/app/src/main/java/cn/qqtheme/androidpicker/MainActivity.java +++ b/app/src/main/java/cn/qqtheme/androidpicker/MainActivity.java @@ -3,6 +3,8 @@ import android.content.Intent; import android.graphics.Color; import android.net.Uri; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; import android.view.Gravity; import android.view.View; import android.widget.TextView; @@ -105,8 +107,8 @@ public void onYearMonthDayPicker(View view) { picker.setCanceledOnTouchOutside(true); picker.setUseWeight(true); picker.setTopPadding(ConvertUtils.toPx(this, 20)); - picker.setRangeStart(2016, 8, 29); picker.setRangeEnd(2111, 1, 11); + picker.setRangeStart(2016, 8, 29); picker.setSelectedItem(2050, 10, 14); picker.setOnDatePickListener(new DatePicker.OnYearMonthDayPickListener() { @Override @@ -230,9 +232,11 @@ public void onDoublePicker(View view) { secondData.add("私家小汽车"); secondData.add("公共交通汽车"); final DoublePicker picker = new DoublePicker(this, firstData, secondData); - picker.setDividerVisible(false); - picker.setShadowColor(Color.DKGRAY, 80); + picker.setDividerVisible(true); + picker.setCycleDisable(false); picker.setSelectedIndex(2, 1); + picker.setFirstLabel("于", null); + picker.setSecondLabel("骑/乘", "出发"); picker.setOnPickListener(new DoublePicker.OnPickListener() { @Override public void onPicked(int selectedFirstIndex, int selectedSecondIndex) { @@ -243,6 +247,7 @@ public void onPicked(int selectedFirstIndex, int selectedSecondIndex) { } public void onLinkagePicker(View view) { + //联动选择器的更多用法,可参见AddressPicker和CarNumberPicker LinkagePicker.DataProvider provider = new LinkagePicker.DataProvider() { @Override @@ -250,6 +255,7 @@ public boolean isOnlyTwo() { return true; } + @NonNull @Override public List provideFirstData() { ArrayList firstList = new ArrayList<>(); @@ -258,6 +264,7 @@ public List provideFirstData() { return firstList; } + @NonNull @Override public List provideSecondData(int firstIndex) { ArrayList secondList = new ArrayList<>(); @@ -273,6 +280,7 @@ public List provideSecondData(int firstIndex) { return secondList; } + @Nullable @Override public List provideThirdData(int firstIndex, int secondIndex) { return null; diff --git a/gradle.properties b/gradle.properties index 1b4c7b27..80399066 100755 --- a/gradle.properties +++ b/gradle.properties @@ -15,8 +15,8 @@ com.android.build.gradle.overridePathCheck=true #android.useDeprecatedNdk=true #下面定义一些常量供gradle脚本使用 -VERSION_NAME=1.5.1 -VERSION_CODE=151 +VERSION_NAME=1.5.2 +VERSION_CODE=152 COMPILE_SDK_VERSION=23 MIN_SDK_VERSION=14 #安卓6.0开始(API23+),需要动态申请权限