Gathering detailed insights and metrics for react-native-hole-view
Gathering detailed insights and metrics for react-native-hole-view
Gathering detailed insights and metrics for react-native-hole-view
Gathering detailed insights and metrics for react-native-hole-view
npm install react-native-hole-view
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
399 Stars
181 Commits
24 Forks
10 Watching
4 Branches
10 Contributors
Updated on 26 Nov 2024
Kotlin (25.86%)
Java (19.32%)
Objective-C (16.98%)
Objective-C++ (12.21%)
TypeScript (10.45%)
C++ (8.99%)
Ruby (3.6%)
Shell (0.81%)
Starlark (0.74%)
JavaScript (0.69%)
CMake (0.35%)
Cumulative downloads
Total Downloads
Last day
-39%
1,470
Compared to previous day
Last week
-23%
8,096
Compared to previous week
Last month
-1.5%
45,393
Compared to previous month
Last year
48%
328,586
Compared to previous year
2
4
1import { RNHoleView } from 'react-native-hole-view'; 2 3<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> 4 <Text style={{ flexGrow: 0, flex: 0, padding: 10 }}>{"Wow! I'm a text inside a hole!"}</Text> 5 <TouchableOpacity onPress={() => {}} style={{ backgroundColor: 'pink', padding: 10, borderRadius: 5 }}> 6 <Text>{"Wow! I'm a button inside a hole!"}</Text> 7 </TouchableOpacity> 8 <ScrollView style={{ flexGrow: 0, flex: 0, padding: 10 }} horizontal={true}> 9 <Text numberOfLines={1}> 10 { 11 "Wow! I'm a ScrollView inside a hole! Wow! I'm a ScrollView inside a hole! Wow! I'm a ScrollView inside a hole!" 12 } 13 </Text> 14 </ScrollView> 15 <RNHoleView 16 style={{ position: 'absolute', width: '100%', height: '100%', backgroundColor: 'rgba(34,146,231,0.4)' }} 17 holes={[{ x: 150, y: 390, width: 120, height: 120, borderRadius: 60 }]}> 18 </RNHoleView> 19</View>
Works with any nested views:
1import { RNHoleView } from 'react-native-hole-view 2import Video from 'react-native-video'; 3 4<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> 5 <Text style={{ flexGrow: 0, flex: 0, padding: 10 }}>{"Wow! I'm a text inside a hole!"}</Text> 6 <TouchableOpacity onPress={() => {}} style={{ backgroundColor: 'pink', padding: 10, borderRadius: 5 }}> 7 <Text>{"Wow! I'm a button inside a hole!"}</Text> 8 </TouchableOpacity> 9 <ScrollView style={{ flexGrow: 0, flex: 0, padding: 10 }} horizontal={true}> 10 <Text numberOfLines={1}> 11 { 12 "Wow! I'm a ScrollView inside a hole! Wow! I'm a ScrollView inside a hole! Wow! I'm a ScrollView inside a hole!" 13 } 14 </Text> 15 </ScrollView> 16 <RNHoleView 17 style={{ position: 'absolute', width: '100%', height: '100%', backgroundColor: 'rgba(34,146,231,0.4)' }} 18 holes={[{ x: 150, y: 390, width: 120, height: 120, borderRadius: 60 }]}> 19 <Video source={{ uri: 'http://clips.vorwaerts-gmbh.de/VfE_html5.mp4' }} style={{ flex: 1 }} /> 20 </RNHoleView> 21</View>
Can be animated:
1import {RNHole, RNHoleView, ERNHoleViewTimingFunction, IRNHoleViewAnimation} from "react-native-hole-view"; 2 3import Video from 'react-native-video'; 4 5const firstHole: RNHole = {x: 150, y: 390, width: 120, height: 120, borderRadius: 60}; 6const secondHole: RNHole = {x: 150, y: 40, width: 120, height: 120, borderRadius: 60}; 7 8const animationSettings: IRNHoleViewAnimation = {timingFunction: ERNHoleViewTimingFunction.EASE_IN_OUT, duration: 200}; 9 10const App = () => { 11 const [holes, setHoles] = useState<RNHole[]>([]); 12 const [animated, setAnimated] = useState<boolean>(false); 13 const [animation, setAnimation] = useState<IRNHoleViewAnimation | undefined>(undefined); 14 15 const onPress = useCallback(() => { 16 if (animated) { 17 setHoles([firstHole]); 18 } else { 19 setHoles([secondHole]) 20 } 21 22 setAnimation({...animationSettings}); 23 setAnimated(!animated); 24 }, [animated, animation]) 25 26 useEffect(() => { 27 onPress(); 28 }, []); 29 30 return ( 31 <View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}> 32 <Text style={{flexGrow: 0, flex: 0, padding: 10}}>{"Wow! I'm a text inside a hole!"}</Text> 33 <TouchableOpacity onPress={() => { 34 }} style={{backgroundColor: 'pink', padding: 10, borderRadius: 5}}> 35 <Text>{"Wow! I'm a button inside a hole!"}</Text> 36 </TouchableOpacity> 37 <ScrollView style={{flexGrow: 0, flex: 0, padding: 10}} horizontal={true}> 38 <Text numberOfLines={1}> 39 { 40 "Wow! I'm a ScrollView inside a hole! Wow! I'm a ScrollView inside a hole! Wow! I'm a ScrollView inside a hole!" 41 } 42 </Text> 43 </ScrollView> 44 <RNHoleView 45 style={{ 46 position: 'absolute', 47 width: '100%', 48 height: '100%', 49 backgroundColor: 'rgba(34,146,231,0.4)' 50 }} 51 animation={animation} 52 holes={holes} 53 onAnimationFinished={() => { 54 setAnimation(undefined); 55 }} 56 > 57 <Video source={{uri: 'http://clips.vorwaerts-gmbh.de/VfE_html5.mp4'}} 58 resizeMode={"contain"} 59 style={{flex: 1}}/> 60 </RNHoleView> 61 <View 62 pointerEvents={'box-none'} 63 style={{ 64 position: 'absolute', 65 flex: 1, 66 width: '100%', 67 height: '100%', 68 alignItems: 'flex-end', 69 flexDirection: 'row', 70 justifyContent: 'center' 71 72 }}> 73 <TouchableOpacity onPress={onPress} 74 style={{backgroundColor: 'pink', padding: 10, borderRadius: 5, bottom: 50}}> 75 <Text>{"Animate!"}</Text> 76 </TouchableOpacity> 77 </View> 78 </View> 79 ); 80};
Install the library using either Yarn:
yarn add react-native-hole-view
or npm:
npm install --save react-native-hole-view
This library fully supports RN's autolinking
cd ios && pod install
By default RN doesn't support click through views on Android. The solution we use is quite dirty, so please support our PR to FB's react-native repo https://github.com/facebook/react-native/pull/28956
If you have any diffuculties - please take a look on example/
app first.
In case you have xcode build error poining on this line
1#import "RCTBridgeModule.h"
please use version 2.0.*
cd example
yarn
cd ios
pod install
cd ..
yarn run android
or yarn run ios
No vulnerabilities found.
Reason
binaries present in source code
Details
Reason
Found 1/20 approved changesets -- score normalized to 0
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
12 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More