Skip to content

Commit

Permalink
fix: notification's shadow artifacts on Android (use needsOffscreenAl…
Browse files Browse the repository at this point in the history
…phaCompositing={true}) (#225)

* * fix shadow artifacts on Android (use needsOffscreenAlphaCompositing={true})
* ref: facebook/react-native#23090 (comment)

* * use needsOffscreenAlphaCompositing only on Android
  • Loading branch information
PdoubleU committed Nov 20, 2023
1 parent 1d1f8c8 commit 695b349
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/renderers/AnimationRenderer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ReactNode } from 'react'
import Animated from 'react-native-reanimated'
import { LongPressGestureHandler } from 'react-native-gesture-handler'
import { View } from 'react-native'
import { Platform, View } from 'react-native'
import type { NotificationState } from '../hooks/useNotificationsStates'
import type { AnimationAPI } from '../hooks/useAnimationAPI'
import { styles } from '../utils/styles'
Expand All @@ -18,7 +18,9 @@ type Props = {

export const AnimationRenderer = ({ children, animationAPI, state }: Props) => {
return (
<Animated.View style={[animationAPI.animatedStyles]}>
<Animated.View
style={[animationAPI.animatedStyles]}
needsOffscreenAlphaCompositing={Platform.OS === 'android'}>
{state.notificationEvent && (
<LongPressGestureHandler
minDurationMs={800}
Expand Down

0 comments on commit 695b349

Please sign in to comment.