Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
react-native-wheel
Advanced tools
RN的Android滚轮组件
$ npm install --save react-native-wheel
// file: android/settings.gradle
...
include ':react-native-wheel'
project(':react-native-wheel').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-wheel/android')
// file: android/app/build.gradle
...
dependencies {
...
compile project(':react-native-wheel')
}
// file: android/src/main/java/com.xx/MainApplication.java
...
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 WheelPackage() // Added there
);
}
};
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
ToastAndroid
} from 'react-native';
import WheelView from 'react-native-wheel';
import Dimensions from 'Dimensions';
let SCREEN_WIDTH = Dimensions.get('window').width;
let SCREEN_HEIGHT = Dimensions.get('window').height;
let wheelData = [1,'two',false,0.10,'six','seven','eight','nine','ten'];
let currentIndex;
class AwesomeProject extends Component {
ok(){
ToastAndroid.show('select index : ' + currentIndex +' select item : ' + wheelData[currentIndex] ,ToastAndroid.SHORT);
}
_onItemChange(index){
currentIndex = index;
}
render() {
return (
<View style={styles.container}>
<Text style={styles.ok} onPress={this.ok.bind(this)} >
确定
</Text>
<WheelView
style={styles.wheelview}
onItemChange={this._onItemChange.bind(this)}
values={wheelData}
isLoop={false}
selectedIndex={0}
textSize={20}
velocityFling={20}
/>
</View>
);
}
};
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'flex-end',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
ok: {
margin: 5,
color: '#000000',
fontSize: 18,
},
wheelview: {
width: SCREEN_WIDTH,
height: SCREEN_HEIGHT/5*2,
},
});
AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);
FAQs
android wheel view for react-native
We found that react-native-wheel demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.