Skip to content

Commit dfc3093

Browse files
committed
Merge branch 'master' of https://github.com/xgfe/react-native-picker-xg into version0.0.2
2 parents 8a744db + 859b713 commit dfc3093

File tree

2,076 files changed

+44820
-292
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,076 files changed

+44820
-292
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
node_modules
2-
android
3-
ios
4-
.idea
2+
.idea

.idea/workspace.xml

Lines changed: 2201 additions & 200 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 91 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,98 @@ react native Picker component for both Android and iOS.
1515
```
1616
npm install react-native-tpicker --save
1717
```
18+
### Properties
19+
* For the cascade wheel Picker:
20+
* level: number, the number of the level of the wheels, and please make sure the number equals the length of the selectIndex's array if you have.[Mandatory]
1821

22+
* Common properties:
23+
* data: [see the data structure part], the content of the picker.[Mandatory]
24+
* inputValue: string, the initial text of the textInput
25+
* selectIndex: [number] ,initial selected item
26+
* confirmBtnText: string, the text of the confirm button
27+
* cancelBtnText: string, the text of the cancel button
28+
* confirmBtnStyle: CSS-layout, the confirm button's style
29+
* cancelBtnStyle: CSS-layout, the cancel button;s style
30+
* selfStyle: CSS-layout, the innerContainer's style
31+
* inputStyle: CSS-layout, the textInput's style
32+
* enable: bool, to enable or disable the textInput
33+
* visible: bool, to set the initial status of the wheels.
34+
35+
###Method
36+
* onResult: function, to expose the result you chose.
37+
38+
###Data structure
39+
Basicly, you can realize as more as wheels as you like if you follow the data structure we set for you. However, take the size of the phone into consideration, we do not recommend more than 4 wheels.
40+
* For the basic pickers: It's an array, the count of the wheel depends on how many objects you have. And the content of the wheel depends on the name of one objects of the outer objects.
41+
```
42+
let wheel2 = [
43+
{
44+
amc: {
45+
name: '2011年',
46+
},
47+
alfa: {
48+
name: '2012年',
49+
},
50+
aston: {
51+
name: '2013年',
52+
},
53+
audi: {
54+
name: '2014年',
55+
},
56+
austin: {
57+
name: '2015年',
58+
},
59+
borgward: {
60+
name: '2016年',
61+
},
62+
buick: {
63+
name: '2017年',
64+
},
65+
cadillac: {
66+
name: '2018年',
67+
},
68+
chevrolet: {
69+
name: '2019年',
70+
},
71+
},
72+
{
73+
amc1: {
74+
name: '1月',
75+
},
76+
alfa1: {
77+
name: '2月',
78+
},
79+
aston1: {
80+
name: '3月',
81+
},
82+
audi1: {
83+
name: '4月',
84+
},
85+
},
86+
]
87+
```
88+
89+
* For the cascade wheels: It'a an object in total, and the keys of one object become the content of the wheel. The last wheel's content is an array.
90+
```
91+
let level3Data =
92+
{
93+
"四川":{
94+
"成都":["青羊区","武侯区","温江区"],
95+
"绵阳":["绵阳中学","核弹基地"],
96+
"广安":["容县","武胜"]
97+
},
98+
"浙江":{
99+
"杭州":["西湖","银泰","玉泉"],
100+
"绍兴":["X1","X2","X3"],
101+
"place":["Y1","Y2","Y3","Y4","Y5"],
102+
},
103+
"some":{
104+
"place1":["Z1","Z2","Z3"],
105+
"place2":["Z4","Z5","Z6","Z7"],
106+
"place3":["A1","A2","A3","A4","A5","A6"],
107+
}
108+
}
109+
```
19110
### Example
20111
![image](https://raw.githubusercontent.com/lulutia/react-native-tpicker/master/show.gif)
21112

@@ -291,92 +382,6 @@ Two ways:
291382
```
292383
* the example has already in the index.android.js and index.ios.js
293384
294-
### Properties
295-
* selectIndex: [number] ,initial selected item
296-
* selfStyle: CSS-layout, the innerContainer's style
297-
* inputStyle: CSS-layout, the textInput's style
298-
* confirmBtnText: string, the text of the confirm button
299-
* cancelBtnText: string, the text of the cancel button
300-
* confirmBtnStyle: CSS-layout, the confirm button's style
301-
* cancelBtnStyle: CSS-layout, the cancel button;s style
302-
* enable: bool, to enable or disable the textInput
303-
* inputValue: string, the initial text of the textInput
304-
305-
###Method
306-
* onResult: function, to expose the result you chose.
307-
308-
###Data structure
309-
Basicly, you can realize as more as wheels as you like if you follow the data structure we set for you. However, take the size of the phone into consideration, we do not recommend more than 4 wheels.
310-
* For the basic pickers: It's an array, the count of the wheel depends on how many objects you have. And the content of the wheel depends on the name of one objects of the outer objects.
311-
```
312-
let wheel2 = [
313-
{
314-
amc: {
315-
name: '2011年',
316-
},
317-
alfa: {
318-
name: '2012年',
319-
},
320-
aston: {
321-
name: '2013年',
322-
},
323-
audi: {
324-
name: '2014年',
325-
},
326-
austin: {
327-
name: '2015年',
328-
},
329-
borgward: {
330-
name: '2016年',
331-
},
332-
buick: {
333-
name: '2017年',
334-
},
335-
cadillac: {
336-
name: '2018年',
337-
},
338-
chevrolet: {
339-
name: '2019年',
340-
},
341-
},
342-
{
343-
amc1: {
344-
name: '1月',
345-
},
346-
alfa1: {
347-
name: '2月',
348-
},
349-
aston1: {
350-
name: '3月',
351-
},
352-
audi1: {
353-
name: '4月',
354-
},
355-
},
356-
]
357-
```
358-
359-
* For the cascade wheels: It'a an object in total, and the keys of one object become the content of the wheel. The last wheel's content is an array.
360-
```
361-
let level3Data =
362-
{
363-
"四川":{
364-
"成都":["青羊区","武侯区","温江区"],
365-
"绵阳":["绵阳中学","核弹基地"],
366-
"广安":["容县","武胜"]
367-
},
368-
"浙江":{
369-
"杭州":["西湖","银泰","玉泉"],
370-
"绍兴":["X1","X2","X3"],
371-
"place":["Y1","Y2","Y3","Y4","Y5"],
372-
},
373-
"some":{
374-
"place1":["Z1","Z2","Z3"],
375-
"place2":["Z4","Z5","Z6","Z7"],
376-
"place3":["A1","A2","A3","A4","A5","A6"],
377-
}
378-
}
379-
```
380385
* For more information, you can see the examples.
381386
382387
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#Wed Jun 01 22:58:25 CST 2016
17 Bytes
Binary file not shown.
110 KB
Binary file not shown.
368 KB
Binary file not shown.
19 KB
Binary file not shown.
30.4 KB
Binary file not shown.

android/app/BUCK

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import re
2+
3+
# To learn about Buck see [Docs](https://buckbuild.com/).
4+
# To run your application with Buck:
5+
# - install Buck
6+
# - `npm start` - to start the packager
7+
# - `cd android`
8+
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US`
9+
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
10+
# - `buck install -r android/app` - compile, install and run application
11+
#
12+
13+
lib_deps = []
14+
for jarfile in glob(['libs/*.jar']):
15+
name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile)
16+
lib_deps.append(':' + name)
17+
prebuilt_jar(
18+
name = name,
19+
binary_jar = jarfile,
20+
)
21+
22+
for aarfile in glob(['libs/*.aar']):
23+
name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile)
24+
lib_deps.append(':' + name)
25+
android_prebuilt_aar(
26+
name = name,
27+
aar = aarfile,
28+
)
29+
30+
android_library(
31+
name = 'all-libs',
32+
exported_deps = lib_deps
33+
)
34+
35+
android_library(
36+
name = 'app-code',
37+
srcs = glob([
38+
'src/main/java/**/*.java',
39+
]),
40+
deps = [
41+
':all-libs',
42+
':build_config',
43+
':res',
44+
],
45+
)
46+
47+
android_build_config(
48+
name = 'build_config',
49+
package = 'com.widgets',
50+
)
51+
52+
android_resource(
53+
name = 'res',
54+
res = 'src/main/res',
55+
package = 'com.widgets',
56+
)
57+
58+
android_binary(
59+
name = 'app',
60+
package_type = 'debug',
61+
manifest = 'src/main/AndroidManifest.xml',
62+
keystore = '//android/keystores:debug',
63+
deps = [
64+
':app-code',
65+
],
66+
)

0 commit comments

Comments
 (0)