fix: BlurView on Android

This commit is contained in:
Lei Nelissen
2022-11-12 17:43:24 +01:00
parent cd10ddd260
commit b2bd211758
2 changed files with 18 additions and 9 deletions

View File

@@ -108,8 +108,14 @@ export function ColoredBlurView(props: PropsWithChildren<BlurViewProps>) {
: scheme === 'dark' ? 'extraDark' : 'xlight'
} />
) : (
<View {...props} style={[ props.style, {
backgroundColor: scheme === 'light' ? '#f6f6f6f6' : '#333333f6',
} ]} />
<BlurView
{...props}
blurType={scheme === 'dark' ? 'dark' : 'light'}
blurAmount={10}
style={[ props.style, {
backgroundColor: scheme === 'light' ? '#f6f6f6bb' : '#333333bb',
borderRadius: 8
} ]}
/>
);
}

View File

@@ -1,5 +1,5 @@
import React, { useCallback, useEffect, useRef } from 'react';
import { ActivityIndicator, Animated, Dimensions, Easing, Pressable, View } from 'react-native';
import { ActivityIndicator, Animated, Dimensions, Easing, Platform, Pressable, View } from 'react-native';
import FastImage from 'react-native-fast-image';
import styled, { css } from 'styled-components/native';
@@ -144,11 +144,14 @@ function NowPlaying() {
return (
<Container>
<ShadowOverlay pointerEvents='none'>
<Shadow distance={30} style={{ alignSelf: 'stretch', flexBasis: '100%' }} startColor="#00000017">
<View style={{ flex: 1, borderRadius: 8 }} />
</Shadow>
</ShadowOverlay>
{/** TODO: Fix shadow overflow on Android */}
{Platform.OS === 'ios' ? (
<ShadowOverlay pointerEvents='none'>
<Shadow distance={30} style={{ alignSelf: 'stretch', flexBasis: '100%' }} startColor="#00000017">
<View style={{ flex: 1, borderRadius: 8 }} />
</Shadow>
</ShadowOverlay>
) : null}
<ColoredBlurView style={{ borderRadius: 8 }}>
<InnerContainer onPress={openNowPlayingModal} activeOpacity={0.5} testID="open-player-modal">
<ShadowWrapper size="small">