Skip to content

Commit 5edf693

Browse files
committed
Improve FAB entrance animation logic and adjust positioning
1 parent 3827432 commit 5edf693

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mobile/app/game/[id].tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,11 @@ export default function GameScreen() {
175175
}
176176
}, [gameState.isShowingResult]);
177177

178-
// FAB entrance animation
178+
// FAB entrance animation — only on first appearance
179+
const fabHasAnimated = useRef(false);
179180
useEffect(() => {
180-
if (!isLoading && !miniMapShown && !gameState.isShowingResult) {
181+
if (!isLoading && !miniMapShown && !gameState.isShowingResult && !fabHasAnimated.current) {
182+
fabHasAnimated.current = true;
181183
fabScaleAnim.setValue(0);
182184
Animated.spring(fabScaleAnim, {
183185
toValue: 1,
@@ -531,7 +533,7 @@ export default function GameScreen() {
531533
{
532534
transform: [{ scale: fabScaleAnim }],
533535
bottom: Math.max(insets.bottom, 20) + 20,
534-
right: Math.max(insets.right, 20),
536+
right: Math.max(insets.right, 60),
535537
},
536538
]}
537539
>

0 commit comments

Comments
 (0)