Skip to content

Commit 7e1c1a5

Browse files
committed
📝 ➕ add MaskedView dependency to example and update example app to show usage
1 parent 4800a1a commit 7e1c1a5

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

examples/example-expo/App.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { Audio } from "expo-av";
1111
import * as Haptics from "expo-haptics";
1212
import { LinearGradient } from "expo-linear-gradient";
1313
import {
14+
Image,
1415
LayoutAnimation,
1516
Platform,
1617
Pressable,
@@ -27,6 +28,7 @@ import type { NativeScrollEvent, NativeSyntheticEvent } from "react-native";
2728
import { TimerPicker, TimerPickerModal } from "../../src";
2829

2930
import { formatTime } from "./utils/formatTime";
31+
import MaskedView from "@react-native-masked-view/masked-view";
3032

3133
if (Platform.OS === "android") {
3234
UIManager.setLayoutAnimationEnabledExperimental?.(true);
@@ -118,6 +120,7 @@ export default function App() {
118120
setAlarmStringExample1(formatTime(pickedDuration));
119121
setShowPickerExample1(false);
120122
}}
123+
hideHours
121124
setIsVisible={setShowPickerExample1}
122125
styles={{
123126
theme: "dark",
@@ -187,7 +190,10 @@ export default function App() {
187190

188191
const renderExample3 = useMemo(() => {
189192
return (
190-
<View
193+
<LinearGradient
194+
colors={["#202020", "#220578"]}
195+
start={{ x: 0, y: 0 }}
196+
end={{ x: 1, y: 1 }}
191197
style={[
192198
styles.container,
193199
styles.page3Container,
@@ -198,12 +204,13 @@ export default function App() {
198204
Haptics={Haptics}
199205
hourLabel=":"
200206
LinearGradient={LinearGradient}
207+
MaskedView={MaskedView}
201208
minuteLabel=":"
202209
padWithNItems={2}
203210
secondLabel=""
204211
styles={{
205212
theme: "dark",
206-
backgroundColor: "#202020",
213+
backgroundColor: "transparent",
207214
pickerItem: {
208215
fontSize: 34,
209216
},
@@ -226,7 +233,7 @@ export default function App() {
226233
},
227234
}}
228235
/>
229-
</View>
236+
</LinearGradient>
230237
);
231238
}, [screenWidth]);
232239

@@ -363,7 +370,7 @@ const styles = StyleSheet.create({
363370
backgroundColor: "#F1F1F1",
364371
},
365372
page3Container: {
366-
backgroundColor: "#202020",
373+
flex: 1,
367374
},
368375
page4Container: {
369376
backgroundColor: "#F1F1F1",

examples/example-expo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@expo/vector-icons": "^14.0.3",
13+
"@react-native-masked-view/masked-view": "0.3.2",
1314
"expo": "^52.0.11",
1415
"expo-av": "~15.0.1",
1516
"expo-haptics": "~14.0.0",

yarn.lock

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2881,6 +2881,16 @@ __metadata:
28812881
languageName: node
28822882
linkType: hard
28832883

2884+
"@react-native-masked-view/masked-view@npm:0.3.2":
2885+
version: 0.3.2
2886+
resolution: "@react-native-masked-view/masked-view@npm:0.3.2"
2887+
peerDependencies:
2888+
react: ">=16"
2889+
react-native: ">=0.57"
2890+
checksum: e35ab882148df3f9b71f04355d2fb1b24d6f2aaf29043f80758f398bdf905eed67734b36b072fa8b934923ff4e3d80ccb5e37d8376cb1825272078b96a21dadc
2891+
languageName: node
2892+
linkType: hard
2893+
28842894
"@react-native/assets-registry@npm:0.76.2":
28852895
version: 0.76.2
28862896
resolution: "@react-native/assets-registry@npm:0.76.2"
@@ -6326,6 +6336,7 @@ __metadata:
63266336
dependencies:
63276337
"@babel/core": ^7.24.0
63286338
"@expo/vector-icons": ^14.0.3
6339+
"@react-native-masked-view/masked-view": 0.3.2
63296340
"@types/react": ~18.3.12
63306341
"@typescript-eslint/eslint-plugin": ">=5.49.0"
63316342
"@typescript-eslint/parser": ">=5.49.0"

0 commit comments

Comments
 (0)