Auto dark/bright takes a light sensor where the device allows one
lib/theme/light.dart: dark at 15 lux or less, bright from 60, held 5 s; Settings shows the reading. The Redmi Pad SE refuses apps its only light sensor (Xiaomi's, from the front camera), so there Auto keeps following Android's dark theme. DASH-NEXT.md records the other lux sources. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+11
-3
@@ -7,6 +7,7 @@ import '../actions/server_url.dart';
|
||||
import '../link/boundary.dart';
|
||||
import '../link/net.dart';
|
||||
import '../shell_scope.dart';
|
||||
import '../theme/light.dart';
|
||||
import '../theme/palette.dart';
|
||||
|
||||
class SettingsPage extends StatelessWidget {
|
||||
@@ -55,9 +56,16 @@ class SettingsPage extends StatelessWidget {
|
||||
ListTile(
|
||||
leading: Icon(themes.isDark ? Icons.dark_mode : Icons.light_mode),
|
||||
title: const Text('Dark or bright'),
|
||||
subtitle: const Text(
|
||||
"Auto follows Android's dark theme and its schedule. "
|
||||
"The Dash's button holds one; a long press there is auto again.",
|
||||
subtitle: ValueListenableBuilder(
|
||||
valueListenable: themes.lux,
|
||||
builder: (context, lux, _) => Text(
|
||||
lux == null
|
||||
? "Auto follows Android's dark theme and its schedule (no light sensor). "
|
||||
'The status bar button holds one; a long press there is auto again.'
|
||||
: 'Auto follows the light sensor: dark at ${LightSwitch.darkAt.round()} lux or less, '
|
||||
'bright from ${LightSwitch.brightAt.round()}; now ${lux.toStringAsFixed(lux < 10 ? 1 : 0)} lux. '
|
||||
'The status bar button holds one; a long press there is auto again.',
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
|
||||
Reference in New Issue
Block a user