react-native-draglistview
v0.0.6
Published
React Native control implementing list view with draggable items for Android
Downloads
2
Readme
Installation
- Install package from npm
npm install --save react-native-draglistview
- Link the package: add these lines to
android/settings.gradle
include ':RNDragListView'
project(':RNDragListView').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-draglistview/android')
- Link the package: add the following line to dependencies in
android/app/build.gradle
compile project(':RNDragListView')
- Link the package: add the package to MainApplication:
...
+ import com.tssoft.draglistview.DragScrollViewPackage;
...
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
+ new DragScrollViewPackage()
);
}
};
...
Usage example
<DragListView
data={['item 1', 'item 2', 'item 3']}
onRowMoved={event => console.log(event.from, event.to)}
renderRow={row => <Text>{row}</Text>}
/>