mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 18:13:25 +00:00
use insets to respect notch
This commit is contained in:
@@ -8,6 +8,7 @@ import Animated, {
|
|||||||
useAnimatedStyle,
|
useAnimatedStyle,
|
||||||
useSharedValue,
|
useSharedValue,
|
||||||
} from "react-native-reanimated";
|
} from "react-native-reanimated";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
import { ResizeMode, Video } from "expo-av";
|
import { ResizeMode, Video } from "expo-av";
|
||||||
import * as Haptics from "expo-haptics";
|
import * as Haptics from "expo-haptics";
|
||||||
import * as NavigationBar from "expo-navigation-bar";
|
import * as NavigationBar from "expo-navigation-bar";
|
||||||
@@ -279,6 +280,7 @@ function GestureOverlay(props: {
|
|||||||
type: "brightness" | "volume";
|
type: "brightness" | "volume";
|
||||||
}) {
|
}) {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
|
||||||
const animatedStyle = useAnimatedStyle(() => {
|
const animatedStyle = useAnimatedStyle(() => {
|
||||||
return {
|
return {
|
||||||
@@ -291,8 +293,10 @@ function GestureOverlay(props: {
|
|||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
position="absolute"
|
position="absolute"
|
||||||
left={props.type === "brightness" ? "$7" : undefined}
|
// left={props.type === "brightness" ? "$7" : undefined}
|
||||||
right={props.type === "volume" ? "$7" : undefined}
|
left={props.type === "brightness" ? insets.left + 20 : undefined}
|
||||||
|
// right={props.type === "volume" ? "$7" : undefined}
|
||||||
|
right={props.type === "volume" ? insets.right + 20 : undefined}
|
||||||
borderRadius="$4"
|
borderRadius="$4"
|
||||||
gap={8}
|
gap={8}
|
||||||
height="50%"
|
height="50%"
|
||||||
|
Reference in New Issue
Block a user