diff --git a/reanimatedRN/App.tsx b/reanimatedRN/App.tsx index 8d28fcd..bf4900d 100644 --- a/reanimatedRN/App.tsx +++ b/reanimatedRN/App.tsx @@ -10,6 +10,7 @@ import Transitions from "./src/Transitions"; import FlatList from "./src/FlatList"; import StickyFooter from "./src/StickyFooter"; import ProgressBar from "./src/ProgressBar"; +import MaskedView from "./src/MaskedView"; const Stack = createStackNavigator(); @@ -91,6 +92,14 @@ const AppNavigator = () => ( header: () => null, }} /> + null, + }} + /> ); diff --git a/reanimatedRN/src/Main/Main.tsx b/reanimatedRN/src/Main/Main.tsx index 162e923..01ef7a2 100644 --- a/reanimatedRN/src/Main/Main.tsx +++ b/reanimatedRN/src/Main/Main.tsx @@ -32,6 +32,9 @@ const Main = ({ navigation }: any) => { navigation.navigate("ProgressBar")} style={styles.buttonContainer}> ProgressBar + navigation.navigate("Masked View")} style={styles.buttonContainer}> + Masked View + ); diff --git a/reanimatedRN/src/MaskedView/index.tsx b/reanimatedRN/src/MaskedView/index.tsx new file mode 100644 index 0000000..80ab99b --- /dev/null +++ b/reanimatedRN/src/MaskedView/index.tsx @@ -0,0 +1,45 @@ +import React from "react"; +import { View, Image } from "react-native"; +import MaskedView from "@react-native-community/masked-view"; + +interface ComponentProps { + ring: Ring; +} + +type Color = string; + +interface Ring { + start: Color; + end: Color; + bg: Color; + theta: number; + size: number; +} + +export default ({ ring }: ComponentProps) => { + const maskElement = ( + + ); + return ( + + + + + + ); +}; diff --git a/reanimatedRN/src/MaskedView/mask.png b/reanimatedRN/src/MaskedView/mask.png new file mode 100644 index 0000000..a88851d Binary files /dev/null and b/reanimatedRN/src/MaskedView/mask.png differ diff --git a/reanimatedRN/yarn.lock b/reanimatedRN/yarn.lock index b30d677..013c63d 100644 --- a/reanimatedRN/yarn.lock +++ b/reanimatedRN/yarn.lock @@ -1528,7 +1528,7 @@ "@react-native-community/masked-view@^0.1.11": version "0.1.11" - resolved "https://registry.npmjs.org/@react-native-community/masked-view/-/masked-view-0.1.11.tgz" + resolved "https://registry.yarnpkg.com/@react-native-community/masked-view/-/masked-view-0.1.11.tgz#2f4c6e10bee0786abff4604e39a37ded6f3980ce" integrity sha512-rQfMIGSR/1r/SyN87+VD8xHHzDYeHaJq6elOSCAD+0iLagXkSI2pfA0LmSXP21uw5i3em7GkkRjfJ8wpqWXZNw== "@react-native/assets@1.0.0":