Skip to content

Commit 695b349

Browse files
authored
fix: notification's shadow artifacts on Android (use needsOffscreenAlphaCompositing={true}) (#225)
* * fix shadow artifacts on Android (use needsOffscreenAlphaCompositing={true}) * ref: facebook/react-native#23090 (comment) * * use needsOffscreenAlphaCompositing only on Android
1 parent 1d1f8c8 commit 695b349

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core/renderers/AnimationRenderer.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { ReactNode } from 'react'
22
import Animated from 'react-native-reanimated'
33
import { LongPressGestureHandler } from 'react-native-gesture-handler'
4-
import { View } from 'react-native'
4+
import { Platform, View } from 'react-native'
55
import type { NotificationState } from '../hooks/useNotificationsStates'
66
import type { AnimationAPI } from '../hooks/useAnimationAPI'
77
import { styles } from '../utils/styles'
@@ -18,7 +18,9 @@ type Props = {
1818

1919
export const AnimationRenderer = ({ children, animationAPI, state }: Props) => {
2020
return (
21-
<Animated.View style={[animationAPI.animatedStyles]}>
21+
<Animated.View
22+
style={[animationAPI.animatedStyles]}
23+
needsOffscreenAlphaCompositing={Platform.OS === 'android'}>
2224
{state.notificationEvent && (
2325
<LongPressGestureHandler
2426
minDurationMs={800}

0 commit comments

Comments
 (0)