mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 18:13:25 +00:00
refactor: default gesture controls to off on android bc android is funny
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { useCallback, useState } from "react";
|
||||
import { useSharedValue } from "react-native-reanimated";
|
||||
import * as Brightness from "expo-brightness";
|
||||
|
||||
@@ -7,22 +7,6 @@ export const useBrightness = () => {
|
||||
|
||||
const brightness = useSharedValue(0.5);
|
||||
|
||||
useEffect(() => {
|
||||
async function init() {
|
||||
try {
|
||||
const { status } = await Brightness.requestPermissionsAsync();
|
||||
if (status === Brightness.PermissionStatus.GRANTED) {
|
||||
const currentBrightness = await Brightness.getBrightnessAsync();
|
||||
brightness.value = currentBrightness;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to get brightness permissions:", error);
|
||||
}
|
||||
}
|
||||
|
||||
void init();
|
||||
}, [brightness]);
|
||||
|
||||
const handleBrightnessChange = useCallback(async (newValue: number) => {
|
||||
try {
|
||||
await Brightness.setBrightnessAsync(newValue);
|
||||
|
Reference in New Issue
Block a user