Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/examples/src/routes/SpeedDial/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class Index extends Component<IndexProps, IndexState> {
children={[
{
icon: <Icon name="plus" color="#fff" size={18} />,
title: <Text>'Add'</Text>,
title: <Text>Add</Text>,
onPress: () => console.log('Add'),
},
{
Expand Down
42 changes: 23 additions & 19 deletions packages/core/src/SpeedDial/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function SpeedDial(props: SpeedDialProps) {
const pan: Animated.ValueXY = useRef(new Animated.ValueXY()).current;
const panResponder = useRef(
PanResponder.create({
onMoveShouldSetPanResponder: () => true,
onMoveShouldSetPanResponder: () => isDrag,
onPanResponderGrant: () => {
pan.setOffset({
x: (pan.x as PanXY)._value,
Expand Down Expand Up @@ -136,24 +136,30 @@ function SpeedDial(props: SpeedDialProps) {
return (
<View>
<Animated.View
style={[styles.viewPosition, { transform: [{ translateX: pan.x }, { translateY: pan.y }] }]}
style={[
styles.viewPosition,
{
bottom: bottom - MainHeight,
right: right,
},
{ transform: [{ translateX: pan.x }, { translateY: pan.y }] },
]}
// {...panResponder.panHandlers}
>
{success &&
children.map((item, i) => (
<Animated.View
style={[
styles.fadingContainer,
{
// Bind opacity to animated value
opacity: fadeAnim[i],
},
]}
key={i}
>
<Item {...item} move={panResponder.panHandlers} />
</Animated.View>
))}
{children.map((item, i) => (
<Animated.View
style={[
styles.fadingContainer,
{
// Bind opacity to animated value
opacity: fadeAnim[i],
},
]}
key={i}
>
<Item {...item} move={panResponder.panHandlers} />
</Animated.View>
))}

<View {...panResponder.panHandlers} style={{ alignItems: 'flex-end' }}>
<TouchableOpacity activeOpacity={1} onPress={onOpenHome}>
Expand All @@ -174,8 +180,6 @@ const styles = StyleSheet.create({
},
viewPosition: {
position: 'absolute',
bottom: 350 - MainHeight,
right: 40,
},

homeContainer: {
Expand Down