diff --git a/README.md b/README.md index 412756d..c67d507 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ then do `npx pod-install` cornerSmoothing number Controls the amount of smoothing for the radius, 0 means there is no smoothing (will render like any other View, 100 is maximum amount - 0 + 100 preserveSmoothing diff --git a/android/src/main/java/expo/modules/squircleview/ExpoSquircleViewModule.kt b/android/src/main/java/expo/modules/squircleview/ExpoSquircleViewModule.kt index 28a19a8..259e594 100644 --- a/android/src/main/java/expo/modules/squircleview/ExpoSquircleViewModule.kt +++ b/android/src/main/java/expo/modules/squircleview/ExpoSquircleViewModule.kt @@ -9,30 +9,30 @@ class ExpoSquircleViewModule : Module() { Name("ExpoSquircleView") View(ExpoSquircleView::class) { - Prop("cornerSmoothing") { view: ExpoSquircleView, prop: Int -> - view.setCornerSmoothing(prop) - } - - Prop("borderRadius") { view: ExpoSquircleView, prop: Float -> - view.setBorderRadius(prop) - } - - Prop("backgroundColor") { view: ExpoSquircleView, prop: Int? -> + Prop("squircleBackgroundColor") { view: ExpoSquircleView, prop: Int? -> if (prop != null) { view.setViewBackgroundColor(prop) } } - Prop("borderColor") { view: ExpoSquircleView, prop: Int? -> + Prop("squircleBorderColor") { view: ExpoSquircleView, prop: Int? -> if (prop != null) { view.setBorderColor(prop) } } - Prop("borderWidth") { view: ExpoSquircleView, prop: Float -> + Prop("squircleBorderWidth") { view: ExpoSquircleView, prop: Float -> view.setBorderWidth(prop) } + Prop("borderRadius") { view: ExpoSquircleView, prop: Float -> + view.setBorderRadius(prop) + } + + Prop("cornerSmoothing") { view: ExpoSquircleView, prop: Int -> + view.setCornerSmoothing(prop) + } + Prop("preserveSmoothing") { view: ExpoSquircleView, prop: Boolean -> view.setPreserveSmoothing(prop) } diff --git a/example/App.tsx b/example/App.tsx index e091dc1..722443b 100644 --- a/example/App.tsx +++ b/example/App.tsx @@ -1,8 +1,10 @@ -import { SafeAreaView, ScrollView, StyleSheet, Text, View } from "react-native"; +import { Button, SafeAreaView, ScrollView, StyleSheet, Text, View } from "react-native"; import { SquircleView } from "expo-squircle-view"; import { Slider } from "@miblanchard/react-native-slider"; import React from "react"; +import Animated, { useAnimatedProps, useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated"; + export default function App() { const WIDTH = 390; @@ -22,6 +24,19 @@ export default function App() { const [borderWidth, setBorderWidth] = React.useState(BORDER_WIDTH); const [padding, setPadding] = React.useState(0); + + // Reanimated Testing + // const widthSV = useSharedValue(WIDTH); + // const scaleSV = useSharedValue(0.9); + // const animatedStyle = useAnimatedStyle(() => { + // return { + // width: widthSV.value, + // flexDirection: 'row-reverse', + // transform: [{ scale: scaleSV.value }] + // } + // }) + // End Reanimated Testing + return ( @@ -121,7 +136,7 @@ export default function App() { - + Squircle - + + {/* */} @@ -180,7 +197,39 @@ export default function App() { react-native-figma-squircle */} - + + {/* Reanimated Testing */} + {/*