Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-wheel

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-wheel - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

Screenshot/result_one.png

2

package.json
{
"name": "react-native-wheel",
"version": "1.0.7",
"version": "1.0.8",
"description": "android wheel view for react-native",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -73,41 +73,91 @@ # react-native-wheel

// file: index.android.js
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
ToastAndroid,
View,
} = React;
var WheelView = require('react-native-wheel');
var { AppRegistry,StyleSheet,Text,View,ToastAndroid } = React;
var Dimensions = require('Dimensions');
var SCREEN_WIDTH = Dimensions.get('window').width;
var SCREEN_HEIGHT = Dimensions.get('window').height;
var wheelData = ['one','two','three','four','five','six','seven','eight','nine','ten'];
var currentIndex;
var AwesomeProject = React.createClass({
onItemChange(index){
ToastAndroid.show('select item : ' + wheelData[index],ToastAndroid.SHORT);
},
render: function() {
return (
<View style={styles.container}>
<WheelView
style={styles.wheelview}
onItemChange={this.onItemChange}
values={wheelData}
isLoop={true}
selectedIndex={0}
textSize={17}
/>
</View>
);
}
previous(){
this.refs.wheel.previous();
},
next(){
this.refs.wheel.next();
},
finish(){
ToastAndroid.show('select item : ' + wheelData[currentIndex] ,ToastAndroid.LONG);
},
onItemChange(index){
currentIndex = index;
},
render: function() {
return (
<View style={styles.container}>
<Text style={styles.welcome} onPress={this.previous} >
上一个
</Text>
<Text style={styles.instructions} onPress={this.next} >
下一个
</Text>
<Text style={styles.instructions} onPress={this.finish} >
完成
</Text>
<WheelView
style={styles.wheelview}
onItemChange={this.onItemChange}
values={wheelData}
isLoop={false}
selectedIndex={0}
textSize={20}
ref='wheel'
/>
</View>
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
justifyContent: 'flex-end',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
previous: {
margin: 20,
fontSize: 22,
color: '#000000',
},
next: {
margin: 20,
color: '#000000',
fontSize: 22,
},
finish: {
margin: 20,
color: '#000000',
fontSize: 22,
},
wheelview: {
width: 120,
height: 300
width: SCREEN_WIDTH,
height: SCREEN_HEIGHT/5*2,
},

@@ -122,5 +172,6 @@ });

## Notes
- if has error , please check build.gradle config
- you can modify this library (react-native-wheel/build.gradle)
- Only in the following versions tested , other versions do not guarantee success
```gradle
// file: react-native-wheel/build.gradle

@@ -133,3 +184,3 @@ android {

minSdkVersion 16
targetSdkVersion 23 //@
targetSdkVersion 22 //@
}

@@ -139,16 +190,6 @@ }

dependencies {
compile 'com.facebook.react:react-native:0.15.+' //@
compile 'com.facebook.react:react-native:0.16.1' //@
}
// modify the above @ value not higher than you project value
```
##Reference
https://github.com/weidongjian/androidWheelView
## Run Renderings
<center>
<img src="https://github.com/shexiaoheng/react-native-wheel/blob/master/Screenshot/result.png"
width="300" height="450"/>
</center>
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc