You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-6Lines changed: 16 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ Includes iOS-style haptic and audio feedback 🍏
60
60
61
61
## Peer Dependencies 👶
62
62
63
-
This component will work in your React Native Project **_without any peer dependencies_**.
63
+
This component will work in your React Native Project **_without any peer dependencies_**. However, to enable various features (e.g. fade-out, feedback) you will need to supply various libraries as props. These are detailed below.
64
64
65
65
### Linear Gradient
66
66
@@ -71,6 +71,15 @@ If you want the numbers to fade in/out at the top and bottom of the picker, you
71
71
72
72
**To enable the linear gradient, you need to supply the component as a prop to either TimerPickerModal or TimerPicker.**
73
73
74
+
### Masked View
75
+
76
+
To make the numbers fade in/out on a transparent background (e.g. if the picker is rendered on top of a gradient or image), you will need to install the [@react-native-masked-view/masked-view
77
+
](https://www.npmjs.com/package/@react-native-masked-view/masked-view) component. This is as the standard LinearGradient implementation relies on there being a solid background colour.
78
+
79
+
`import MaskedView from "@react-native-masked-view/masked-view";`
80
+
81
+
**To enable the fade-out on a transparent background, you need to supply the imported `MaskedView` component AND one of the LinearGradient components as props to either TimerPickerModal or TimerPicker.**
82
+
74
83
### Haptic Feedback
75
84
76
85
Enable haptic feedback with the [expo-haptics](https://www.npmjs.com/package/expo-haptics) module:
@@ -464,10 +473,11 @@ return (
464
473
| repeatMinuteNumbersNTimes | Set the number of times the list of minutes is repeated in the picker | Number | 3 | false |
465
474
| repeatSecondNumbersNTimes | Set the number of times the list of seconds is repeated in the picker | Number | 3 | false |
| Audio |[Audio Class (required for audio feedback i.e. click sound)](#audio-feedback-click-sound)|[expo-av](https://www.npmjs.com/package/expo-av).Audio | - | false |
480
+
| pickerFeedback |[Generic picker feedback as alternative to the above Expo feedback support](#generic-feedback)|`() => void \| Promise<void> `| - | false |
471
481
| FlatList | FlatList component used internally to implement each picker (hour, minutes and seconds). More info [below](#custom-flatlist)|[react-native](https://reactnative.dev/docs/flatlist).FlatList |`FlatList` from `react-native`| false |
472
482
| clickSoundAsset | Custom sound asset for click sound (required for offline click sound - download default [here](https://drive.google.com/uc?export=download&id=10e1YkbNsRh-vGx1jmS1Nntz8xzkBp4_I)) | require(.../somefolderpath) or {uri: www.someurl}| - | false |
473
483
| pickerContainerProps | Props for the picker container |`React.ComponentProps<typeof View>`| - | false |
@@ -533,7 +543,7 @@ The custom component needs to have the same interface as React Native's `<FlatLi
533
543
534
544
#### Generic feedback
535
545
536
-
To enable haptic feedback from the non-Expo module [react-native-haptic-feedback](https://github.com/mkuczera/react-native-haptic-feedback) or provide feedback in any other form you can use the generic feedback callback prop `pickerFeedback`. This function is called whenever any of the pickers tick onto a new number.
546
+
To enable haptic feedback from the non-Expo module [react-native-haptic-feedback](https://github.com/mkuczera/react-native-haptic-feedback)(or provide feedback in any other form) you can use the generic feedback callback prop `pickerFeedback`. This function is called whenever any of the pickers tick onto a new number.
0 commit comments