88# Install
99“app”是测试用例;“library”包括WheelPicker、ColorPicker、FilePicker,
1010WheelPicker包括DateTimePicker、OptionPicker、LinkagePicker、AddressPicker、NumberPicker等,
11- 可下载本项目手动进行源代码集成,导入“library”下的相关module(记得将module下的build.gradle修改类似于下面的内容,否则可能会报错找不到BuildToolsVersion):
11+ #### 懒人建议直接远程加载jcenter里的
12+ 其中latest.release为最新版,也可以[ 参照此处指定具体的版本号] ( https://github.com/gzu-liyujiang/AndroidPicker/releases ) :
13+ ``` groovy
14+ dependencies {
15+ compile 'cn.qqtheme.framework:WheelPicker:latest.release'
16+ compile 'cn.qqtheme.framework:FilePicker:latest.release'
17+ compile 'cn.qqtheme.framework:ColorPicker:latest.release'
18+ }
19+ ```
20+ #### 需要学习或修改源代码,则下载本项目手动集成
21+ 下载示例项目后导入“library”下的相关module到你的项目(记得将module下的build.gradle修改类似于下面的内容,否则可能会报错找不到BuildToolsVersion):
1222``` groovy
1323apply plugin: 'com.android.library'
1424
@@ -34,24 +44,75 @@ dependencies {
3444 compile project(':ColorPicker')
3545}
3646```
37- 也可以直接远程加载jcenter里的(latest.release为最新版,也可以[ 参照此处指定具体的版本号] ( https://github.com/gzu-liyujiang/AndroidPicker/releases ) ):
38- ``` groovy
39- dependencies {
40- compile 'cn.qqtheme.framework:WheelPicker:latest.release'
41- compile 'cn.qqtheme.framework:FilePicker:latest.release'
42- compile 'cn.qqtheme.framework:ColorPicker:latest.release'
43- }
44- ```
45- * 注:*
46- 本项目使用gradle来构建,迁移到Eclipse比较麻烦,建议换为Android Studio或Intellij IDEA。
47+ # ProGuard
4748由于地址选择器使用了[ fastjson] ( https://github.com/alibaba/fastjson ) 来解析,混淆时候需要加入以下类似的规则,不混淆Province、City等实体类。
4849```
4950-keep class cn.qqtheme.framework.entity.** { *;}
5051-keep class cn.qqtheme.framework.picker.AddressPicker$* { *;}
5152```
5253
54+ # Method
55+ void setFillScreen(boolean fillScreen)
56+ 固定高度为屏幕的高
57+ void setGravity(int gravity)
58+ 位于屏幕何处
59+ void setHalfScreen(boolean halfScreen)
60+ 固定高度为屏幕的一半
61+ void setHeight(int height)
62+ 设置弹窗的高
63+ void setSize(int width, int height)
64+ 设置弹窗的宽和高
65+ void setWidth(int width)
66+ 设置弹窗的宽
67+ void setLineColor(int lineColor)
68+ 设置分隔线颜色
69+ void setLineVisible(boolean lineVisible)
70+ 设置分隔线是否可见
71+ void setOffset(int offset)
72+ 设置选项偏移量,默认为1,范围为1~ 4。
73+ void setTextColor(int textColor)
74+ 设置文字颜色
75+ void setTextColor(int textColorFocus, int textColorNormal)
76+ 设置文字颜色
77+ void setTextSize(int textSize)
78+ 设置文字大小
79+ void setCancelText(java.lang.CharSequence cancelText)
80+ 设置顶部标题栏取消按钮文字
81+ void setCancelText(int textRes)
82+ 设置顶部标题栏取消按钮文字
83+ void setCancelTextColor(int cancelTextColor)
84+ 设置顶部标题栏取消按钮文字颜色
85+ void setCancelTextSize(int cancelTextSize)
86+ 设置顶部标题栏取消按钮文字大小(单位为sp)
87+ void setCancelVisible(boolean cancelVisible)
88+ 设置顶部标题栏取消按钮是否显示
89+ void setSubmitText(java.lang.CharSequence submitText)
90+ 设置顶部标题栏确定按钮文字
91+ void setSubmitText(int textRes)
92+ 设置顶部标题栏确定按钮文字
93+ void setSubmitTextColor(int submitTextColor)
94+ 设置顶部标题栏确定按钮文字颜色
95+ void setSubmitTextSize(int submitTextSize)
96+ 设置顶部标题栏确定按钮文字大小(单位为sp)
97+ void setTitleText(java.lang.CharSequence titleText)
98+ 设置顶部标题栏标题文字
99+ void setTitleText(int textRes)
100+ 设置顶部标题栏标题文字
101+ void setTitleTextColor(int titleTextColor)
102+ 设置顶部标题栏标题文字颜色
103+ void setTitleTextSize(int titleTextSize)
104+ 设置顶部标题栏标题文字大小(单位为sp)
105+ void setTopBackgroundColor(int topBackgroundColor)
106+ 设置顶部标题栏背景颜色
107+ void setTopHeight(int topHeight)
108+ 设置顶部标题栏高度(单位为dp)
109+ void setTopLineColor(int topLineColor)
110+ 设置顶部标题栏下划线颜色
111+ void setTopLineVisible(boolean topLineVisible)
112+ 设置顶部标题栏下划线是否显示
113+
53114# Custom
54- ### 自定义窗口进入退出动画(可选)
115+ #### 自定义窗口进入退出动画(可选)
55116推荐使用[ ViewAnimator] ( https://github.com/gzu-liyujiang/ViewAnimator ) 这个动画库来实现:
56117``` groovy
57118dependencies {
@@ -77,7 +138,7 @@ dependencies {
77138 picker. setAnimationStyle(R . style. Animation_CustomPopup );
78139```
79140
80- ### 自定义顶部及底部界面
141+ #### 自定义顶部及底部界面
81142添加自己的类,继承自现有的选择器,覆盖makeHeaderView、makeFooterView、onSubmit、onCancel,在确定选择时调用onSubmit,
82143取消选择时调用onCancel。详见示例:CustomHeaderAndFooterPicker.java。
83144
@@ -157,7 +218,7 @@ dependencies {
157218 picker. show();
158219```
159220
160- 二三级联动选择器(参见地址选择器)
221+ 二三级联动选择器(详见示例项目, 参见地址选择器)
161222
162223地址选择器(含省级、地级、县级):
163224``` java
@@ -252,19 +313,18 @@ https://github.com/wangjiegulu/WheelView
252313https://github.com/jbruchanov/AndroidColorPicker
253314
254315# Screenshots
255- ![ 自定义选择器效果图] ( /screenshots/custom.gif )
316+ ![ 自定义选择器效果图] ( /screenshots/custom.gif )
256317![ 日期选择器效果图] ( /screenshots/date.gif )
257- ![ 日期选择器效果图] ( /screenshots/yearmonth .jpg )
318+ ![ 日期选择器效果图] ( /screenshots/monthday .jpg )
258319![ 时间选择器效果图] ( /screenshots/time.gif )
259320![ 单项选择器效果图] ( /screenshots/option.gif )
260- ![ 地址选择器效果图] ( /screenshots/address.gif )
321+ ![ 地址选择器效果图] ( /screenshots/address.gif )
261322![ 地址选择器效果图] ( /screenshots/address.png )
262- ![ 数字选择器效果图] ( /screenshots/number.gif )
263- ![ 星座选择器效果图] ( /screenshots/constellation.gif )
264- ![ 生肖选择器效果图] ( /screenshots/chinesezodiac.jpg )
323+ ![ 数字选择器效果图] ( /screenshots/number.gif )
324+ ![ 星座选择器效果图] ( /screenshots/constellation.jpg )
265325![ 颜色选择器效果图] ( /screenshots/color.gif )
266- ![ 文件选择器效果图] ( /screenshots/file.gif )
267- ![ 目录选择器效果图] ( /screenshots/dir.gif )
326+ ![ 文件选择器效果图] ( /screenshots/file.gif )
327+ ![ 目录选择器效果图] ( /screenshots/dir.gif )
268328
269329# Contact
270330<a target =" _blank " href =" http://wpa.qq.com/msgrd?v=3&uin=1032694760&site=穿青人&menu=yes " ><img border =" 0 " src =" http://wpa.qq.com/pa?p=2:1032694760:51 " alt =" 点击这里给我发消息 " title =" 点击这里给我发消息 " /></a >
0 commit comments