brightness.system
Whether the system controls brightness: the app hasn't set a level, or restored the system's.
Utilização
Restore the user's brightness when leaving a temporary bright mode.
// Restore the user's brightness when leaving a temporary bright mode.
import { Button, Text, VStack, brightness, onCleanup } from 'kuito';
export function ReadingMode() {
onCleanup(() => void brightness.restore());
return (
<VStack>
<Text>{`System brightness: ${brightness.system.value}`}</Text>
<Button onPress={() => (brightness.level.value = 0.8)}>Bright mode</Button>
<Button onPress={() => void brightness.restore()}>Use system brightness</Button>
</VStack>
);
}Propriedades e métodos 1
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
valuesó de leitura | boolean | Sim | — |
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.