Skip to content

Commit c3067b9

Browse files
committed
fix: add experimentalBlurMethod prop to ThemedBlurView in EntryNormalItem for better Android support
1 parent 90718d9 commit c3067b9

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

apps/mobile/src/components/common/ThemedBlurView.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { useColorScheme } from "nativewind"
44
import { Platform, StyleSheet, View } from "react-native"
55
import { useColor } from "react-native-uikit-colors"
66

7+
/**
8+
* @android In Android, the BlurView is experimental and not fully supported,
9+
* so we use a normal View with a background color with **100% opacity**.
10+
* However, if the `experimentalBlurMethod` prop is explicitly provided,
11+
* we'll use the BlurView even on Android,
12+
*/
713
export const ThemedBlurView = ({
814
ref,
915
tint,
@@ -13,7 +19,9 @@ export const ThemedBlurView = ({
1319

1420
const background = useColor("systemBackground")
1521

16-
return Platform.OS === "ios" ? (
22+
const useBlurView = Platform.OS === "ios" || "experimentalBlurMethod" in rest
23+
24+
return useBlurView ? (
1725
<BlurView
1826
ref={ref}
1927
intensity={100}

apps/mobile/src/modules/entry-list/templates/EntryNormalItem.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@ export const EntryNormalItem = memo(
164164
}}
165165
>
166166
<View className="overflow-hidden rounded-full p-2">
167-
<ThemedBlurView style={StyleSheet.absoluteFillObject} intensity={30} />
167+
<ThemedBlurView
168+
style={StyleSheet.absoluteFillObject}
169+
intensity={30}
170+
experimentalBlurMethod="none"
171+
/>
168172
{isPlaying ? (
169173
<PauseCuteFiIcon color="white" width={24} height={24} />
170174
) : isLoading ? (

0 commit comments

Comments
 (0)