From 96de796bcb262beaf85f4153a4642829d8921aef Mon Sep 17 00:00:00 2001 From: liyujiang Date: Sun, 18 Dec 2016 13:09:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BD=A6=E7=89=8C=E5=8F=B7?= =?UTF-8?q?=E7=A0=81=E9=80=89=E6=8B=A9=E5=99=A8demo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeLog.md | 1 + .../main/java/cn/qqtheme/androidpicker/NestActivity.java | 9 +++++++-- app/src/main/res/layout/activity_nest.xml | 8 ++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index aee40785..e7efd915 100755 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,7 @@ ### v1.3.1 - 2016.12.18 支持设置选中项分割线的宽比例、透明度、粗度; 修复小数选择器设置默认选择项可能无效的bug; +添加中国大陆车牌号码选择器; ### v1.3.0 - 2016.12.15 支持设置选择器主体背景颜色; 所有选择器支持滑动实时监听; diff --git a/app/src/main/java/cn/qqtheme/androidpicker/NestActivity.java b/app/src/main/java/cn/qqtheme/androidpicker/NestActivity.java index b5ac15cc..eaca6926 100755 --- a/app/src/main/java/cn/qqtheme/androidpicker/NestActivity.java +++ b/app/src/main/java/cn/qqtheme/androidpicker/NestActivity.java @@ -21,6 +21,7 @@ * Builder:Android Studio */ public class NestActivity extends Activity { + private CarNumberPicker picker; @Override protected void onCreate(Bundle savedInstanceState) { @@ -30,7 +31,7 @@ protected void onCreate(Bundle savedInstanceState) { final TextView textView = (TextView) findViewById(R.id.wheelview_tips); WheelView wheelView = (WheelView) findViewById(R.id.wheelview_single); - wheelView.setItems(new String[]{ "少数民族", "贵州穿青人", "不在56个少数民族之列", "第57个民族"}); + wheelView.setItems(new String[]{"少数民族", "贵州穿青人", "不在56个少数民族之列", "第57个民族"}, 1); wheelView.setTextColor(0xFFFF00FF); WheelView.LineConfig config = new WheelView.LineConfig(); config.setColor(0xFFFF00FF);//线颜色 @@ -45,7 +46,7 @@ public void onSelected(boolean isUserScroll, int index, String item) { } }); - final CarNumberPicker picker = new CarNumberPicker(this); + picker = new CarNumberPicker(this); picker.setLineConfig(new WheelView.LineConfig(0)); picker.setOffset(3); picker.setOnWheelListener(new CarNumberPicker.OnWheelListener() { @@ -67,4 +68,8 @@ public void onBack(View view) { finish(); } + public void onCarNumber(View view) { + picker.show(); + } + } diff --git a/app/src/main/res/layout/activity_nest.xml b/app/src/main/res/layout/activity_nest.xml index cec45176..bdfddfa4 100755 --- a/app/src/main/res/layout/activity_nest.xml +++ b/app/src/main/res/layout/activity_nest.xml @@ -31,6 +31,14 @@ android:gravity="center_vertical" android:text="内嵌选择器"/> + +