import React, { Component } from 'react';
import { StyleSheet, View, TouchableOpacity, Text } from 'react-native';
import Interactable from '../../Interactable';
export default class MoreChatHeads extends Component {
constructor(props) {
super(props);
this.state = {
currentExample: undefined,
};
}
render() {
if (this.state.currentExample) {
return this.state.currentExample();
}
return (
Simple implementation
Drag via spring
Localized springs
Gravity wells
Friction on lower half
);
}
onExamplePress(currentExample) {
this.setState({ currentExample });
}
renderSimple() {
return (
);
}
renderDragViaSpring() {
return (
);
}
renderLocalizedSprings() {
return (
);
}
renderGravityWells() {
return (
);
}
renderHalfFriction() {
return (
);
}
onStopInteraction(event) {
const x = event.nativeEvent.x;
const y = event.nativeEvent.y;
console.log(`stopped at x=${x}, y=${y}`);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'white',
},
button: {
color: 'blue',
fontSize: 24,
marginBottom: 24,
},
markerContainer: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
position: 'absolute',
left: 0,
right: 0,
top: 0,
bottom: 0,
},
marker: {
width: 50,
height: 50,
margin: 10,
backgroundColor: 'white',
borderRadius: 25,
borderWidth: 2,
borderColor: '#dddddd',
position: 'relative',
},
head: {
width: 70,
height: 70,
backgroundColor: 'red',
borderRadius: 35,
},
});