
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
react-native-wheel
Advanced tools
the android wheel view for react-native component
npm install --save react-native-wheel
// file: android/settings.gradle
...
include ':reactwheelview', ':app'
project(':reactwheelview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-wheel')
// if there are more library
// include ':app' , ':libraryone' , ':librarytwo' , 'more...'
// project(':libraryonename').projectDir = new File(rootProject.projectDir, '../node_modules/libraryonemodule')
// project(':librarytwoname').projectDir = new File(rootProject.projectDir, '../node_modules/librarytwomodule')
// more..
// file: android/app/build.gradle
...
dependencies {
...
compile project(':reactwheelview')
}
...
import com.heng.wheel.WheelPackage;
public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
private ReactInstanceManager mReactInstanceManager;
private ReactRootView mReactRootView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mReactRootView = new ReactRootView(this);
mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("index.android.bundle")
.setJSMainModuleName("index.android")
.addPackage(new MainReactPackage())
.addPackage(new WheelPackage()) // register wheel package
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();
mReactRootView.startReactApplication(mReactInstanceManager, "AwesomeProject", null);
setContentView(mReactRootView);
}
...
// file: index.android.js
var React = require('react-native');
var WheelView = require('react-native-wheel');
var { AppRegistry,StyleSheet,Text,View,ToastAndroid } = React;
var wheelData = ['one','two','three','four','five','six','seven','eight','nine','ten'];
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>
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
wheelview: {
width: 120,
height: 300
},
});
AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);
android {
compileSdkVersion 23 //@
buildToolsVersion "23.0.1" //@
defaultConfig {
minSdkVersion 16
targetSdkVersion 23 //@
}
}
dependencies {
compile 'com.facebook.react:react-native:0.15.+' //@
}
// modify the above @ value not higher than you project value
##Reference https://github.com/weidongjian/androidWheelView
FAQs
android wheel view for react-native
The npm package react-native-wheel receives a total of 23 weekly downloads. As such, react-native-wheel popularity was classified as not popular.
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.