mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 16:53:25 +00:00
feat: haptic feedback
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { useRef } from "react";
|
import { useRef } from "react";
|
||||||
import { Platform, View } from "react-native";
|
import { Platform, View } from "react-native";
|
||||||
|
import * as Haptics from "expo-haptics";
|
||||||
import { Tabs } from "expo-router";
|
import { Tabs } from "expo-router";
|
||||||
|
|
||||||
import Colors from "@movie-web/tailwind-config/colors";
|
import Colors from "@movie-web/tailwind-config/colors";
|
||||||
@@ -21,6 +22,9 @@ export default function TabLayout() {
|
|||||||
}}
|
}}
|
||||||
screenListeners={({ route }) => ({
|
screenListeners={({ route }) => ({
|
||||||
tabPress: () => {
|
tabPress: () => {
|
||||||
|
void Haptics.notificationAsync(
|
||||||
|
Haptics.NotificationFeedbackType.Success,
|
||||||
|
);
|
||||||
switch (route.name) {
|
switch (route.name) {
|
||||||
case "search":
|
case "search":
|
||||||
focusSearchInputRef.current();
|
focusSearchInputRef.current();
|
||||||
|
@@ -10,6 +10,7 @@ import {
|
|||||||
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
||||||
import { runOnJS, useSharedValue } from "react-native-reanimated";
|
import { runOnJS, useSharedValue } from "react-native-reanimated";
|
||||||
import { ResizeMode, Video } from "expo-av";
|
import { ResizeMode, Video } from "expo-av";
|
||||||
|
import * as Haptics from "expo-haptics";
|
||||||
import * as NavigationBar from "expo-navigation-bar";
|
import * as NavigationBar from "expo-navigation-bar";
|
||||||
import { useRouter } from "expo-router";
|
import { useRouter } from "expo-router";
|
||||||
import * as StatusBar from "expo-status-bar";
|
import * as StatusBar from "expo-status-bar";
|
||||||
@@ -58,6 +59,7 @@ export const VideoPlayer = () => {
|
|||||||
|
|
||||||
const updateResizeMode = (newMode: ResizeMode) => {
|
const updateResizeMode = (newMode: ResizeMode) => {
|
||||||
setResizeMode(newMode);
|
setResizeMode(newMode);
|
||||||
|
void Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
|
||||||
};
|
};
|
||||||
|
|
||||||
const pinchGesture = Gesture.Pinch().onUpdate((e) => {
|
const pinchGesture = Gesture.Pinch().onUpdate((e) => {
|
||||||
|
Reference in New Issue
Block a user