Skip to content

Commit ce87aa2

Browse files
authored
chore(🐙): fix snapshot example for Android (#3622)
Updated the View component to include collapsable={false} and added SVG elements for testing.
1 parent 5fcd65d commit ce87aa2

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

apps/example/src/Examples/API/Snapshot.tsx

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
useWindowDimensions,
99
ScrollView,
1010
} from "react-native";
11+
import Svg, { Circle, Rect } from "react-native-svg";
1112
import type { SkImage } from "@shopify/react-native-skia";
1213
import {
1314
Canvas,
@@ -54,7 +55,7 @@ export const Snapshot = () => {
5455

5556
return (
5657
<View style={{ flex: 1 }}>
57-
<View ref={viewRef} style={styles.view}>
58+
<View ref={viewRef} style={styles.view} collapsable={false}>
5859
<Component />
5960
</View>
6061
<Button title="Take snapshot" onPress={takeSnapshot} />
@@ -114,23 +115,11 @@ const Component = () => {
114115
</View>
115116
<Text>Hello World!</Text>
116117
<View style={{ flexDirection: "row" }}>
117-
<View
118-
style={{
119-
width: 80,
120-
height: 80,
121-
backgroundColor: "blue",
122-
opacity: 0.5,
123-
}}
124-
>
125-
<View
126-
style={{
127-
width: 40,
128-
height: 40,
129-
backgroundColor: "green",
130-
opacity: 0.5,
131-
}}
132-
/>
133-
</View>
118+
<Svg width={80} height={80} viewBox="0 0 80 80">
119+
<Rect x={0} y={0} width={80} height={80} fill="blue" opacity={0.5} />
120+
<Circle cx={40} cy={40} r={25} fill="green" opacity={0.7} />
121+
<Rect x={30} y={30} width={20} height={20} fill="red" opacity={0.5} />
122+
</Svg>
134123
<View
135124
style={{
136125
width: 40,

0 commit comments

Comments
 (0)