Skip to content

Instantly share code, notes, and snippets.

@itsramiel
Last active June 20, 2022 12:08
Show Gist options
  • Save itsramiel/fee26b723e6e84e565697b8b1a6964bb to your computer and use it in GitHub Desktop.
Save itsramiel/fee26b723e6e84e565697b8b1a6964bb to your computer and use it in GitHub Desktop.
const style2 = useAnimatedStyle(() => {
return {
width: VIEW_HEIGHT,
height: VIEW_WIDTH,
backgroundColor: "white",
position: "absolute",
top: FAB_SIZE / 2 - VIEW_HEIGHT / 2,
left: FAB_SIZE / 2 - VIEW_WIDTH / 2
};
}, []);
return (
<View style={styles.container}>
<StatusBar style="auto" />
<AnimatedPressable
style={[styles.fabContainer, FabStyle]}
onPress={() => (progress.value = withTiming(1))}
onLongPress={() => (progress.value = withTiming(0))}
>
<Animated.View style={style1} />
<Animated.View style={style2} />
</AnimatedPressable>
</View>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment