How to use expo-brightness - 10 common examples

To help you get started, we’ve selected a few expo-brightness examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github janaagaard75 / expo-and-typescript / src / BrightnessScreen.tsx View on Github external
return async () => {
      await Brightness.setBrightnessAsync(value);
      this.updateBrightness();
    };
  }
github byCedric / use-expo / packages / brightness / src / use-brightness.ts View on Github external
function setBrightness(brightness: number) {
		return setBrightnessAsync(brightness).then(() => setData(brightness));
	}
github dodie / tracing-paper-sketching / App.js View on Github external
_brightness = async () => {
    if (!this.state.brightness) {
      await Brightness.setBrightnessAsync(1);
    } else {
      await Brightness.useSystemBrightnessAsync();
    }
    this.state.brightness ? this.setState({ brightness: false }) : this.setState({ brightness: true });
  }
github janaagaard75 / expo-and-typescript / src / BrightnessScreen.tsx View on Github external
return async () => {
      await Brightness.setSystemBrightnessAsync(value);
      this.updateBrightness();
    };
  }
github expo / expo / docs / static / examples / unversioned / brightness.js View on Github external
(async () => {
      const { status } = await Brightness.requestPermissionsAsync();
      if (status === 'granted') {
        Brightness.setSystemBrightnessAsync(1);
      }
    })();
  }, []);
github janaagaard75 / expo-and-typescript / src / BrightnessScreen.tsx View on Github external
private async updateBrightness() {
    this.setState({
      normalBrightness: await Brightness.getBrightnessAsync(),
      systemBrightness: await Brightness.getSystemBrightnessAsync()
    });
  }
}
github byCedric / use-expo / packages / brightness / src / use-brightness.ts View on Github external
function getBrightness() {
		return getBrightnessAsync().then(setData);
	}
github byCedric / use-expo / example / src / molecules / brightness / use-system-brightness-mode.tsx View on Github external
This example uses both the Permissions and Brightness modules.
				When you grant the SYSTEM_BRIGHTNESS permission, it renders two buttons to switch the system brightness mode.
			
			
				{(permission && permission.status !== 'granted') && (
					
						We need permission to modify the system brightness.
					
				)}
				{(permission && permission.status === 'granted') && (
					<>
						
							<button mode="{mode" color="#333"> setMode(BrightnessMode.AUTOMATIC)}
							&gt;
								Automatic
							</button>
						
						
							<button mode="{mode" color="#333"> setMode(BrightnessMode.MANUAL)}
							&gt;
								Manual
							</button>
						
					
				)}