From 5a25ecc8f52dbd043cd3cefe7d67aa8ec3cae581 Mon Sep 17 00:00:00 2001 From: JuBaas Date: Thu, 30 May 2024 10:09:23 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20add=20avoid=20brightness=20override?= =?UTF-8?q?=20test=20example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/avoid-brightness-override.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/avoid-brightness-override.js diff --git a/src/avoid-brightness-override.js b/src/avoid-brightness-override.js new file mode 100644 index 0000000..8de356b --- /dev/null +++ b/src/avoid-brightness-override.js @@ -0,0 +1,29 @@ +import React, { useEffect } from 'react'; +import { StyleSheet, View, Text } from 'react-native'; +import * as Brightness from 'expo-brightness'; + +export default function App() { + useEffect(() => { + (async () => { + const { status } = await Brightness.requestPermissionsAsync(); + if (status === 'granted') { + Brightness.setSystemBrightnessAsync(1); + } + })(); + }, []); + + return ( + + Brightness Module Example + + ); +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + backgroundColor: '#fff', + alignItems: 'center', + justifyContent: 'center', + }, + }); \ No newline at end of file