Comments (2)
render item drag and drop
<SortableGrid
key={"sortableGrid"}
style={{ margin: 10,flex:1}}
itemsPerRow={3}
dragActivationTreshold={100}
ref={'SortableGrid'}
dragStartAnimation={this.getDragStartAnimation()}
onDragRelease={(item, index) => this.onDragRelease(item, index)}
onDragStart={() => this.startCustomAnimation()}
>
{
this.state.media.map((item, index) => {
return (
item !== "empty"
?
<View style={{ height: 106, width: 106, alignSelf: "center" }} key={unique-key-${index}
}>
<Image source={{ uri: item.image_id === "" ? item.thumbnail : item.image }} style={{
width: 100,
height: 100,
borderRadius: 20,
alignSelf: "center",
borderColor: '#ababab',
borderWidth: 2
}} />
<TouchableOpacity style={[styles.Indicator, { borderWidth: 1, borderColor: "#ababab", borderRadius: 10, backgroundColor: "#FFF" }]} onPress={() => this.removeMedia({ item, index })}>
<Image source={require("../../assets/images/error.png")} style={{ height: 20, width: 20, alignSelf: "center", }} resizeMode="contain" />
:
<TouchableOpacity onPress={() => this.getImageOrVideo(index)} key={key-${index}
} inactive={true}>
<View style={[styles.cellEmptyImg, { alignSelf: "center" },]}>
<Image source={require("../../assets/images/button.png")} style={{ height: 50, width: 50, }} resizeMode="cover" />
add photo
)
})
}
from react-native-sortable-grid.
create array for sortable list.
for (var i = 0; i < 6; i++) {
if (res.Results[i] !== null && res.Results[i] !== "" && res.Results[i] !== undefined) {
let count = 1
this.setState({ count: count })
data.push(res.Results[i])
tempData.push(res.Results[i])
} else {
data.push("empty")
}
if (this.state.count === 1) {
this.setState({ disabled: false }, () => console.log(this.state.disabled))
}
}
this.setState({ media: data, loading: false, tempImageArray: tempData }, () => console.log("verified photos =====>", this.state.media))
from react-native-sortable-grid.
Related Issues (20)
- Drag and Drop fails and the Grid collapses. HOT 3
- Drag icons in a long ScrollView with autoscroll HOT 2
- Still supported? HOT 3
- onDragStart not working with delete functionality?
- How to make draggable item clickable?
- want some inactive items not to be sorted, inactive property is not working HOT 5
- Can i Add outside item to items inside grid? HOT 1
- Android performance is sluggish and unusable HOT 1
- different quantities of items in different rows HOT 9
- how to slide item to left or right and delete
- Is there an example where item values change on reorder? HOT 1
- Add an item HOT 1
- inactive props doesn't work for me HOT 3
- how to set inactive = false. to it's child HOT 5
- Deprecated Lifecycle Method .....Warning: componentWillReceiveProps has been renamed... HOT 1
- scroll grid not work
- When will the latest commit be merged into master?
- restrict to one movement
- Not working with TouchableOpacity/Pressable
- Customize number of items in each column/row
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-sortable-grid.