├── .gitignore
├── .idea
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
└── gradle.xml
├── APK
└── Demo.apk
├── Demo
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ └── yyg.ttf
│ ├── java
│ └── dev
│ │ └── aige
│ │ └── wheelpicker
│ │ └── demo
│ │ └── PreviewActivity.java
│ └── res
│ ├── layout
│ ├── ac_area_picker.xml
│ └── ac_preview.xml
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ └── mipmap-xxhdpi
│ └── ic_launcher.png
├── LICENSE
├── Previews
├── main
│ ├── Banner.jpg
│ ├── Pay.png
│ ├── Preview.gif
│ ├── WheelDatePicker.gif
│ ├── WheelDayPicker.gif
│ ├── WheelMonthPicker.gif
│ └── WheelYearPicker.gif
└── wiki
│ ├── 01.png
│ └── 02.png
├── README.md
├── WheelPicker
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ └── RegionJsonData.dat
│ ├── java
│ └── dev
│ │ └── aige
│ │ └── wheelpicker
│ │ ├── IDebug.java
│ │ ├── IWheelPicker.java
│ │ ├── WheelPicker.java
│ │ ├── model
│ │ ├── City.java
│ │ └── Province.java
│ │ └── widgets
│ │ ├── IWheelAreaPicker.java
│ │ ├── IWheelDatePicker.java
│ │ ├── IWheelDayPicker.java
│ │ ├── IWheelMonthPicker.java
│ │ ├── IWheelYearPicker.java
│ │ ├── WheelAreaPicker.java
│ │ ├── WheelDatePicker.java
│ │ ├── WheelDayPicker.java
│ │ ├── WheelMonthPicker.java
│ │ └── WheelYearPicker.java
│ └── res
│ ├── layout-v17
│ └── view_wheel_date_picker.xml
│ ├── layout
│ └── view_wheel_date_picker.xml
│ ├── values-zh
│ └── strings.xml
│ └── values
│ ├── arrays.xml
│ ├── attrs.xml
│ ├── dimens.xml
│ └── strings.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | .idea
3 | build
4 | local.properties
5 | *.iml
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
19 |
20 |
--------------------------------------------------------------------------------
/APK/Demo.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaige/WheelPicker/594180cb8b26ae17e259a3e93438f17f25d335e5/APK/Demo.apk
--------------------------------------------------------------------------------
/Demo/.gitignore:
--------------------------------------------------------------------------------
1 | build
2 | *.iml
--------------------------------------------------------------------------------
/Demo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | android {
3 | compileSdkVersion 28
4 | defaultConfig {
5 | applicationId "dev.aige.wheelpicker.demo"
6 | minSdkVersion 14
7 | targetSdkVersion 28
8 | versionCode 1
9 | versionName "1.0"
10 | }
11 | buildTypes {
12 | release {
13 | minifyEnabled false
14 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
15 | }
16 | }
17 | }
18 | dependencies {
19 | implementation project(':WheelPicker')
20 | }
--------------------------------------------------------------------------------
/Demo/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in J:\SDK\Android\Win/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/Demo/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Demo/src/main/assets/yyg.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaige/WheelPicker/594180cb8b26ae17e259a3e93438f17f25d335e5/Demo/src/main/assets/yyg.ttf
--------------------------------------------------------------------------------
/Demo/src/main/java/dev/aige/wheelpicker/demo/PreviewActivity.java:
--------------------------------------------------------------------------------
1 | package dev.aige.wheelpicker.demo;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 | import android.view.View;
6 | import android.widget.Button;
7 | import android.widget.Toast;
8 |
9 | import dev.aige.wheelpicker.WheelPicker;
10 |
11 | /**
12 | * @author AigeStudio 2015-12-06
13 | * @author AigeStudio 2016-07-08
14 | */
15 | public class PreviewActivity extends Activity implements WheelPicker.OnItemSelectedListener, View.OnClickListener {
16 |
17 | private WheelPicker wheelLeft;
18 | private WheelPicker wheelCenter;
19 | private WheelPicker wheelRight;
20 |
21 | private Button gotoBtn;
22 | private Integer gotoBtnItemIndex;
23 |
24 | @Override
25 | protected void onCreate(Bundle savedInstanceState) {
26 | super.onCreate(savedInstanceState);
27 | setContentView(R.layout.ac_preview);
28 |
29 | wheelLeft = (WheelPicker) findViewById(R.id.main_wheel_left);
30 | wheelLeft.setOnItemSelectedListener(this);
31 | wheelCenter = (WheelPicker) findViewById(R.id.main_wheel_center);
32 | wheelCenter.setOnItemSelectedListener(this);
33 | wheelRight = (WheelPicker) findViewById(R.id.main_wheel_right);
34 | wheelRight.setOnItemSelectedListener(this);
35 |
36 | gotoBtn = (Button) findViewById(R.id.goto_btn);
37 | randomlySetGotoBtnIndex();
38 | gotoBtn.setOnClickListener(this);
39 | }
40 |
41 | private void randomlySetGotoBtnIndex() {
42 | gotoBtnItemIndex = (int) (Math.random() * wheelCenter.getData().size());
43 | gotoBtn.setText("Goto '" + wheelCenter.getData().get(gotoBtnItemIndex) + "'");
44 | }
45 |
46 | @Override
47 | public void onItemSelected(WheelPicker picker, Object data, int position) {
48 | String text = "";
49 | switch (picker.getId()) {
50 | case R.id.main_wheel_left:
51 | text = "Left:";
52 | break;
53 | case R.id.main_wheel_center:
54 | text = "Center:";
55 | break;
56 | case R.id.main_wheel_right:
57 | text = "Right:";
58 | break;
59 | }
60 | Toast.makeText(this, text + String.valueOf(data), Toast.LENGTH_SHORT).show();
61 | }
62 |
63 | @Override
64 | public void onClick(View v) {
65 | wheelCenter.setSelectedItemPosition(gotoBtnItemIndex);
66 | randomlySetGotoBtnIndex();
67 | }
68 |
69 | }
--------------------------------------------------------------------------------
/Demo/src/main/res/layout/ac_area_picker.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
22 |
23 |
34 |
35 |
47 |
--------------------------------------------------------------------------------
/Demo/src/main/res/layout/ac_preview.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
20 |
21 |
22 |
23 |
27 |
28 |
40 |
41 |
52 |
53 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/Demo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaige/WheelPicker/594180cb8b26ae17e259a3e93438f17f25d335e5/Demo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Demo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaige/WheelPicker/594180cb8b26ae17e259a3e93438f17f25d335e5/Demo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Demo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaige/WheelPicker/594180cb8b26ae17e259a3e93438f17f25d335e5/Demo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright 2015 Aige
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
203 |
--------------------------------------------------------------------------------
/Previews/main/Banner.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaige/WheelPicker/594180cb8b26ae17e259a3e93438f17f25d335e5/Previews/main/Banner.jpg
--------------------------------------------------------------------------------
/Previews/main/Pay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaige/WheelPicker/594180cb8b26ae17e259a3e93438f17f25d335e5/Previews/main/Pay.png
--------------------------------------------------------------------------------
/Previews/main/Preview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaige/WheelPicker/594180cb8b26ae17e259a3e93438f17f25d335e5/Previews/main/Preview.gif
--------------------------------------------------------------------------------
/Previews/main/WheelDatePicker.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaige/WheelPicker/594180cb8b26ae17e259a3e93438f17f25d335e5/Previews/main/WheelDatePicker.gif
--------------------------------------------------------------------------------
/Previews/main/WheelDayPicker.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaige/WheelPicker/594180cb8b26ae17e259a3e93438f17f25d335e5/Previews/main/WheelDayPicker.gif
--------------------------------------------------------------------------------
/Previews/main/WheelMonthPicker.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaige/WheelPicker/594180cb8b26ae17e259a3e93438f17f25d335e5/Previews/main/WheelMonthPicker.gif
--------------------------------------------------------------------------------
/Previews/main/WheelYearPicker.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaige/WheelPicker/594180cb8b26ae17e259a3e93438f17f25d335e5/Previews/main/WheelYearPicker.gif
--------------------------------------------------------------------------------
/Previews/wiki/01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaige/WheelPicker/594180cb8b26ae17e259a3e93438f17f25d335e5/Previews/wiki/01.png
--------------------------------------------------------------------------------
/Previews/wiki/02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaige/WheelPicker/594180cb8b26ae17e259a3e93438f17f25d335e5/Previews/wiki/02.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | ***
4 |
5 | # Overview
6 | [](https://github.com/AigeStudio/WheelPicker) [](https://github.com/AigeStudio/WheelPicker)
7 |
8 | # Contact
9 | [](http://sighttp.qq.com/authd?IDKEY=404d62c783d5c76e312f4c9fa65819d75ce648bff94b8cd6) [](http://shang.qq.com/wpa/qunwpa?idkey=a62502df9a8f2f24f20f978070a9c93238c1fe91db8888dda78214cb83dc6002) [](http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=i_ri7O74--7v4uTL_vql6OTm) [](http://weibo.com/aigestudio) [](https://twitter.com/AigeStudio)
10 |
11 | # Preview
12 | 
13 |
14 | # Demo
15 | [WheelPicke.APK](https://github.com/AigeStudio/WheelPicker/blob/main/APK/Demo.apk)
16 |
17 | # Include
18 | ### Compile
19 | ```Gradle
20 | compile 'cn.aigestudio.wheelpicker:WheelPicker:1.1.3'
21 | ```
22 | or
23 | ```Maven
24 |
25 | cn.aigestudio.wheelpicker
26 | WheelPicker
27 | 1.1.3
28 | pom
29 |
30 | ```
31 | or
32 | ```Ivy
33 |
34 |
35 |
36 | ```
37 |
38 | ### Import aar
39 | [WheelPicker-1.1.3.aar](https://dl.bintray.com/aigestudio/maven/cn/aigestudio/wheelpicker/WheelPicker/1.1.3/WheelPicker-1.1.3.aar)
40 |
41 | ### Import Module
42 | 1.Import moudle WheelPicker in your project.
43 |
44 | 2.Add module like below in your settings.gradle file of project:
45 | ```gradle
46 | include ':YourMoudle',':WheelPicker'
47 | ```
48 |
49 | Notably, in some version of gradle you need to add module single line:
50 | ```gradle
51 | include ':WheelPicker'
52 | ```
53 |
54 | click the "sycn now" when it appear on the top-right of IDE window.
55 |
56 | 3.Compile project like below in the dependencies in your build.gradle file of application module:
57 | ```gradle
58 | compile project(':WheelPicker')
59 | ```
60 |
61 | # Usage
62 | [WIKI](https://github.com/AigeStudio/WheelPicker/wiki/WIKI) | [帮助文档](https://github.com/AigeStudio/WheelPicker/wiki/%E5%B8%AE%E5%8A%A9%E6%96%87%E6%A1%A3)
63 |
64 | # Versions
65 | ### 1.0.0 beta
66 | * Preview for WheelPicker and support few function.
67 |
68 | ### 1.0.1 beta
69 | * BugFix:Cache in WheelCuredPicker can not clean...a stupid mistake.
70 |
71 | ### 1.0.2 beta
72 | * BugFix:MotionEvent lost when point outside of view in WheelCurvedPicker
73 |
74 | ### 1.0.3 beta
75 | * BugFix:Error parameter after scroll using setXXX method
76 |
77 | ### 1.1.0 Stable
78 | * Refactor project fix all known bug and some function additions
79 | * I will create a tag for old beta version but not be updated anymore
80 | * 重构项目发布稳定版修复测试版所有BUG以及新增功能
81 | * Beta版本会打上TAG方便老版本过渡但不再更新
82 |
83 | ### 1.1.1
84 | * BugFix:Scroll automatically when touch but not move on WheelPicker in some low resolution phone
85 | * BugFix:Scroll range incorrect when invoke setData twice and set data source's length less than last
86 | * BugFix:Wheel state do not refresh when invoke setData twice and set data source's length-1 less than last selected position
87 | * BugFix:Switch between click and scroll event
88 | * BugFix:Call OnItemSelectedListener more time when user want to scroll continuously
89 | * BugFix:Scroll range incorrect when set current selected item again
90 | * BugFix:Scroll will be triggered when click WheelPicker
91 | * Function:All the parameters of WheelPicker will be reset when you setData
92 | * ADD WheelYearPicker, WheelMonthPicker, WheelDayPicker
93 | * ADD WheelDatePicker
94 | * 修复某些低分辨率手机触摸不动时自滑动问题
95 | * 修复第二次调用setData设置长度比上次小的数据时滑动范围不改变的问题
96 | * 修复第二次调用setData设置长度位置小于上次选中位置时滚轮状态不刷新问题
97 | * 修复点击与滑动事件切换的问题
98 | * 修复当用户想连续滑动时出现多次回调的问题
99 | * 修复重新设置选择的数据项位置后滑动范围错位问题
100 | * 修复点击后触发滚动的问题
101 | * 重新设置数据源后会重置滚轮选择器相关参数
102 | * 新增年份、月份、日期选择器
103 | * 新增三级联动的日期选择器
104 |
105 | ### 1.1.2
106 | * BugFix:WheelPicker can not get the height in some layout
107 | * Support Android Nougat
108 |
109 | ### 1.1.3
110 | * BugFix:Divide by zero
111 |
112 | # Function
113 | * Data display circulation
114 | * Set visible item count
115 | * Get the current item data straight in stationary
116 | * Monitor status of scroll get selected item data and other parameter when wheel stop
117 | * Dynamic update data
118 | * Set text color of selected or non-selected item
119 | * Set item space
120 | * Support display indicator and set the indicator's size and color
121 | * Support display curtain and set the curtain's color
122 | * Enable atmospheric effect
123 | * Enable perspective effect
124 | * Curl the items base on mathematic models
125 | * Support item align when perspective or atmospheric enable
126 | * 循环显示数据项
127 | * 设置可见数据项条数
128 | * 在滚轮静止状态直接获取选中数据项
129 | * 滚动监听获取滚轮停止后选中项以及滚动各项参数
130 | * 动态更新数据源
131 | * 设置当前选中项文本颜色和非选中项文本颜色
132 | * 设置数据项之间间隔
133 | * 支持绘制指示器以及指定指示器颜色、尺寸
134 | * 支持绘制幕布以及指定幕布颜色
135 | * 可开启数据项空气感模拟
136 | * 可开启数据项模拟真实透视效果
137 | * 根据严格数学建模模拟滚轮弯曲效果
138 | * 在开启透视或弯曲效果后支持让数据项左右对齐
139 |
140 | # Widgets
141 | ## WheelDatePicker
142 | 
143 | ### Method
144 | * setVisibleItemCount
145 | * setCyclic
146 | * setSelectedItemTextColor
147 | * setItemTextColor
148 | * setItemTextSize
149 | * setItemSpace
150 | * setIndicator
151 | * setIndicatorColor
152 | * setIndicatorSize
153 | * setCurtain
154 | * setCurtainColor
155 | * setAtmospheric
156 | * setCurved
157 | * setItemAlignYear
158 | * setItemAlignDay
159 | * setYearFrame
160 | * setSelectedYear
161 | * setSelectedMonth
162 | * setSelectedDay
163 | * etc...
164 |
165 | ## WheelYearPicker
166 | 
167 | ### Method
168 | * All method of WheelPicker
169 | * setYearFrame
170 | * set/getYearStart
171 | * set/getYearEnd
172 | * set/getSelectedYear
173 | * getCurrentYear
174 |
175 | ## WheelMonthPicker
176 | 
177 | ### Method
178 | * All method of WheelPicker
179 | * set/getSelectedMonth
180 | * getCurrentMonth
181 |
182 | ## WheelDayPicker
183 | 
184 | ### Method
185 | * All method of WheelPicker
186 | * set/getSelectedDay
187 | * getCurrentDay
188 | * setYearAndMonth
189 | * set/getYear
190 | * set/getMonth
191 |
192 | ## WheelAreaPicker
193 | 中国行政区域划分根据国家统计局最新数据[国家统计局行政区域划分](http://www.stats.gov.cn/tjsj/tjbz/xzqhdm/201504/t20150415_712722.html)
194 |
195 | ***
196 |
197 | # Donation
198 | 如果您觉得该项目帮助了您那不妨赏小弟一杯咖啡钱 :)
199 |
200 | 
201 |
202 | You can support the project and thank the author for his hard work :)
203 |
204 | * PayPal:xiaoaibaby@vip.qq.com
205 |
206 | ***
207 |
208 | # LICENSE
209 | Copyright 2015-2017 [AigeStudio](https://github.com/AigeStudio)
210 |
211 | Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.
212 |
213 | You may obtain a copy of the License at
214 |
215 | http://www.apache.org/licenses/LICENSE-2.0
216 |
217 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
218 |
--------------------------------------------------------------------------------
/WheelPicker/.gitignore:
--------------------------------------------------------------------------------
1 | build
2 | *.iml
--------------------------------------------------------------------------------
/WheelPicker/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | android {
3 | compileSdkVersion 28
4 | defaultConfig {
5 | minSdkVersion 14
6 | targetSdkVersion 28
7 | versionCode 8
8 | versionName version
9 | }
10 | buildTypes {
11 | release {
12 | minifyEnabled false
13 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
14 | }
15 | }
16 | sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
17 | }
18 | dependencies {
19 | implementation 'com.google.code.gson:gson:2.8.2'
20 | }
--------------------------------------------------------------------------------
/WheelPicker/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in J:\SDK\Android\Win/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/assets/RegionJsonData.dat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devaige/WheelPicker/594180cb8b26ae17e259a3e93438f17f25d335e5/WheelPicker/src/main/assets/RegionJsonData.dat
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/dev/aige/wheelpicker/IDebug.java:
--------------------------------------------------------------------------------
1 | package dev.aige.wheelpicker;
2 |
3 | /**
4 | * 调试模式方法接口
5 | *
6 | * @author AigeStudio
7 | * @since 2011-04-11
8 | */
9 | public interface IDebug {
10 | /**
11 | * 设置调试模式
12 | * 开启调试模式有可能在一定程度上降低代码执行效率,请务必在正式发布时关闭调试模式
13 | *
14 | * @param isDebug 是否为调试模式
15 | */
16 | void setDebug(boolean isDebug);
17 | }
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/dev/aige/wheelpicker/IWheelPicker.java:
--------------------------------------------------------------------------------
1 | package dev.aige.wheelpicker;
2 |
3 | import android.graphics.Typeface;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * 滚轮选择器方法接口
9 | *
26 | * Get the count of current visible items in WheelPicker
27 | *
28 | * @return 滚轮选择器可见数据项的数量
29 | */
30 | int getVisibleItemCount();
31 |
32 | /**
33 | * 设置滚轮选择器可见数据项数量
34 | * 滚轮选择器的可见数据项数量必须为大于1的整数
35 | * 这里需要注意的是,滚轮选择器会始终显示奇数个数据项,即便你为其设置偶数个数据项,最终也会被转换为奇数
36 | * 默认情况下滚轮选择器可见数据项数量为7
37 | *
38 | * Set the count of current visible items in WheelPicker
39 | * The count of current visible items in WheelPicker must greater than 1
40 | * Notice:count of current visible items in WheelPicker will always is an odd number, even you
41 | * can set an even number for it, it will be change to an odd number eventually
42 | * By default, the count of current visible items in WheelPicker is 7
43 | *
44 | * @param count 滚轮选择器可见数据项数量
45 | */
46 | void setVisibleItemCount(int count);
47 |
48 | /**
49 | * 滚轮选择器数据项是否为循环状态
50 | *
61 | * Set whether WheelPicker is cyclic or not
62 | * WheelPicker's items will be end to end and in an infinite loop if setCyclic true, and there
63 | * is no border whit scroll when WheelPicker in cyclic state
64 | *
65 | * @param isCyclic 是否为循环状态
66 | */
67 | void setCyclic(boolean isCyclic);
68 |
69 | /**
70 | * 设置滚轮Item选中监听器
71 | *
72 | * @param listener 滚轮Item选中监听器{@link WheelPicker.OnItemSelectedListener}
73 | */
74 | void setOnItemSelectedListener(WheelPicker.OnItemSelectedListener listener);
75 |
76 | /**
77 | * 获取当前被选中的数据项所显示的数据在数据源中的位置
78 | * 需要注意的是,当滚轮选择器滚动时并不会改变该方法的返回值,该方法会始终返回
79 | * {@link #setSelectedItemPosition(int)}所设置的值,当且仅当调用
80 | * {@link #setSelectedItemPosition(int)}设置新值后,该方法所返回的值才会改变
81 | * 如果你只是想获取滚轮静止时当前被选中的数据项所显示的数据在数据源中的位置,你可以通过
82 | * {@link com.aigestudio.wheelpicker.WheelPicker.OnItemSelectedListener}回调监听或调用
83 | * {@link #getCurrentItemPosition()}
84 | *
85 | * Get the position of current selected item in data source
86 | * Notice:The value by return will not change when WheelPicker scroll, this method will always
87 | * return the value which {@link #setSelectedItemPosition(int)} set, the value this method
88 | * return will be changed if and only if call the
89 | * {@link #setSelectedItemPosition(int)}
90 | * set a new value
91 | * If you only want to get the position of current selected item in data source, you can get it
92 | * through {@link com.aigestudio.wheelpicker.WheelPicker.OnItemSelectedListener} or call
93 | * {@link #getCurrentItemPosition()} directly
94 | *
95 | * @return 当前被选中的数据项所显示的数据在数据源中的位置
96 | */
97 | int getSelectedItemPosition();
98 |
99 | /**
100 | * 设置当前被选中的数据项所显示的数据在数据源中的位置
101 | * 调用该方法会导致滚动选择器的位置被重新初始化,什么意思呢?假如你滑动选择到第五个数据项的时候调用该方
102 | * 法重新将当前被选中的数据项所显示的数据在数据源中的位置设置为第三个,那么滚轮选择器会清除掉上一次滚动
103 | * 的相关数据参数,并将重置一系列的数据,重新将第三个数据作为滚轮选择器的起点,这个行为很可能会影响你之
104 | * 前所根据这些参数改变的一些属性,比如
105 | * {@link com.aigestudio.wheelpicker.WheelPicker.OnWheelChangeListener}和
106 | * {@link com.aigestudio.wheelpicker.WheelPicker.OnItemSelectedListener}监听器中方法参数的值,因
107 | * 此你总该在调用该方法后考虑到相关影响
108 | * 你总该为该方法传入一个大于等于0小于数据源{@link #getData()}长度
109 | * 的值,否则会抛出异常
110 | * 默认情况下,当前被选中的数据项所显示的数据在数据源中的位置为0
111 | *
112 | * Set the position of current selected item in data source
113 | * Call this method and set a new value may be reinitialize the location of WheelPicker. For
114 | * example, you call this method after scroll the WheelPicker and set selected item position
115 | * with a new value, WheelPicker will clear the related parameters last scroll set and reset
116 | * series of data, and make the position 3 as a new starting point of WheelPicker, this behavior
117 | * maybe influenced some attribute you set last time, such as parameters of method in
118 | * {@link com.aigestudio.wheelpicker.WheelPicker.OnWheelChangeListener} and
119 | * {@link com.aigestudio.wheelpicker.WheelPicker.OnItemSelectedListener}, so you must always
120 | * consider the influence when you call this method set a new value
121 | * You should always set a value which greater than or equal to 0 and less than data source's
122 | * length
123 | * By default, position of current selected item in data source is 0
124 | *
125 | * @param position 当前被选中的数据项所显示的数据在数据源中的位置
126 | */
127 | void setSelectedItemPosition(int position);
128 |
129 | /**
130 | * 获取当前被选中的数据项所显示的数据在数据源中的位置
131 | * 与{@link #getSelectedItemPosition()}不同的是,该方法所返回的结果会因为滚轮选择器的改变而改变
132 | *
133 | * Get the position of current selected item in data source
134 | * The difference between {@link #getSelectedItemPosition()}, the value this method return will
135 | * change by WheelPicker scrolled
136 | *
137 | * @return 当前被选中的数据项所显示的数据在数据源中的位置
138 | */
139 | int getCurrentItemPosition();
140 |
141 | /**
142 | * 获取数据列表
143 | *
157 | * Set data source of WheelPicker
158 | * The data source can be any type, WheelPicker will change the data to string when it draw the
159 | * item.
160 | * There is a default data source when you not set the data source for WheelPicker.
161 | * Set data source for WheelPicker will reset state of it, you can refer to
162 | * {@link #setSelectedItemPosition(int)} for more details.
163 | *
164 | * @param data 数据列表
165 | */
166 | void setData(List data);
167 |
168 | /**
169 | * 设置数据项是否有相同的宽度
170 | * 滚轮选择器在确定尺寸大小时会通过遍历数据源来计算每一条数据文本的宽度以找到最宽的文本作为滚轮选择器的
171 | * 最终宽度,当数据源的数据非常多时,这个过程可能会消耗大量的时间导致效率降低,而且在大部分数据量多情况
172 | * 下,数据文本大都有相同的宽度,这种情况下调用该方法告诉滚轮选择器数据宽度相同则可以免去上述计算时间,
173 | * 提升效率
174 | * 有些时候,你所加载的数据源确实是每条数据文本的宽度都不同,但是你知道最宽的数据文本在数据源中的位置,
175 | * 这时你可以调用{@link #setMaximumWidthTextPosition(int)}方法告诉滚轮选择器最宽的这条数据文本在数据
176 | * 源的什么位置,滚轮选择器则会根据该位置找到该条数据文本并将其宽度作为滚轮选择器的宽度。如果你不知道位
177 | * 置,但是知道最宽的数据文本,那么你也可以直接通过调用{@link #setMaximumWidthText(String)}告诉滚轮选
178 | * 择器最宽的文本是什么,滚轮选择器会根据这条文本计算宽度并将其作为滚轮选择器的宽度
179 | *
180 | * Set items of WheelPicker if has same width
181 | * WheelPicker will traverse the data source to calculate each data text width to find out the
182 | * maximum text width for the final view width, this process maybe spends a lot of time and
183 | * reduce efficiency when data source has large amount data, in most large amount data case,
184 | * data text always has same width, you can call this method tell to WheelPicker your data
185 | * source has same width to save time and improve efficiency.
186 | * Sometimes the data source you set is positively has different text width, but maybe you know
187 | * the maximum width text's position in data source, then you can call
188 | * {@link #setMaximumWidthTextPosition(int)} tell to WheelPicker where is the maximum width text
189 | * in data source, WheelPicker will calculate its width base on this text which found by
190 | * position. If you don't know the position of maximum width text in data source, but you have
191 | * maximum width text, you can call {@link #setMaximumWidthText(String)} tell to WheelPicker
192 | * what maximum width text is directly, WheelPicker will calculate its width base on this text.
193 | *
194 | * @param hasSameSize 是否有相同的宽度
195 | */
196 | void setSameWidth(boolean hasSameSize);
197 |
198 | /**
199 | * 数据项是否有相同宽度
200 | *
237 | * Get the position of maximum width text in data source
238 | *
239 | * @return 最宽的文本在数据源中的位置
240 | */
241 | int getMaximumWidthTextPosition();
242 |
243 | /**
244 | * 设置最宽的文本在数据源中的位置
245 | *
246 | * Set the position of maximum width text in data source
247 | *
248 | * @param position 最宽的文本在数据源中的位置
249 | * @see #setSameWidth(boolean)
250 | */
251 | void setMaximumWidthTextPosition(int position);
252 |
253 | /**
254 | * 获取当前选中的数据项文本颜色
255 | *
256 | * Get text color of current selected item
257 | * For example 0xFF123456
258 | *
259 | * @return 当前选中的数据项文本颜色
260 | */
261 | int getSelectedItemTextColor();
262 |
263 | /**
264 | * 设置当前选中的数据项文本颜色
265 | *
266 | * Set text color of current selected item
267 | * For example 0xFF123456
268 | *
269 | * @param color 当前选中的数据项文本颜色,16位颜色值
270 | */
271 | void setSelectedItemTextColor(int color);
272 |
273 | /**
274 | * 获取数据项文本颜色
275 | *
276 | * Get text color of items
277 | * For example 0xFF123456
278 | *
279 | * @return 数据项文本颜色
280 | */
281 | int getItemTextColor();
282 |
283 | /**
284 | * 设置数据项文本颜色
285 | *
286 | * Set text color of items
287 | * For example 0xFF123456
288 | *
289 | * @param color 数据项文本颜色,16位颜色值
290 | */
291 | void setItemTextColor(int color);
292 |
293 | /**
294 | * 获取数据项文本尺寸大小
295 | *
296 | * Get text size of items
297 | * Unit in px
298 | *
299 | * @return 数据项文本尺寸大小
300 | */
301 | int getItemTextSize();
302 |
303 | /**
304 | * 设置数据项文本尺寸大小
305 | *
306 | * Set text size of items
307 | * Unit in px
308 | *
309 | * @param size 设置数据项文本尺寸大小,单位:px
310 | */
311 | void setItemTextSize(int size);
312 |
313 | /**
314 | * 获取滚轮选择器数据项之间间距
315 | *
316 | * Get space between items
317 | * Unit in px
318 | *
319 | * @return 滚轮选择器数据项之间间距
320 | */
321 | int getItemSpace();
322 |
323 | /**
324 | * 设置滚轮选择器数据项之间间距
325 | *
326 | * Set space between items
327 | * Unit in px
328 | *
329 | * @param space 滚轮选择器数据项之间间距,单位:px
330 | */
331 | void setItemSpace(int space);
332 |
333 | /**
334 | * 设置滚轮选择器是否显示指示器
335 | * 如果设置滚轮选择器显示指示器,那么将会在滚轮选择器的当前选中数据项上下显示两根分割线
336 | * 需要注意的是指示器的尺寸并不参与滚轮选择器的尺寸计算,其会绘制在滚轮选择器的上方
337 | *
338 | * Set whether WheelPicker display indicator or not
339 | * WheelPicker will draw two lines above an below current selected item if display indicator
340 | * Notice:Indicator's size will not participate in WheelPicker's size calculation, it will drawn
341 | * above the content
342 | *
343 | * @param hasIndicator 是否有指示器
344 | */
345 | void setIndicator(boolean hasIndicator);
346 |
347 | /**
348 | * 滚轮选择器是否有指示器
349 | *
379 | * Get color of indicator
380 | * For example 0xFF123456
381 | *
382 | * @return 滚轮选择器指示器颜色,16位颜色值
383 | */
384 | int getIndicatorColor();
385 |
386 | /**
387 | * 设置滚轮选择器指示器颜色
388 | *
389 | * Set color of indicator
390 | * For example 0xFF123456
391 | *
392 | * @param color 滚轮选择器指示器颜色,16位颜色值
393 | */
394 | void setIndicatorColor(int color);
395 |
396 | /**
397 | * 设置滚轮选择器是否显示幕布
398 | * 设置滚轮选择器显示幕布的话将会在当前选中的项上方绘制一个与当前数据项大小一致的矩形区域并填充指定颜色
399 | *
400 | * Set whether WheelPicker display curtain or not
401 | * WheelPicker will draw a rectangle as big as current selected item and fill specify color
402 | * above content if curtain display
403 | *
404 | * @param hasCurtain 滚轮选择器是否显示幕布
405 | */
406 | void setCurtain(boolean hasCurtain);
407 |
408 | /**
409 | * 滚轮选择器是否显示幕布
410 | *
473 | * Set whether WheelPicker enable curved effect or not
474 | * If setCurved true, WheelPicker will display with curved effect looks like ends bend into
475 | * screen with perspective.
476 | * WheelPicker's curved effect base on strict geometric model, some parameters relate with size
477 | * maybe invalidated, for example each item size looks like different because of perspective in
478 | * curved, the space between items looks like have a little difference
479 | *
480 | * @param isCurved 滚轮选择器是否开启卷曲效果
481 | */
482 | void setCurved(boolean isCurved);
483 |
484 | /**
485 | * 获取滚轮选择器数据项的对齐方式
486 | *
1154 | * Invoke when WheelPicker scroll stopped
1155 | * WheelPicker will return a distance offset which between current scroll position and
1156 | * initial position, this offset is a positive or a negative, positive means WheelPicker is
1157 | * scrolling from bottom to top, negative means WheelPicker is scrolling from top to bottom
1158 | *
1159 | * @param offset 当前滚轮滚动距离上一次滚轮滚动停止后偏移的距离
1160 | *
1161 | * Distance offset which between current scroll position and initial position
1162 | */
1163 | void onWheelScrolled(int offset);
1164 |
1165 | /**
1166 | * 当滚轮选择器停止后回调该方法
1167 | * 滚轮选择器停止后会回调该方法并将当前选中的数据项在数据列表中的位置返回
1168 | *
1169 | * Invoke when WheelPicker scroll stopped
1170 | * This method will be called when WheelPicker stop and return current selected item data's
1171 | * position in list
1172 | *
1173 | * @param position 当前选中的数据项在数据列表中的位置
1174 | *
1175 | * Current selected item data's position in list
1176 | */
1177 | void onWheelSelected(int position);
1178 |
1179 | /**
1180 | * 当滚轮选择器滚动状态改变时回调该方法
1181 | * 滚动选择器的状态总是会在静止、拖动和滑动三者之间切换,当状态改变时回调该方法
1182 | *
1183 | * Invoke when WheelPicker's scroll state changed
1184 | * The state of WheelPicker always between idle, dragging, and scrolling, this method will
1185 | * be called when they switch
1186 | *
1187 | * @param state 滚轮选择器滚动状态,其值仅可能为下列之一
1188 | * {@link WheelPicker#SCROLL_STATE_IDLE}
1189 | * 表示滚动选择器处于静止状态
1190 | * {@link WheelPicker#SCROLL_STATE_DRAGGING}
1191 | * 表示滚动选择器处于拖动状态
1192 | * {@link WheelPicker#SCROLL_STATE_SCROLLING}
1193 | * 表示滚动选择器处于滑动状态
1194 | *
1195 | * State of WheelPicker, only one of the following
1196 | * {@link WheelPicker#SCROLL_STATE_IDLE}
1197 | * Express WheelPicker in state of idle
1198 | * {@link WheelPicker#SCROLL_STATE_DRAGGING}
1199 | * Express WheelPicker in state of dragging
1200 | * {@link WheelPicker#SCROLL_STATE_SCROLLING}
1201 | * Express WheelPicker in state of scrolling
1202 | */
1203 | void onWheelScrollStateChanged(int state);
1204 | }
1205 | }
1206 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/dev/aige/wheelpicker/model/City.java:
--------------------------------------------------------------------------------
1 | package dev.aige.wheelpicker.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.List;
5 |
6 | /**
7 | * Created by Administrator on 2016/9/14 0014.
8 | */
9 | public class City implements Serializable {
10 | public String name;
11 | public List area;
12 |
13 | public String getName() {
14 | return name;
15 | }
16 |
17 | public void setName(String name) {
18 | this.name = name;
19 | }
20 |
21 | public List getArea() {
22 | return area;
23 | }
24 |
25 | public void setArea(List area) {
26 | this.area = area;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/dev/aige/wheelpicker/model/Province.java:
--------------------------------------------------------------------------------
1 | package dev.aige.wheelpicker.model;
2 |
3 |
4 | import java.io.Serializable;
5 | import java.util.List;
6 |
7 | /**
8 | * Created by Administrator on 2016/9/14 0014.
9 | */
10 | public class Province implements Serializable {
11 | public String name;
12 | public List city;
13 |
14 | public String getName() {
15 | return name;
16 | }
17 |
18 | public void setName(String name) {
19 | this.name = name;
20 | }
21 |
22 | public List getCity() {
23 | return city;
24 | }
25 |
26 | public void setCity(List city) {
27 | this.city = city;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/dev/aige/wheelpicker/widgets/IWheelAreaPicker.java:
--------------------------------------------------------------------------------
1 | package dev.aige.wheelpicker.widgets;
2 |
3 | /**
4 | * Created by Administrator on 2016/9/27 0027.
5 | */
6 |
7 | public interface IWheelAreaPicker {
8 | String getProvince();
9 |
10 | String getCity();
11 |
12 | String getArea();
13 |
14 | void hideArea();
15 | }
16 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/dev/aige/wheelpicker/widgets/IWheelDatePicker.java:
--------------------------------------------------------------------------------
1 | package dev.aige.wheelpicker.widgets;
2 |
3 | import android.widget.TextView;
4 |
5 | import java.util.Date;
6 |
7 | public interface IWheelDatePicker {
8 | void setOnDateSelectedListener(WheelDatePicker.OnDateSelectedListener listener);
9 |
10 | Date getCurrentDate();
11 |
12 | int getItemAlignYear();
13 |
14 | void setItemAlignYear(int align);
15 |
16 | int getItemAlignMonth();
17 |
18 | void setItemAlignMonth(int align);
19 |
20 | int getItemAlignDay();
21 |
22 | void setItemAlignDay(int align);
23 |
24 | WheelYearPicker getWheelYearPicker();
25 |
26 | WheelMonthPicker getWheelMonthPicker();
27 |
28 | WheelDayPicker getWheelDayPicker();
29 |
30 | TextView getTextViewYear();
31 |
32 | TextView getTextViewMonth();
33 |
34 | TextView getTextViewDay();
35 | }
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/dev/aige/wheelpicker/widgets/IWheelDayPicker.java:
--------------------------------------------------------------------------------
1 | package dev.aige.wheelpicker.widgets;
2 |
3 | /**
4 | * 选择器方法接口
5 | *