-
Notifications
You must be signed in to change notification settings - Fork 515
/
Copy pathChatHeads.js
38 lines (36 loc) · 1023 Bytes
/
ChatHeads.js
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
import React, { Component } from 'react';
import { StyleSheet, View } from 'react-native';
import Interactable from 'react-native-interactable';
export default class ChatHeads extends Component {
render() {
return (
<View style={styles.container}>
<Interactable.View
snapTo={[
{x: -140, y: -280},
{x: 140, y: -280},
{x: -140, y: -140},
{x: 140, y: -140},
{x: -140, y: 0},
{x: 140, y: 0},
{x: -140, y: 140},
{x: 140, y: 140},
{x: -140, y: 280},
{x: 140, y: 280, damping: 0.05}
]}
initialPosition={{x: -140, y: -280}}
resistance={2000}>
<View style={{width: 50, height: 50, backgroundColor: 'red', borderRadius: 25}} />
</Interactable.View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'white',
}
});