Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
react-native-picker
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ym
react-native-picker
Commits
c01dd8a7
Commit
c01dd8a7
authored
Sep 19, 2016
by
xwenliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
example debug
parent
0be959c1
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
163 additions
and
103 deletions
+163
-103
example/PickerTest/android/app/BUCK
example/PickerTest/android/app/BUCK
+1
-1
example/PickerTest/android/app/build.gradle
example/PickerTest/android/app/build.gradle
+8
-1
example/PickerTest/android/app/proguard-rules.pro
example/PickerTest/android/app/proguard-rules.pro
+6
-3
example/PickerTest/android/app/src/main/AndroidManifest.xml
example/PickerTest/android/app/src/main/AndroidManifest.xml
+1
-0
example/PickerTest/android/app/src/main/java/com/pickertest/MainActivity.java
...ndroid/app/src/main/java/com/pickertest/MainActivity.java
+0
-25
example/PickerTest/android/app/src/main/java/com/pickertest/MainApplication.java
...oid/app/src/main/java/com/pickertest/MainApplication.java
+37
-0
example/PickerTest/android/app/src/main/res/values/strings.xml
...le/PickerTest/android/app/src/main/res/values/strings.xml
+1
-0
example/PickerTest/android/build.gradle
example/PickerTest/android/build.gradle
+1
-1
example/PickerTest/android/settings.gradle
example/PickerTest/android/settings.gradle
+2
-0
example/PickerTest/index.android.js
example/PickerTest/index.android.js
+1
-1
example/PickerTest/index.ios.js
example/PickerTest/index.ios.js
+19
-15
example/PickerTest/ios/PickerTest.xcodeproj/project.pbxproj
example/PickerTest/ios/PickerTest.xcodeproj/project.pbxproj
+69
-23
example/PickerTest/ios/PickerTest/AppDelegate.m
example/PickerTest/ios/PickerTest/AppDelegate.m
+3
-25
example/PickerTest/ios/PickerTest/Info.plist
example/PickerTest/ios/PickerTest/Info.plist
+12
-6
example/PickerTest/package.json
example/PickerTest/package.json
+2
-2
No files found.
example/PickerTest/android/app/BUCK
View file @
c01dd8a7
...
...
@@ -5,7 +5,7 @@ import re
# - install Buck
# - `npm start` - to start the packager
# - `cd android`
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US`
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US
"
`
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
# - `buck install -r android/app` - compile, install and run application
#
...
...
example/PickerTest/android/app/build.gradle
View file @
c01dd8a7
...
...
@@ -55,7 +55,13 @@ import com.android.build.OutputFile
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"]
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"]
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
...
...
@@ -120,6 +126,7 @@ android {
}
dependencies
{
compile
project
(
':react-native-picker'
)
compile
fileTree
(
dir:
"libs"
,
include:
[
"*.jar"
])
compile
"com.android.support:appcompat-v7:23.0.1"
compile
"com.facebook.react:react-native:+"
// From node_modules
...
...
example/PickerTest/android/app/proguard-rules.pro
View file @
c01dd8a7
...
...
@@ -26,11 +26,14 @@
#
See
http
://
sourceforge
.
net
/
p
/
proguard
/
bugs
/
466
/
-
keep
,
allowobfuscation
@
interface
com
.
facebook
.
proguard
.
annotations
.
DoNotStrip
-
keep
,
allowobfuscation
@
interface
com
.
facebook
.
proguard
.
annotations
.
KeepGettersAndSetters
-
keep
,
allowobfuscation
@
interface
com
.
facebook
.
common
.
internal
.
DoNotStrip
#
Do
not
strip
any
method
/
class
that
is
annotated
with
@
DoNotStrip
-
keep
@
com
.
facebook
.
proguard
.
annotations
.
DoNotStrip
class
*
-
keep
@
com
.
facebook
.
common
.
internal
.
DoNotStrip
class
*
-
keepclassmembers
class
*
{
@
com
.
facebook
.
proguard
.
annotations
.
DoNotStrip
*
;
@
com
.
facebook
.
common
.
internal
.
DoNotStrip
*
;
}
-
keepclassmembers
@
com
.
facebook
.
proguard
.
annotations
.
KeepGettersAndSetters
class
*
{
...
...
@@ -51,9 +54,9 @@
-
keepattributes
Signature
-
keepattributes
*
Annotation
*
-
keep
class
com
.
squareup
.
okhttp
.
**
{
*
;
}
-
keep
interface
com
.
squareup
.
okhttp
.
**
{
*
;
}
-
dontwarn
com
.
squareup
.
okhttp
.
**
-
keep
class
okhttp3
.
**
{
*
;
}
-
keep
interface
okhttp3
.
**
{
*
;
}
-
dontwarn
okhttp3
.
**
#
okio
...
...
example/PickerTest/android/app/src/main/AndroidManifest.xml
View file @
c01dd8a7
...
...
@@ -11,6 +11,7 @@
android:targetSdkVersion=
"22"
/>
<application
android:name=
".MainApplication"
android:allowBackup=
"true"
android:label=
"@string/app_name"
android:icon=
"@mipmap/ic_launcher"
...
...
example/PickerTest/android/app/src/main/java/com/pickertest/MainActivity.java
View file @
c01dd8a7
package
com.pickertest
;
import
com.facebook.react.ReactActivity
;
import
com.facebook.react.ReactPackage
;
import
com.facebook.react.shell.MainReactPackage
;
import
java.util.Arrays
;
import
java.util.List
;
public
class
MainActivity
extends
ReactActivity
{
...
...
@@ -17,24 +12,4 @@ public class MainActivity extends ReactActivity {
protected
String
getMainComponentName
()
{
return
"PickerTest"
;
}
/**
* Returns whether dev mode should be enabled.
* This enables e.g. the dev menu.
*/
@Override
protected
boolean
getUseDeveloperSupport
()
{
return
BuildConfig
.
DEBUG
;
}
/**
* A list of packages used by the app. If the app uses additional views
* or modules besides the default ones, add more packages here.
*/
@Override
protected
List
<
ReactPackage
>
getPackages
()
{
return
Arrays
.<
ReactPackage
>
asList
(
new
MainReactPackage
()
);
}
}
example/PickerTest/android/app/src/main/java/com/pickertest/MainApplication.java
0 → 100644
View file @
c01dd8a7
package
com.pickertest
;
import
android.app.Application
;
import
android.util.Log
;
import
com.facebook.react.ReactApplication
;
import
com.beefe.picker.PickerViewPackage
;
import
com.facebook.react.ReactInstanceManager
;
import
com.facebook.react.ReactNativeHost
;
import
com.facebook.react.ReactPackage
;
import
com.facebook.react.shell.MainReactPackage
;
import
java.util.Arrays
;
import
java.util.List
;
public
class
MainApplication
extends
Application
implements
ReactApplication
{
private
final
ReactNativeHost
mReactNativeHost
=
new
ReactNativeHost
(
this
)
{
@Override
protected
boolean
getUseDeveloperSupport
()
{
return
BuildConfig
.
DEBUG
;
}
@Override
protected
List
<
ReactPackage
>
getPackages
()
{
return
Arrays
.<
ReactPackage
>
asList
(
new
MainReactPackage
(),
new
PickerViewPackage
()
);
}
};
@Override
public
ReactNativeHost
getReactNativeHost
()
{
return
mReactNativeHost
;
}
}
example/PickerTest/android/app/src/main/res/values/strings.xml
View file @
c01dd8a7
<resources>
<string
name=
"app_name"
>
PickerTest
</string>
</resources>
example/PickerTest/android/build.gradle
View file @
c01dd8a7
...
...
@@ -18,7 +18,7 @@ allprojects {
jcenter
()
maven
{
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url
"$
projectDir/..
/../node_modules/react-native/android"
url
"$
rootDir
/../node_modules/react-native/android"
}
}
}
example/PickerTest/android/settings.gradle
View file @
c01dd8a7
rootProject
.
name
=
'PickerTest'
include
':app'
include
':react-native-picker'
project
(
':react-native-picker'
).
projectDir
=
new
File
(
rootProject
.
projectDir
,
'../node_modules/react-native-picker/android'
)
example/PickerTest/index.android.js
View file @
c01dd8a7
...
...
@@ -3,7 +3,7 @@
* https://github.com/facebook/react-native
*/
import
React
,
{
Component
}
from
'
react
'
import
React
,
{
Component
}
from
'
react
'
;
import
{
View
,
Text
,
...
...
example/PickerTest/index.ios.js
View file @
c01dd8a7
...
...
@@ -3,7 +3,7 @@
* https://github.com/facebook/react-native
*/
import
React
,
{
Component
}
from
'
react
'
import
React
,
{
Component
}
from
'
react
'
;
import
{
View
,
Text
,
...
...
@@ -50,27 +50,31 @@ class PickerTest extends Component {
}
_onPressHandle
()
{
this
.
picker
.
toggle
();
Picker
.
init
({
pickerData
:
createDateData
(),
selectedValue
:
[
'
2015年
'
,
'
12月
'
,
'
12日
'
],
onPickerConfirm
:
pickedValue
=>
{
alert
(
JSON
.
stringify
(
pickedValue
));
console
.
log
(
pickedValue
);
},
onPickerCancel
:
pickedValue
=>
{
alert
(
JSON
.
stringify
(
pickedValue
));
console
.
log
(
pickedValue
);
},
onPickerSelect
:
pickedValue
=>
{
alert
(
JSON
.
stringify
(
pickedValue
));
console
.
log
(
pickedValue
);
}
});
Picker
.
show
();
}
render
(){
render
()
{
return
(
<
View
style
=
{{
height
:
Dimensions
.
get
(
'
window
'
).
height
}}
>
<
TouchableOpacity
style
=
{{
marginTop
:
20
}}
onPress
=
{
this
.
_onPressHandle
.
bind
(
this
)}
>
<
Text
>
Click
Me
<
/Text
>
<
/TouchableOpacity
>
<
Picker
ref
=
{
picker
=>
this
.
picker
=
picker
}
style
=
{{
height
:
260
}}
showMask
=
{
true
}
showDuration
=
{
300
}
pickerData
=
{
createDateData
()}
selectedValue
=
{[
'
2015年
'
,
'
12月
'
,
'
12日
'
]}
onPickerDone
=
{(
pickedValue
)
=>
{
alert
(
JSON
.
stringify
(
pickedValue
));
console
.
log
(
pickedValue
);
}}
/
>
<
/View
>
);
}
...
...
example/PickerTest/ios/PickerTest.xcodeproj/project.pbxproj
View file @
c01dd8a7
This diff is collapsed.
Click to expand it.
example/PickerTest/ios/PickerTest/AppDelegate.m
View file @
c01dd8a7
...
...
@@ -9,6 +9,7 @@
#import "AppDelegate.h"
#import "RCTBundleURLProvider.h"
#import "RCTRootView.h"
@implementation
AppDelegate
...
...
@@ -17,36 +18,13 @@
{
NSURL
*
jsCodeLocation
;
/**
* Loading JavaScript code - uncomment the one you want.
*
* OPTION 1
* Load from development server. Start the server from the repository root:
*
* $ npm start
*
* To run on device, change `localhost` to the IP address of your computer
* (you can get this by typing `ifconfig` into the terminal and selecting the
* `inet` value under `en0:`) and make sure your computer and iOS device are
* on the same Wi-Fi network.
*/
jsCodeLocation
=
[
NSURL
URLWithString
:
@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"
];
/**
* OPTION 2
* Load from pre-bundled file on disk. The static bundle is automatically
* generated by the "Bundle React Native code and images" build step when
* running the project on an actual device or running the project on the
* simulator in the "Release" build configuration.
*/
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
jsCodeLocation
=
[[
RCTBundleURLProvider
sharedSettings
]
jsBundleURLForBundleRoot
:
@"index.ios"
fallbackResource
:
nil
];
RCTRootView
*
rootView
=
[[
RCTRootView
alloc
]
initWithBundleURL
:
jsCodeLocation
moduleName:
@"PickerTest"
initialProperties:
nil
launchOptions:
launchOptions
];
rootView
.
backgroundColor
=
[[
UIColor
alloc
]
initWithRed
:
1
.
0
f
green
:
1
.
0
f
blue
:
1
.
0
f
alpha
:
1
];
self
.
window
=
[[
UIWindow
alloc
]
initWithFrame
:[
UIScreen
mainScreen
].
bounds
];
UIViewController
*
rootViewController
=
[
UIViewController
new
];
...
...
example/PickerTest/ios/PickerTest/Info.plist
View file @
c01dd8a7
...
...
@@ -38,11 +38,17 @@
<false/>
<key>
NSLocationWhenInUseUsageDescription
</key>
<string></string>
<key>
NSAppTransportSecurity
</key>
<dict>
<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
<key>
NSAllowsArbitraryLoads
</key>
<true/>
</dict>
<key>
NSAppTransportSecurity
</key>
<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
<dict>
<key>
NSExceptionDomains
</key>
<dict>
<key>
localhost
</key>
<dict>
<key>
NSTemporaryExceptionAllowsInsecureHTTPLoads
</key>
<true/>
</dict>
</dict>
</dict>
</dict>
</plist>
example/PickerTest/package.json
View file @
c01dd8a7
...
...
@@ -6,8 +6,8 @@
"start"
:
"node_modules/react-native/packager/packager.sh"
},
"dependencies"
:
{
"react"
:
"15.
0.2
"
,
"react-native"
:
"^0.
26.1
"
,
"react"
:
"15.
3.1
"
,
"react-native"
:
"^0.
32.0
"
,
"react-native-picker"
:
"beefe/react-native-picker"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment