-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestDragSort.js
More file actions
40 lines (34 loc) · 937 Bytes
/
TestDragSort.js
File metadata and controls
40 lines (34 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* @file TestDragSort.js
* @description
* @author liushun
* @created 2025/12/24 15:51
* @lastModified 2025/12/24 15:51
*/
import {Dimensions, ScrollView, Text, View} from "react-native";
import DragSortView from "./lib/DragSortView";
import React, {useRef} from "react";
const windowWidth = Dimensions.get("window").width;
const TestDragSort = () => {
const renderOneItem = (item, index) => {
return(
<View style={{width: windowWidth, height: 50, backgroundColor: 'red', justifyContent: 'center', alignItems: 'center'}}>
<Text>{item}</Text>
</View>
)
}
return(
<DragSortView
column={1}
childrenWidth={windowWidth}
childrenHeight={50}
renderItem={renderOneItem}
rowSpace={10}
dataSource={['1','2','3','4','5','6','7','8','9','10','11','12', '13','14','15','16','17','18']}
onDragEnd={(from, to, data)=>{
console.log(from, to, data)
}}
/>
)
}
export default TestDragSort;