Skip to content

Instantly share code, notes, and snippets.

@itsramiel
Last active June 20, 2022 11:27
Show Gist options
  • Save itsramiel/8cce4d71b7871af0d68f72c2e2dc3bca to your computer and use it in GitHub Desktop.
Save itsramiel/8cce4d71b7871af0d68f72c2e2dc3bca to your computer and use it in GitHub Desktop.
const style1 = useAnimatedStyle(() => {
return {
width: VIEW_WIDTH,
height: VIEW_HEIGHT,
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} />
</AnimatedPressable>
</View>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment