refactor: default gesture controls to off on android bc android is funny

This commit is contained in:
Adrian Castro
2024-03-25 18:48:49 +01:00
parent 784628952a
commit cd0b302602
3 changed files with 17 additions and 20 deletions

View File

@@ -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);