Skip to content

Commit 21996ce

Browse files
committed
修改注释及自述文档
1 parent 51f42ec commit 21996ce

6 files changed

Lines changed: 145 additions & 132 deletions

File tree

README.md

Lines changed: 82 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@
88
# Install
99
“app”是测试用例;“library”包括WheelPicker、ColorPicker、FilePicker,
1010
WheelPicker包括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
1323
apply 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
57118
dependencies {
@@ -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
252313
https://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>

library/Common/src/main/java/cn/qqtheme/framework/popup/ConfirmPopup.java

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,70 +46,121 @@ public ConfirmPopup(Activity activity) {
4646
submitText = activity.getString(android.R.string.ok);
4747
}
4848

49+
/**
50+
* 设置顶部标题栏下划线颜色
51+
*/
4952
public void setTopLineColor(@ColorInt int topLineColor) {
5053
this.topLineColor = topLineColor;
5154
}
5255

56+
/**
57+
* 设置顶部标题栏背景颜色
58+
*/
5359
public void setTopBackgroundColor(@ColorInt int topBackgroundColor) {
5460
this.topBackgroundColor = topBackgroundColor;
5561
}
5662

63+
/**
64+
* 设置顶部标题栏高度(单位为dp)
65+
*/
5766
public void setTopHeight(@IntRange(from = 10, to = 80) int topHeight) {
5867
this.topHeight = topHeight;
5968
}
6069

70+
/**
71+
* 设置顶部标题栏下划线是否显示
72+
*/
6173
public void setTopLineVisible(boolean topLineVisible) {
6274
this.topLineVisible = topLineVisible;
6375
}
6476

77+
/**
78+
* 设置顶部标题栏取消按钮是否显示
79+
*/
6580
public void setCancelVisible(boolean cancelVisible) {
6681
this.cancelVisible = cancelVisible;
6782
}
6883

84+
/**
85+
* 设置顶部标题栏取消按钮文字
86+
*/
6987
public void setCancelText(CharSequence cancelText) {
7088
this.cancelText = cancelText;
7189
}
7290

91+
/**
92+
* 设置顶部标题栏取消按钮文字
93+
*/
7394
public void setCancelText(@StringRes int textRes) {
7495
this.cancelText = activity.getString(textRes);
7596
}
7697

98+
/**
99+
* 设置顶部标题栏确定按钮文字
100+
*/
77101
public void setSubmitText(CharSequence submitText) {
78102
this.submitText = submitText;
79103
}
80104

105+
/**
106+
* 设置顶部标题栏确定按钮文字
107+
*/
81108
public void setSubmitText(@StringRes int textRes) {
82109
this.submitText = activity.getString(textRes);
83110
}
84111

112+
/**
113+
* 设置顶部标题栏标题文字
114+
*/
85115
public void setTitleText(CharSequence titleText) {
86116
this.titleText = titleText;
87117
}
88118

119+
/**
120+
* 设置顶部标题栏标题文字
121+
*/
89122
public void setTitleText(@StringRes int textRes) {
90123
this.titleText = activity.getString(textRes);
91124
}
92125

126+
/**
127+
* 设置顶部标题栏取消按钮文字颜色
128+
*/
93129
public void setCancelTextColor(@ColorInt int cancelTextColor) {
94130
this.cancelTextColor = cancelTextColor;
95131
}
96132

133+
/**
134+
* 设置顶部标题栏确定按钮文字颜色
135+
*/
97136
public void setSubmitTextColor(@ColorInt int submitTextColor) {
98137
this.submitTextColor = submitTextColor;
99138
}
100139

140+
/**
141+
* 设置顶部标题栏标题文字颜色
142+
*/
101143
public void setTitleTextColor(@ColorInt int titleTextColor) {
102144
this.titleTextColor = titleTextColor;
103145
}
104146

147+
/**
148+
* 设置顶部标题栏取消按钮文字大小(单位为sp)
149+
*/
105150
public void setCancelTextSize(@IntRange(from = 10, to = 40) int cancelTextSize) {
106151
this.cancelTextSize = cancelTextSize;
107152
}
108153

154+
/**
155+
* 设置顶部标题栏确定按钮文字大小(单位为sp)
156+
*/
109157
public void setSubmitTextSize(@IntRange(from = 10, to = 40) int submitTextSize) {
110158
this.submitTextSize = submitTextSize;
111159
}
112160

161+
/**
162+
* 设置顶部标题栏标题文字大小(单位为sp)
163+
*/
113164
public void setTitleTextSize(@IntRange(from = 10, to = 40) int titleTextSize) {
114165
this.titleTextSize = titleTextSize;
115166
}

0 commit comments

Comments
 (0)