Files
react-native-reanimated/Example/interactablePlayground/examples/ChatHeads.js
Krzysztof Magiera 067b440b33 Interactable.View implementation based on reanimated and gesture handler (#106)
This PR adds an implementation of Interactable.View to examples folder. The implementation is pretty feature full with the exception of alertAreas that I haven't had time yet to work on.
2018-09-21 16:18:27 +02:00

45 lines
1.1 KiB
JavaScript

import React, { Component } from 'react';
import { StyleSheet, View } from 'react-native';
import Interactable from '../../Interactable';
export default class ChatHeads extends Component {
render() {
return (
<View style={styles.container}>
<Interactable.View
snapPoints={[
{ x: -140, y: -250 },
{ x: 140, y: -250 },
{ x: -140, y: -120 },
{ x: 140, y: -120 },
{ x: -140, y: 0 },
{ x: 140, y: 0 },
{ x: -140, y: 120 },
{ x: 140, y: 120 },
{ x: -140, y: 250 },
{ x: 140, y: 250, tension: 50, damping: 0.9 },
]}
initialPosition={{ x: -140, y: -250 }}>
<View
style={{
width: 70,
height: 70,
backgroundColor: 'red',
borderRadius: 35,
}}
/>
</Interactable.View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'white',
},
});