Skip to content

A cross platform Audiobookshelf client for Android and iOS

Dart

Add an e-ink mode that flattens the look and saves battery on e-paper devices

Barnabasb4e83e7d78ad
diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb
index d818359b..f436d3cd 100644
--- a/lib/l10n/app_en.arb
+++ b/lib/l10n/app_en.arb
@@ -630,6 +630,10 @@
"useColorEverywhereSubtitle": "Also color book detail pages and the player card with your set color instead of each book's cover",
"flatBackgroundLabel": "Flat background",
"flatBackgroundSubtitle": "Remove the background gradient. Pure black in dark mode for OLED screens.",
+ "einkModeLabel": "E-ink mode",
+ "einkModeSubtitle": "High-contrast black and white with no animations, made for e-ink screens",
+ "einkModeIntroBody": "Made for e-ink screens. The app switches to a flat black-and-white look with high contrast, animations are turned off, the playing card loses its background, and the live server connection stays off to save battery. Playback and progress still sync normally. Your appearance settings are kept and come back when you turn this off.",
+ "einkModeIntroConfirm": "Turn on",
"backgroundIntensityLabel": "Background intensity",
"startScreenLabel": "Start screen",
"startScreenSubtitle": "Which tab to open when the app launches",
diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart
index 044bc20e..9dfa1cbd 100644
--- a/lib/l10n/app_localizations.dart
+++ b/lib/l10n/app_localizations.dart
@@ -2410,6 +2410,30 @@ abstract class AppLocalizations {
/// **'Remove the background gradient. Pure black in dark mode for OLED screens.'**
String get flatBackgroundSubtitle;
+ /// No description provided for @einkModeLabel.
+ ///
+ /// In en, this message translates to:
+ /// **'E-ink mode'**
+ String get einkModeLabel;
+
+ /// No description provided for @einkModeSubtitle.
+ ///
+ /// In en, this message translates to:
+ /// **'High-contrast black and white with no animations, made for e-ink screens'**
+ String get einkModeSubtitle;
+
+ /// No description provided for @einkModeIntroBody.
+ ///
+ /// In en, this message translates to:
+ /// **'Made for e-ink screens. The app switches to a flat black-and-white look with high contrast, animations are turned off, the playing card loses its background, and the live server connection stays off to save battery. Playback and progress still sync normally. Your appearance settings are kept and come back when you turn this off.'**
+ String get einkModeIntroBody;
+
+ /// No description provided for @einkModeIntroConfirm.
+ ///
+ /// In en, this message translates to:
+ /// **'Turn on'**
+ String get einkModeIntroConfirm;
+
/// No description provided for @backgroundIntensityLabel.
///
/// In en, this message translates to:
diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart
index 284a46df..5dc53a9b 100644
--- a/lib/l10n/app_localizations_de.dart
+++ b/lib/l10n/app_localizations_de.dart
@@ -1276,6 +1276,20 @@ class AppLocalizationsDe extends AppLocalizations {
String get flatBackgroundSubtitle =>
'Hintergrundverlauf entfernen. Schwarz im Dunkelmodus für OLED-Bildschirme.';
+ @override
+ String get einkModeLabel => 'E-ink mode';
+
+ @override
+ String get einkModeSubtitle =>
+ 'High-contrast black and white with no animations, made for e-ink screens';
+
+ @override
+ String get einkModeIntroBody =>
+ 'Made for e-ink screens. The app switches to a flat black-and-white look with high contrast, animations are turned off, the playing card loses its background, and the live server connection stays off to save battery. Playback and progress still sync normally. Your appearance settings are kept and come back when you turn this off.';
+
+ @override
+ String get einkModeIntroConfirm => 'Turn on';
+
@override
String get backgroundIntensityLabel => 'Hintergrundintensität';
diff --git a/lib/l10n/app_localizations_el.dart b/lib/l10n/app_localizations_el.dart
index ba1468cc..182dcd2a 100644
--- a/lib/l10n/app_localizations_el.dart
+++ b/lib/l10n/app_localizations_el.dart
@@ -1268,6 +1268,20 @@ class AppLocalizationsEl extends AppLocalizations {
String get flatBackgroundSubtitle =>
'Remove the background gradient. Pure black in dark mode for OLED screens.';
+ @override
+ String get einkModeLabel => 'E-ink mode';
+
+ @override
+ String get einkModeSubtitle =>
+ 'High-contrast black and white with no animations, made for e-ink screens';
+
+ @override
+ String get einkModeIntroBody =>
+ 'Made for e-ink screens. The app switches to a flat black-and-white look with high contrast, animations are turned off, the playing card loses its background, and the live server connection stays off to save battery. Playback and progress still sync normally. Your appearance settings are kept and come back when you turn this off.';
+
+ @override
+ String get einkModeIntroConfirm => 'Turn on';
+
@override
String get backgroundIntensityLabel => 'Background intensity';
diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart
index eed6ccc9..0580fe4c 100644
--- a/lib/l10n/app_localizations_en.dart
+++ b/lib/l10n/app_localizations_en.dart
@@ -1268,6 +1268,20 @@ class AppLocalizationsEn extends AppLocalizations {
String get flatBackgroundSubtitle =>
'Remove the background gradient. Pure black in dark mode for OLED screens.';
+ @override
+ String get einkModeLabel => 'E-ink mode';
+
+ @override
+ String get einkModeSubtitle =>
+ 'High-contrast black and white with no animations, made for e-ink screens';
+
+ @override
+ String get einkModeIntroBody =>
+ 'Made for e-ink screens. The app switches to a flat black-and-white look with high contrast, animations are turned off, the playing card loses its background, and the live server connection stays off to save battery. Playback and progress still sync normally. Your appearance settings are kept and come back when you turn this off.';
+
+ @override
+ String get einkModeIntroConfirm => 'Turn on';
+
@override
String get backgroundIntensityLabel => 'Background intensity';
diff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dart
index 690171ea..3cc89984 100644
--- a/lib/l10n/app_localizations_es.dart
+++ b/lib/l10n/app_localizations_es.dart
@@ -1270,6 +1270,20 @@ class AppLocalizationsEs extends AppLocalizations {
String get flatBackgroundSubtitle =>
'Remove the background gradient. Pure black in dark mode for OLED screens.';
+ @override
+ String get einkModeLabel => 'E-ink mode';
+
+ @override
+ String get einkModeSubtitle =>
+ 'High-contrast black and white with no animations, made for e-ink screens';
+
+ @override
+ String get einkModeIntroBody =>
+ 'Made for e-ink screens. The app switches to a flat black-and-white look with high contrast, animations are turned off, the playing card loses its background, and the live server connection stays off to save battery. Playback and progress still sync normally. Your appearance settings are kept and come back when you turn this off.';
+
+ @override
+ String get einkModeIntroConfirm => 'Turn on';
+
@override
String get backgroundIntensityLabel => 'Background intensity';
diff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dart
index 59ac16d7..6dcd357f 100644
--- a/lib/l10n/app_localizations_fr.dart
+++ b/lib/l10n/app_localizations_fr.dart
@@ -1278,6 +1278,20 @@ class AppLocalizationsFr extends AppLocalizations {
String get flatBackgroundSubtitle =>
'Supprime le dégradé d’arrière‑plan. Noir pur en mode sombre pour les écrans OLED.';
+ @override
+ String get einkModeLabel => 'E-ink mode';
+
+ @override
+ String get einkModeSubtitle =>
+ 'High-contrast black and white with no animations, made for e-ink screens';
+
+ @override
+ String get einkModeIntroBody =>
+ 'Made for e-ink screens. The app switches to a flat black-and-white look with high contrast, animations are turned off, the playing card loses its background, and the live server connection stays off to save battery. Playback and progress still sync normally. Your appearance settings are kept and come back when you turn this off.';
+
+ @override
+ String get einkModeIntroConfirm => 'Turn on';
+
@override
String get backgroundIntensityLabel => 'Intensité de l\'arrière-plan';
diff --git a/lib/l10n/app_localizations_it.dart b/lib/l10n/app_localizations_it.dart
index a9a77899..04a6272f 100644
--- a/lib/l10n/app_localizations_it.dart
+++ b/lib/l10n/app_localizations_it.dart
@@ -1268,6 +1268,20 @@ class AppLocalizationsIt extends AppLocalizations {
String get flatBackgroundSubtitle =>
'Remove the background gradient. Pure black in dark mode for OLED screens.';
+ @override
+ String get einkModeLabel => 'E-ink mode';
+
+ @override
+ String get einkModeSubtitle =>
+ 'High-contrast black and white with no animations, made for e-ink screens';
+
+ @override
+ String get einkModeIntroBody =>
+ 'Made for e-ink screens. The app switches to a flat black-and-white look with high contrast, animations are turned off, the playing card loses its background, and the live server connection stays off to save battery. Playback and progress still sync normally. Your appearance settings are kept and come back when you turn this off.';
+
+ @override
+ String get einkModeIntroConfirm => 'Turn on';
+
@override
String get backgroundIntensityLabel => 'Background intensity';
diff --git a/lib/l10n/app_localizations_ja.dart b/lib/l10n/app_localizations_ja.dart
index 4ce2288a..45807221 100644
--- a/lib/l10n/app_localizations_ja.dart
+++ b/lib/l10n/app_localizations_ja.dart
@@ -1268,6 +1268,20 @@ class AppLocalizationsJa extends AppLocalizations {
String get flatBackgroundSubtitle =>
'Remove the background gradient. Pure black in dark mode for OLED screens.';
+ @override
+ String get einkModeLabel => 'E-ink mode';
+
+ @override
+ String get einkModeSubtitle =>
+ 'High-contrast black and white with no animations, made for e-ink screens';
+
+ @override
+ String get einkModeIntroBody =>
+ 'Made for e-ink screens. The app switches to a flat black-and-white look with high contrast, animations are turned off, the playing card loses its background, and the live server connection stays off to save battery. Playback and progress still sync normally. Your appearance settings are kept and come back when you turn this off.';
+
+ @override
+ String get einkModeIntroConfirm => 'Turn on';
+
@override
String get backgroundIntensityLabel => 'Background intensity';
diff --git a/lib/l10n/app_localizations_no.dart b/lib/l10n/app_localizations_no.dart
index d586c204..e8a4513f 100644
--- a/lib/l10n/app_localizations_no.dart
+++ b/lib/l10n/app_localizations_no.dart
@@ -1268,6 +1268,20 @@ class AppLocalizationsNo extends AppLocalizations {
String get flatBackgroundSubtitle =>
'Remove the background gradient. Pure black in dark mode for OLED screens.';
+ @override
+ String get einkModeLabel => 'E-ink mode';
+
+ @override
+ String get einkModeSubtitle =>
+ 'High-contrast black and white with no animations, made for e-ink screens';
+
+ @override
+ String get einkModeIntroBody =>
+ 'Made for e-ink screens. The app switches to a flat black-and-white look with high contrast, animations are turned off, the playing card loses its background, and the live server connection stays off to save battery. Playback and progress still sync normally. Your appearance settings are kept and come back when you turn this off.';
+
+ @override
+ String get einkModeIntroConfirm => 'Turn on';
+
@override
String get backgroundIntensityLabel => 'Background intensity';
diff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dart
index de3d99dc..a2822c12 100644
--- a/lib/l10n/app_localizations_pt.dart
+++ b/lib/l10n/app_localizations_pt.dart
@@ -1268,6 +1268,20 @@ class AppLocalizationsPt extends AppLocalizations {
String get flatBackgroundSubtitle =>
'Remove the background gradient. Pure black in dark mode for OLED screens.';
+ @override
+ String get einkModeLabel => 'E-ink mode';
+
+ @override
+ String get einkModeSubtitle =>
+ 'High-contrast black and white with no animations, made for e-ink screens';
+
+ @override
+ String get einkModeIntroBody =>
+ 'Made for e-ink screens. The app switches to a flat black-and-white look with high contrast, animations are turned off, the playing card loses its background, and the live server connection stays off to save battery. Playback and progress still sync normally. Your appearance settings are kept and come back when you turn this off.';
+
+ @override
+ String get einkModeIntroConfirm => 'Turn on';
+
@override
String get backgroundIntensityLabel => 'Background intensity';
diff --git a/lib/l10n/app_localizations_ro.dart b/lib/l10n/app_localizations_ro.dart
index 18b14482..d893ee9a 100644
--- a/lib/l10n/app_localizations_ro.dart
+++ b/lib/l10n/app_localizations_ro.dart
@@ -1268,6 +1268,20 @@ class AppLocalizationsRo extends AppLocalizations {
String get flatBackgroundSubtitle =>
'Remove the background gradient. Pure black in dark mode for OLED screens.';
+ @override
+ String get einkModeLabel => 'E-ink mode';
+
+ @override
+ String get einkModeSubtitle =>
+ 'High-contrast black and white with no animations, made for e-ink screens';
+
+ @override
+ String get einkModeIntroBody =>
+ 'Made for e-ink screens. The app switches to a flat black-and-white look with high contrast, animations are turned off, the playing card loses its background, and the live server connection stays off to save battery. Playback and progress still sync normally. Your appearance settings are kept and come back when you turn this off.';
+
+ @override
+ String get einkModeIntroConfirm => 'Turn on';
+
@override
String get backgroundIntensityLabel => 'Background intensity';
diff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dart
index b818b327..64f8a047 100644
--- a/lib/l10n/app_localizations_ru.dart
+++ b/lib/l10n/app_localizations_ru.dart
@@ -1268,6 +1268,20 @@ class AppLocalizationsRu extends AppLocalizations {
String get flatBackgroundSubtitle =>
'Remove the background gradient. Pure black in dark mode for OLED screens.';
+ @override
+ String get einkModeLabel => 'E-ink mode';
+
+ @override
+ String get einkModeSubtitle =>
+ 'High-contrast black and white with no animations, made for e-ink screens';
+
+ @override
+ String get einkModeIntroBody =>
+ 'Made for e-ink screens. The app switches to a flat black-and-white look with high contrast, animations are turned off, the playing card loses its background, and the live server connection stays off to save battery. Playback and progress still sync normally. Your appearance settings are kept and come back when you turn this off.';
+
+ @override
+ String get einkModeIntroConfirm => 'Turn on';
+
@override
String get backgroundIntensityLabel => 'Background intensity';
diff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dart
index 3027223d..3ebc505a 100644
--- a/lib/l10n/app_localizations_zh.dart
+++ b/lib/l10n/app_localizations_zh.dart
@@ -1254,6 +1254,20 @@ class AppLocalizationsZh extends AppLocalizations {
String get flatBackgroundSubtitle =>
'Remove the background gradient. Pure black in dark mode for OLED screens.';
+ @override
+ String get einkModeLabel => 'E-ink mode';
+
+ @override
+ String get einkModeSubtitle =>
+ 'High-contrast black and white with no animations, made for e-ink screens';
+
+ @override
+ String get einkModeIntroBody =>
+ 'Made for e-ink screens. The app switches to a flat black-and-white look with high contrast, animations are turned off, the playing card loses its background, and the live server connection stays off to save battery. Playback and progress still sync normally. Your appearance settings are kept and come back when you turn this off.';
+
+ @override
+ String get einkModeIntroConfirm => 'Turn on';
+
@override
String get backgroundIntensityLabel => 'Background intensity';
diff --git a/lib/main.dart b/lib/main.dart
index 618b07e4..9ab3ccb3 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -80,6 +80,22 @@ ColorScheme manualColorScheme(Color seed, Brightness brightness) {
: Colors.black;
return base.copyWith(primary: seed, onPrimary: onSeed);
}
+/// Route transition that just shows the page - e-ink panels smear animations
+/// into a mess of ghosting, so pages should simply appear.
+class _InstantPageTransitionsBuilder extends PageTransitionsBuilder {
+ const _InstantPageTransitionsBuilder();
+
+ @override
+ Widget buildTransitions<T>(
+ PageRoute<T> route,
+ BuildContext context,
+ Animation<double> animation,
+ Animation<double> secondaryAnimation,
+ Widget child,
+ ) =>
+ child;
+}
+
/// Whether to disable the fade animation when switching bottom nav tabs.
final ValueNotifier<bool> snappyTransitionsNotifier = ValueNotifier(false);
@@ -144,6 +160,16 @@ void applyManualSeed(int argb) => manualSeedNotifier.value = Color(argb);
void applyGradientIntensity(double value) => gradientIntensityNotifier.value = value;
void applyUseColorEverywhere(bool value) => useColorEverywhereNotifier.value = value;
+/// E-ink mode overrides the theme (light, flat, monochrome, no animations)
+/// without touching the user's saved appearance settings. The notifier drives
+/// the theme rebuild; PlayerSettings.einkMode is the cheap check for
+/// non-widget code (socket gating, card backgrounds).
+final ValueNotifier<bool> einkModeNotifier = ValueNotifier(false);
+void applyEinkModeTheme(bool value) {
+ PlayerSettings.einkMode = value;
+ einkModeNotifier.value = value;
+}
+
/// Push every appearance setting from storage into the notifiers that drive
/// the theme. The individual appliers above are called by the settings screen
/// as the user changes each one; this is for when the whole store is replaced
@@ -152,6 +178,7 @@ void applyUseColorEverywhere(bool value) => useColorEverywhereNotifier.value = v
Future<void> applyAppearanceFromPrefs() async {
applyThemeMode(await PlayerSettings.getThemeMode());
applyFlatBackground(await PlayerSettings.getFlatBackground());
+ applyEinkModeTheme(await PlayerSettings.getEinkMode());
applyColorSource(await PlayerSettings.getColorSource());
applyManualSeed(await PlayerSettings.getManualSeedColor());
applyGradientIntensity(await PlayerSettings.getGradientIntensity());
@@ -202,6 +229,7 @@ void main() async {
}
applyThemeMode(savedTheme);
flatNotifier.value = await PlayerSettings.getFlatBackground();
+ applyEinkModeTheme(await PlayerSettings.getEinkMode());
colorSourceNotifier.value = await PlayerSettings.getColorSource();
manualSeedNotifier.value = Color(await PlayerSettings.getManualSeedColor());
gradientIntensityNotifier.value = await PlayerSettings.getGradientIntensity();
@@ -281,10 +309,12 @@ class AbsorbApp extends StatelessWidget {
manualSeedNotifier,
gradientIntensityNotifier,
useColorEverywhereNotifier,
+ einkModeNotifier,
]),
builder: (context, _) {
- final currentMode = themeNotifier.value;
- final isFlat = flatNotifier.value;
+ final isEink = einkModeNotifier.value;
+ final currentMode = isEink ? ThemeMode.light : themeNotifier.value;
+ final isFlat = flatNotifier.value || isEink;
final overrideLocale = localeNotifier.value;
// Japanese shares many codepoints with Chinese (Han unification) but
// draws some kanji differently. Flutter on Android doesn't hint the
@@ -365,12 +395,50 @@ class AbsorbApp extends StatelessWidget {
surfaceContainerHighest: isFlat ? const Color(0xFFEDEDED) : const Color(0xFFE0E0E0),
);
- const pageTransition = PageTransitionsTheme(
- builders: {
- TargetPlatform.android: CupertinoPageTransitionsBuilder(),
- TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
- },
- );
+ // E-ink panels dither mid greys into visible noise, so the light
+ // scheme goes monochrome high-contrast: black ink on white paper, and
+ // the color accents (which would render as grey anyway) become black.
+ if (isEink) {
+ lightScheme = lightScheme.copyWith(
+ primary: Colors.black,
+ onPrimary: Colors.white,
+ primaryContainer: Colors.white,
+ onPrimaryContainer: Colors.black,
+ secondary: Colors.black,
+ onSecondary: Colors.white,
+ // Selected chips/segments paint secondaryContainer - near-white
+ // reads as "nothing selected" on e-ink, so selection goes solid
+ // black with white text.
+ secondaryContainer: Colors.black,
+ onSecondaryContainer: Colors.white,
+ tertiary: Colors.black,
+ onTertiary: Colors.white,
+ tertiaryContainer: const Color(0xFFEFEFEF),
+ onTertiaryContainer: Colors.black,
+ onSurface: Colors.black,
+ onSurfaceVariant: Colors.black,
+ outline: Colors.black,
+ outlineVariant: Colors.black54,
+ surfaceTint: Colors.transparent,
+ inverseSurface: Colors.black,
+ onInverseSurface: Colors.white,
+ inversePrimary: Colors.white,
+ );
+ }
+
+ final pageTransition = isEink
+ ? const PageTransitionsTheme(
+ builders: {
+ TargetPlatform.android: _InstantPageTransitionsBuilder(),
+ TargetPlatform.iOS: _InstantPageTransitionsBuilder(),
+ },
+ )
+ : const PageTransitionsTheme(
+ builders: {
+ TargetPlatform.android: CupertinoPageTransitionsBuilder(),
+ TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
+ },
+ );
return MaterialApp(
navigatorKey: rootNavigatorKey,
@@ -395,16 +463,37 @@ class AbsorbApp extends StatelessWidget {
colorScheme: lightScheme,
fontFamilyFallback: cjkFallback,
scaffoldBackgroundColor: lightScheme.surface,
+ // Ink ripples ghost on e-ink, so touch feedback goes silent.
+ splashFactory: isEink ? NoSplash.splashFactory : null,
+ highlightColor: isEink ? Colors.transparent : null,
cardTheme: CardThemeData(
color: lightScheme.surfaceContainerHigh,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
+ // Near-white surfaces blend together on e-ink; a hairline
+ // keeps cards readable as cards.
+ side: isEink
+ ? const BorderSide(color: Colors.black38)
+ : BorderSide.none,
),
),
navigationBarTheme: NavigationBarThemeData(
backgroundColor: lightScheme.surface,
- indicatorColor: lightScheme.primary.withValues(alpha: 0.15),
+ // E-ink: a solid black pill with a white icon beats a 15%
+ // tint that dithers away.
+ indicatorColor: isEink
+ ? Colors.black
+ : lightScheme.primary.withValues(alpha: 0.15),
+ iconTheme: isEink
+ ? WidgetStateProperty.resolveWith(
+ (states) => IconThemeData(
+ color: states.contains(WidgetState.selected)
+ ? Colors.white
+ : Colors.black,
+ ),
+ )
+ : null,
labelTextStyle: WidgetStatePropertyAll(
TextStyle(
fontSize: 11,
@@ -619,6 +708,7 @@ class _AuthGateState extends State<AuthGate> {
}
applyThemeMode(scopedTheme);
flatNotifier.value = await PlayerSettings.getFlatBackground();
+ applyEinkModeTheme(await PlayerSettings.getEinkMode());
colorSourceNotifier.value = await PlayerSettings.getColorSource();
manualSeedNotifier.value = Color(await PlayerSettings.getManualSeedColor());
gradientIntensityNotifier.value = await PlayerSettings.getGradientIntensity();
diff --git a/lib/providers/_lp_core.dart b/lib/providers/_lp_core.dart
index 3017f923..c0c6808b 100644
--- a/lib/providers/_lp_core.dart
+++ b/lib/providers/_lp_core.dart
@@ -1112,7 +1112,7 @@ mixin _CoreMixin on ChangeNotifier, _StateMixin {
void _startServerPingTimer() {
_serverPingTimer?.cancel();
- if (_isBackgrounded || _readerQuiet) return;
+ if (_isBackgrounded || _readerQuiet || PlayerSettings.einkMode) return;
final serverUrl = _auth?.serverUrl;
if (serverUrl == null) return;
debugPrint('[Library] Starting server ping timer');
@@ -1252,7 +1252,7 @@ mixin _CoreMixin on ChangeNotifier, _StateMixin {
void _startHealthCheckTimer() {
_healthCheckTimer?.cancel();
- if (_isBackgrounded || _readerQuiet) return;
+ if (_isBackgrounded || _readerQuiet || PlayerSettings.einkMode) return;
debugPrint('[Library] Health check timer started (60s ping while online)');
_healthCheckTimer = Timer.periodic(const Duration(seconds: 60), (_) async {
if (_networkOffline || _manualOffline || !_deviceHasConnectivity) return;
@@ -1332,6 +1332,24 @@ mixin _CoreMixin on ChangeNotifier, _StateMixin {
_resumeLiveWork(quietSince: since);
}
+ /// E-ink mode holds the app in its quiet state permanently: no socket, no
+ /// foreground polling, battery first. Progress still syncs over plain HTTP.
+ /// Called when the settings toggle flips; startup needs no call because the
+ /// socket and timer entry points all check PlayerSettings.einkMode.
+ void applyEinkMode(bool on) {
+ if (on) {
+ debugPrint('[Library] E-ink mode on - quieting live work');
+ _stopServerPingTimer();
+ _stopHealthCheckTimer();
+ if (!AudioPlayerService().isPlaying) _stopLocalProbeTimer();
+ _softDisconnectSocket();
+ return;
+ }
+ if (_isBackgrounded || _readerQuiet) return;
+ debugPrint('[Library] E-ink mode off - waking live work');
+ _resumeLiveWork();
+ }
+
/// Bring back the socket and the polling this app does while it's visible
/// and awake. [quietSince] is when live work stopped, so a long gap can
/// replay what the socket would have delivered.
@@ -1410,7 +1428,7 @@ mixin _CoreMixin on ChangeNotifier, _StateMixin {
}
void _softReconnectSocket() {
- if (_manualOffline) return;
+ if (_manualOffline || PlayerSettings.einkMode) return;
if (!_socketSoftDisconnected && !SocketService().hasSocket) {
_socketSoftDisconnected = true;
}
diff --git a/lib/screens/app_shell.dart b/lib/screens/app_shell.dart
index 18519a3b..634a1914 100644
--- a/lib/screens/app_shell.dart
+++ b/lib/screens/app_shell.dart
@@ -15,7 +15,7 @@ import 'package:cached_network_image/cached_network_image.dart';
import 'package:palette_generator/palette_generator.dart';
import '../utils/cover_accent.dart';
import '../main.dart'
- show snappyTransitionsNotifier, coverSchemeNotifier, rootNavigatorKey, applyOrientationLock;
+ show snappyTransitionsNotifier, einkModeNotifier, coverSchemeNotifier, rootNavigatorKey, applyOrientationLock;
import '../l10n/app_localizations.dart';
import '../services/wording.dart';
import '../services/android_auto_service.dart';
@@ -217,7 +217,7 @@ class _AppShellState extends State<AppShell>
}
_ensurePageBuilt(index);
_syncNavBarListener(index);
- if (snappyTransitionsNotifier.value) {
+ if (snappyTransitionsNotifier.value || einkModeNotifier.value) {
setState(() => _currentIndex = index);
} else {
_fadeController.reverse().then((_) {
diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart
index d021b289..e0bbe146 100644
--- a/lib/screens/settings_screen.dart
+++ b/lib/screens/settings_screen.dart
@@ -31,7 +31,7 @@ import '../services/settings_sync_service.dart';
import '../screens/change_password_screen.dart';
import '../screens/auth_sessions_screen.dart';
import '../screens/transcription_settings_screen.dart';
-import '../main.dart' show applyThemeMode, applyTrustAllCerts, applyFlatBackground, applyColorSource, applyManualSeed, applyGradientIntensity, applyUseColorEverywhere, applyOrientationLock, localeNotifier, flatNotifier, gradientIntensityNotifier, snappyTransitionsNotifier;
+import '../main.dart' show applyThemeMode, applyTrustAllCerts, applyFlatBackground, applyColorSource, applyManualSeed, applyGradientIntensity, applyUseColorEverywhere, applyEinkModeTheme, applyOrientationLock, localeNotifier, flatNotifier, gradientIntensityNotifier, snappyTransitionsNotifier;
import '../services/wording.dart';
import '../widgets/absorb_page_header.dart';
import '../widgets/theme_presets.dart';
@@ -154,6 +154,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
double _progressTextScale = 1.0;
String _themeMode = 'dark';
bool _flatBackground = false;
+ bool _einkMode = false;
String _colorSource = 'dynamic';
int _manualSeed = 0xFF7C6FBF;
double _gradientIntensity = 0.06;
@@ -839,6 +840,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
final mp3IndexSeek = await PlayerSettings.getMp3IndexSeeking();
final coverSize = await PlayerSettings.getCoverSize();
final flatBackground = await PlayerSettings.getFlatBackground();
+ final einkMode = await PlayerSettings.getEinkMode();
final colorSource = await PlayerSettings.getColorSource();
final manualSeed = await PlayerSettings.getManualSeedColor();
final gradientIntensity = await PlayerSettings.getGradientIntensity();
@@ -959,6 +961,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
_mp3IndexSeeking = mp3IndexSeek;
_themeMode = theme == 'oled' ? 'dark' : theme;
_flatBackground = flatBackground;
+ _einkMode = einkMode;
_colorSource = colorSource == 'manual' ? 'manual' : 'dynamic';
_manualSeed = manualSeed;
_gradientIntensity = gradientIntensity;
@@ -1596,6 +1599,40 @@ class _SettingsScreenState extends State<SettingsScreen> {
applyFlatBackground(v);
} : null,
),
+ SwitchListTile.adaptive(
+ contentPadding: EdgeInsets.zero,
+ title: Text(l.einkModeLabel, style: tt.bodyLarge),
+ subtitle: Text(l.einkModeSubtitle, style: tt.bodySmall?.copyWith(color: cs.onSurfaceVariant)),
+ value: _einkMode,
+ onChanged: _loaded ? (v) async {
+ if (v) {
+ final ok = await showDialog<bool>(
+ context: context,
+ builder: (ctx) => AlertDialog(
+ title: Text(l.einkModeLabel),
+ content: Text(l.einkModeIntroBody),
+ actions: [
+ TextButton(
+ onPressed: () => Navigator.pop(ctx, false),
+ child: Text(l.cancel),
+ ),
+ FilledButton(
+ onPressed: () => Navigator.pop(ctx, true),
+ child: Text(l.einkModeIntroConfirm),
+ ),
+ ],
+ ),
+ );
+ if (ok != true || !mounted) return;
+ }
+ setState(() => _einkMode = v);
+ PlayerSettings.setEinkMode(v);
+ applyEinkModeTheme(v);
+ if (mounted) {
+ context.read<LibraryProvider>().applyEinkMode(v);
+ }
+ } : null,
+ ),
if (!_flatBackground) ...[
const SizedBox(height: 4),
Text(l.backgroundIntensityLabel, style: tt.bodyMedium),
diff --git a/lib/services/backup_service.dart b/lib/services/backup_service.dart
index 454d6af8..e0468f46 100644
--- a/lib/services/backup_service.dart
+++ b/lib/services/backup_service.dart
@@ -114,7 +114,7 @@ class BackupService {
'queueCollectionName': await PlayerSettings.getQueueCollectionName(),
'coverSeedColor': await PlayerSettings.getCoverSeedColor(),
'speedPresets': await PlayerSettings.getSpeedPresets(),
- 'cardBackground': await PlayerSettings.getCardBackground(),
+ 'cardBackground': await PlayerSettings.getCardBackgroundRaw(),
'lockSeekBar': await PlayerSettings.getLockSeekBar(),
'mediaControlsSpeedBookmark': await PlayerSettings.getMediaControlsSpeedBookmark(),
'progressTextScale': await PlayerSettings.getProgressTextScale(),
diff --git a/lib/services/player_settings.dart b/lib/services/player_settings.dart
index 4f6ddc48..f44e84a9 100644
--- a/lib/services/player_settings.dart
+++ b/lib/services/player_settings.dart
@@ -1025,7 +1025,13 @@ class PlayerSettings {
/// Absorbing-card background style: 'blurred' (cover blur, default), 'gradient'
/// (gradient from the extracted cover colors), or 'off' (plain theme surface).
- static Future<String> getCardBackground() => _get('cardBackground', 'blurred');
+ static Future<String> getCardBackground() async =>
+ einkMode ? 'off' : await getCardBackgroundRaw();
+
+ /// The stored value, for backup/sync export - the plain getter reports
+ /// 'off' while e-ink mode is on, which must not leak into synced settings.
+ static Future<String> getCardBackgroundRaw() =>
+ _get('cardBackground', 'blurred');
static Future<void> setCardBackground(String value) => _set('cardBackground', value, notify: true);
// ── Self-signed certificates (global, not per-user) ──
@@ -1154,6 +1160,16 @@ class PlayerSettings {
static Future<bool> getFlatBackground() => _get('flatBackground', false);
static Future<void> setFlatBackground(bool v) => _set('flatBackground', v);
+ /// E-ink mode: an override layer for e-ink screens - light flat monochrome
+ /// theme, no animations, plain cards, and the live socket stays down for
+ /// battery. The user's individual appearance settings are left untouched so
+ /// turning it off restores everything. Device-specific by nature, so it is
+ /// deliberately absent from settings sync and backups. The static mirrors
+ /// the stored value for cheap checks from non-async code.
+ static bool einkMode = false;
+ static Future<bool> getEinkMode() => _get('einkMode', false);
+ static Future<void> setEinkMode(bool v) => _set('einkMode', v);
+
/// Seed color (ARGB int) used when [getColorSource] is 'manual'.
static Future<int> getManualSeedColor() => _get('manualSeedColor', 0xFF7C6FBF);
static Future<void> setManualSeedColor(int v) => _set('manualSeedColor', v);
diff --git a/lib/services/socket_service.dart b/lib/services/socket_service.dart
index 4f780288..e166c829 100644
--- a/lib/services/socket_service.dart
+++ b/lib/services/socket_service.dart
@@ -1,6 +1,8 @@
import 'package:flutter/foundation.dart';
import 'package:socket_io_client/socket_io_client.dart' as io;
+import 'player_settings.dart';
+
class SocketService {
static const authorChangeEvents = <String>[
'author_added',
@@ -333,6 +335,14 @@ class SocketService {
_serverUrl = serverUrl;
_customHeaders = customHeaders;
+ // E-ink mode never holds a live socket (battery first) - keep the
+ // credentials so turning the mode off can reconnect, but stop short of
+ // opening the connection. Progress still syncs over plain HTTP.
+ if (PlayerSettings.einkMode) {
+ debugPrint('[Battery] Socket not opened (e-ink mode)');
+ return;
+ }
+
try {
_socket = _createSocket(serverUrl);
@@ -536,6 +546,7 @@ class SocketService {
/// Reconnect after a soft disconnect, reusing saved credentials.
void softReconnect() {
if (_socket != null) return; // already connected
+ if (PlayerSettings.einkMode) return;
final url = _serverUrl;
final token = _token;
if (url == null || token == null) return;
diff --git a/lib/widgets/absorbing_card.dart b/lib/widgets/absorbing_card.dart
index 7a9c517d..397dbe14 100644
--- a/lib/widgets/absorbing_card.dart
+++ b/lib/widgets/absorbing_card.dart
@@ -595,7 +595,10 @@ class AbsorbingCardState extends State<AbsorbingCard> with AutomaticKeepAliveCli
@override
Widget build(BuildContext context) {
super.build(context); // required for AutomaticKeepAliveClientMixin
- final cs = _coverScheme ?? Theme.of(context).colorScheme;
+ // E-ink mode: the cover-derived palette renders as washed-out grey, so
+ // the card sticks to the monochrome app theme.
+ final cs = (PlayerSettings.einkMode ? null : _coverScheme) ??
+ Theme.of(context).colorScheme;
final accent = cs.primary;
final isDark = Theme.of(context).brightness == Brightness.dark;
final l = AppLocalizations.of(context)!;
@@ -922,7 +925,7 @@ class AbsorbingCardState extends State<AbsorbingCard> with AutomaticKeepAliveCli
fit: StackFit.expand,
children: [
// Cover image
- coverUrl != null && coverIdentity != null
+ EinkCoverTone(child: coverUrl != null && coverIdentity != null
? isLocalCover
? BlurPaddedCover(blurChild: Image.file(File(coverUrl), fit: BoxFit.cover,
gaplessPlayback: true,
@@ -942,7 +945,7 @@ class AbsorbingCardState extends State<AbsorbingCard> with AutomaticKeepAliveCli
},
placeholder: (_, __) => CoverPlaceholder(title: _title, author: _author),
errorWidget: (_, __, ___) => CoverPlaceholder(title: _title, author: _author)))
- : CoverPlaceholder(title: _title, author: _author),
+ : CoverPlaceholder(title: _title, author: _author)),
// Casting overlay
if (isCastingThis) ...[
Positioned.fill(
diff --git a/lib/widgets/absorbing_shared.dart b/lib/widgets/absorbing_shared.dart
index 699219bb..857c0fcf 100644
--- a/lib/widgets/absorbing_shared.dart
+++ b/lib/widgets/absorbing_shared.dart
@@ -7,6 +7,7 @@ import '../providers/auth_provider.dart';
import '../providers/library_provider.dart';
import '../services/download_service.dart';
import '../services/playback_history_service.dart';
+import '../services/player_settings.dart';
import 'overlay_toast.dart';
String dateLabel(DateTime dt, [AppLocalizations? l]) {
@@ -74,6 +75,29 @@ IconData historyIcon(PlaybackEventType type) {
}
}
+/// Lifts the shadows of cover art in e-ink mode. Dark covers (Project Hail
+/// Mary) render as a featureless black blob on an e-ink panel, so the tones
+/// get compressed into the panel's legible range: pure black comes up to a
+/// dark grey that still dithers with detail, white stays white. Off e-ink
+/// this is a pass-through.
+class EinkCoverTone extends StatelessWidget {
+ final Widget child;
+ const EinkCoverTone({super.key, required this.child});
+
+ static const _lift = ColorFilter.matrix(<double>[
+ 0.8, 0, 0, 0, 51,
+ 0, 0.8, 0, 0, 51,
+ 0, 0, 0.8, 0, 51,
+ 0, 0, 0, 1, 0,
+ ]);
+
+ @override
+ Widget build(BuildContext context) {
+ if (!PlayerSettings.einkMode) return child;
+ return ColorFiltered(colorFilter: _lift, child: child);
+ }
+}
+
class CoverPlaceholder extends StatelessWidget {
final String? title;
final String? author;
diff --git a/lib/widgets/book_card.dart b/lib/widgets/book_card.dart
index 4d525b53..29eb2c92 100644
--- a/lib/widgets/book_card.dart
+++ b/lib/widgets/book_card.dart
@@ -460,16 +460,16 @@ class _CoverImage extends StatelessWidget {
if (coverUrl!.startsWith('/')) {
final file = File(coverUrl!);
if (file.existsSync()) {
- return BlurPaddedCover(
+ return EinkCoverTone(child: BlurPaddedCover(
enabled: isSquare,
blurChild: Image.file(file, fit: BoxFit.cover, errorBuilder: (_, __, ___) => const SizedBox.shrink()),
child: Image.file(file, fit: effectiveFit, errorBuilder: (_, __, ___) => _placeholder()),
- );
+ ));
}
return _placeholder();
}
- return BlurPaddedCover(
+ return EinkCoverTone(child: BlurPaddedCover(
enabled: isSquare,
blurChild: CachedNetworkImage(
imageUrl: coverUrl!,
@@ -484,7 +484,7 @@ class _CoverImage extends StatelessWidget {
placeholder: (_, __) => _placeholder(),
errorWidget: (_, __, ___) => _placeholder(),
),
- );
+ ));
}
/// Home shelves used to show a bare headphones icon here while the library
diff --git a/lib/widgets/book_detail_sheet.dart b/lib/widgets/book_detail_sheet.dart
index 1be8ed3b..619ffadb 100644
--- a/lib/widgets/book_detail_sheet.dart
+++ b/lib/widgets/book_detail_sheet.dart
@@ -523,7 +523,8 @@ class _BookDetailSheetContentState extends State<_BookDetailSheetContent> {
}
Widget _buildContent(BuildContext context, ColorScheme cs, TextTheme tt, AppLocalizations l) {
- final accent = _coverScheme?.primary ?? cs.primary;
+ final accent =
+ (PlayerSettings.einkMode ? null : _coverScheme?.primary) ?? cs.primary;
final media = _item!['media'] as Map<String, dynamic>? ?? {};
final metadata = media['metadata'] as Map<String, dynamic>? ?? {};
final chapters = media['chapters'] as List<dynamic>? ?? [];
@@ -998,8 +999,10 @@ class _BookDetailSheetContentState extends State<_BookDetailSheetContent> {
// Actions run on this (live) sheet context just like the detail sheet, so we
// never pop-then-touch a defunct context; navigation actions dismiss us.
Widget _buildQuickContent(BuildContext context, ColorScheme cs, TextTheme tt, AppLocalizations l) {
- final accent = _coverScheme?.primary ?? cs.primary;
- final onAccent = _coverScheme?.onPrimary ?? cs.onPrimary;
+ final accent =
+ (PlayerSettings.einkMode ? null : _coverScheme?.primary) ?? cs.primary;
+ final onAccent =
+ (PlayerSettings.einkMode ? null : _coverScheme?.onPrimary) ?? cs.onPrimary;
final media = _item!['media'] as Map<String, dynamic>? ?? {};
final metadata = media['metadata'] as Map<String, dynamic>? ?? {};
final chapters = media['chapters'] as List<dynamic>? ?? [];
diff --git a/lib/widgets/card_buttons.dart b/lib/widgets/card_buttons.dart
index 10289458..63589592 100644
--- a/lib/widgets/card_buttons.dart
+++ b/lib/widgets/card_buttons.dart
@@ -33,6 +33,14 @@ import 'notes_sheet.dart';
import 'overlay_toast.dart';
import 'sleep_timer_sheet.dart';
+/// E-ink screens dither faint greys and cover-colored accents into noise, so
+/// the card controls bump to near-black when e-ink mode is on. Disabled stays
+/// visibly lighter than enabled, just dark enough to survive the panel.
+Color _inkAccent(Color accent) =>
+ PlayerSettings.einkMode ? Colors.black : accent;
+double _inkAlpha(double normal, double eink) =>
+ PlayerSettings.einkMode ? eink : normal;
+
/// Wrapper that gives any child a press-down opacity+scale effect.
class Pressable extends StatefulWidget {
final VoidCallback? onTap;
@@ -113,16 +121,23 @@ class CardWideButton extends StatelessWidget {
final radius = compact ? 10.0 : (large ? 14.0 : 12.0);
final showIconOnly = compact || iconsOnly;
final fgColor = highlighted
- ? accent
- : (enabled ? cs.onSurfaceVariant : cs.onSurface.withValues(alpha: 0.24));
+ ? _inkAccent(accent)
+ : (enabled
+ ? cs.onSurfaceVariant
+ : cs.onSurface.withValues(alpha: _inkAlpha(0.24, 0.85)));
return Pressable(
onTap: enabled ? onTap : () => showInactiveToast(context),
child: Container(
padding: EdgeInsets.symmetric(vertical: vPad),
decoration: BoxDecoration(
- color: highlighted ? accent.withValues(alpha: 0.1) : cs.onSurface.withValues(alpha: 0.06),
+ color: highlighted
+ ? _inkAccent(accent).withValues(alpha: _inkAlpha(0.1, 0.12))
+ : cs.onSurface.withValues(alpha: _inkAlpha(0.06, 0.03)),
borderRadius: BorderRadius.circular(radius),
- border: Border.all(color: highlighted ? accent.withValues(alpha: 0.3) : cs.onSurface.withValues(alpha: 0.08)),
+ border: Border.all(
+ color: highlighted
+ ? _inkAccent(accent).withValues(alpha: _inkAlpha(0.3, 1.0))
+ : cs.onSurface.withValues(alpha: _inkAlpha(0.08, 0.55))),
),
child: showIconOnly
? Center(child: Icon(icon, size: iconSize, color: fgColor))
@@ -168,14 +183,18 @@ class MoreMenuItem extends StatelessWidget {
decoration: BoxDecoration(
color: cs.surfaceContainerHigh,
borderRadius: BorderRadius.circular(16),
- border: Border.all(color: cs.onSurface.withValues(alpha: 0.08)),
+ border: Border.all(color: cs.onSurface.withValues(alpha: _inkAlpha(0.08, 0.55))),
),
child: Column(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, children: [
- Icon(icon, size: 22, color: enabled ? accent.withValues(alpha: 0.85) : cs.onSurface.withValues(alpha: 0.24)),
+ Icon(icon, size: 22, color: enabled
+ ? _inkAccent(accent).withValues(alpha: _inkAlpha(0.85, 1.0))
+ : cs.onSurface.withValues(alpha: _inkAlpha(0.24, 0.85))),
const SizedBox(height: 7),
Flexible(child: Text(label, textAlign: TextAlign.center, maxLines: 2, overflow: TextOverflow.ellipsis,
style: TextStyle(
- color: enabled ? cs.onSurface.withValues(alpha: 0.85) : cs.onSurface.withValues(alpha: 0.24),
+ color: enabled
+ ? cs.onSurface.withValues(alpha: _inkAlpha(0.85, 1.0))
+ : cs.onSurface.withValues(alpha: _inkAlpha(0.24, 0.85)),
fontSize: 11, fontWeight: FontWeight.w500, height: 1.15))),
]),
),
@@ -228,9 +247,13 @@ class CardSleepButtonInline extends StatelessWidget {
height: h,
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
- color: active ? accent.withValues(alpha: 0.1) : cs.onSurface.withValues(alpha: 0.06),
+ color: active
+ ? _inkAccent(accent).withValues(alpha: _inkAlpha(0.1, 0.12))
+ : cs.onSurface.withValues(alpha: _inkAlpha(0.06, 0.03)),
borderRadius: BorderRadius.circular(radius),
- border: Border.all(color: active ? accent.withValues(alpha: 0.3) : cs.onSurface.withValues(alpha: 0.08)),
+ border: Border.all(color: active
+ ? _inkAccent(accent).withValues(alpha: _inkAlpha(0.3, 1.0))
+ : cs.onSurface.withValues(alpha: _inkAlpha(0.08, 0.55))),
),
child: Stack(children: [
if (active && isTime)
@@ -238,17 +261,17 @@ class CardSleepButtonInline extends StatelessWidget {
widthFactor: sleep.timeProgress.clamp(0.0, 1.0),
child: Container(
decoration: BoxDecoration(
- color: accent.withValues(alpha: 0.15),
+ color: _inkAccent(accent).withValues(alpha: 0.15),
borderRadius: BorderRadius.circular(radius - 1),
),
),
),
Center(child: (compact || iconsOnly) && !active
? Icon(Icons.nightlight_round_outlined, size: iconSz,
- color: isActive ? cs.onSurfaceVariant : cs.onSurface.withValues(alpha: 0.24))
+ color: isActive ? cs.onSurfaceVariant : cs.onSurface.withValues(alpha: _inkAlpha(0.24, 0.85)))
: iconsOnly && active
? Text(label, maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle(
- color: accent,
+ color: _inkAccent(accent),
fontSize: fontSize,
fontWeight: FontWeight.w700,
fontFeatures: isTime ? const [FontFeature.tabularFigures()] : null,
@@ -257,10 +280,10 @@ class CardSleepButtonInline extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.nightlight_round_outlined, size: iconSz,
- color: active ? accent : (isActive ? cs.onSurfaceVariant : cs.onSurface.withValues(alpha: 0.24))),
+ color: active ? _inkAccent(accent) : (isActive ? cs.onSurfaceVariant : cs.onSurface.withValues(alpha: _inkAlpha(0.24, 0.85)))),
SizedBox(width: compact ? 4 : 8),
Flexible(child: Text(label, maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle(
- color: active ? accent : (isActive ? cs.onSurfaceVariant : cs.onSurface.withValues(alpha: 0.24)),
+ color: active ? _inkAccent(accent) : (isActive ? cs.onSurfaceVariant : cs.onSurface.withValues(alpha: _inkAlpha(0.24, 0.85))),
fontSize: fontSize,
fontWeight: active ? FontWeight.w700 : FontWeight.w500,
fontFeatures: active && isTime ? const [FontFeature.tabularFigures()] : null,
@@ -333,9 +356,13 @@ class CardDownloadButtonInline extends StatelessWidget {
height: h,
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
- color: downloaded ? dlGreen.withValues(alpha: 0.1) : cs.onSurface.withValues(alpha: 0.06),
+ color: downloaded
+ ? dlGreen.withValues(alpha: _inkAlpha(0.1, 0.12))
+ : cs.onSurface.withValues(alpha: _inkAlpha(0.06, 0.03)),
borderRadius: BorderRadius.circular(radius),
- border: Border.all(color: downloaded ? dlGreen.withValues(alpha: 0.3) : cs.onSurface.withValues(alpha: 0.08)),
+ border: Border.all(color: downloaded
+ ? dlGreen.withValues(alpha: _inkAlpha(0.3, 0.9))
+ : cs.onSurface.withValues(alpha: _inkAlpha(0.08, 0.55))),
),
child: Stack(children: [
if (downloading)
@@ -452,9 +479,9 @@ class _CardBookmarkButtonInlineState extends State<CardBookmarkButtonInline> {
child: Container(
padding: EdgeInsets.symmetric(vertical: vPad),
decoration: BoxDecoration(
- color: cs.onSurface.withValues(alpha: 0.06),
+ color: cs.onSurface.withValues(alpha: _inkAlpha(0.06, 0.03)),
borderRadius: BorderRadius.circular(radius),
- border: Border.all(color: cs.onSurface.withValues(alpha: 0.08)),
+ border: Border.all(color: cs.onSurface.withValues(alpha: _inkAlpha(0.08, 0.55))),
),
child: cp || widget.iconsOnly
? Center(child: Icon(Icons.bookmark_outline_rounded, size: iconSz, color: cs.onSurfaceVariant))
@@ -588,9 +615,9 @@ class _CardSpeedButtonInlineState extends State<CardSpeedButtonInline> {
child: Container(
height: h,
decoration: BoxDecoration(
- color: cs.onSurface.withValues(alpha: 0.06),
+ color: cs.onSurface.withValues(alpha: _inkAlpha(0.06, 0.03)),
borderRadius: BorderRadius.circular(radius),
- border: Border.all(color: cs.onSurface.withValues(alpha: 0.08)),
+ border: Border.all(color: cs.onSurface.withValues(alpha: _inkAlpha(0.08, 0.55))),
),
child: content,
),
@@ -1547,9 +1574,13 @@ class CardActionDelegate {
height: h,
padding: EdgeInsets.symmetric(vertical: vPad),
decoration: BoxDecoration(
- color: castActive ? accent.withValues(alpha: 0.1) : cs.onSurface.withValues(alpha: 0.06),
+ color: castActive
+ ? _inkAccent(accent).withValues(alpha: _inkAlpha(0.1, 0.12))
+ : cs.onSurface.withValues(alpha: _inkAlpha(0.06, 0.03)),
borderRadius: BorderRadius.circular(radius),
- border: Border.all(color: castActive ? accent.withValues(alpha: 0.3) : cs.onSurface.withValues(alpha: 0.08)),
+ border: Border.all(color: castActive
+ ? _inkAccent(accent).withValues(alpha: _inkAlpha(0.3, 1.0))
+ : cs.onSurface.withValues(alpha: _inkAlpha(0.08, 0.55))),
),
child: iconsOnly
? Center(child: Icon(moreIcon, size: iconSz, color: iconColor))
diff --git a/lib/widgets/expanded_card.dart b/lib/widgets/expanded_card.dart
index 788c60ae..5fb68b88 100644
--- a/lib/widgets/expanded_card.dart
+++ b/lib/widgets/expanded_card.dart
@@ -603,7 +603,10 @@ class _ExpandedCardState extends State<ExpandedCard> {
@override
Widget build(BuildContext context) {
final tt = Theme.of(context).textTheme;
- final cs = _coverScheme ?? Theme.of(context).colorScheme;
+ // E-ink mode: the cover-derived palette renders as washed-out grey, so
+ // the card sticks to the monochrome app theme.
+ final cs = (PlayerSettings.einkMode ? null : _coverScheme) ??
+ Theme.of(context).colorScheme;
final accent = cs.primary;
final isDark = Theme.of(context).brightness == Brightness.dark;
final l = AppLocalizations.of(context)!;
@@ -811,7 +814,7 @@ class _ExpandedCardState extends State<ExpandedCard> {
fit: StackFit.expand,
children: [
// Cover image
- _coverUrl != null
+ EinkCoverTone(child: _coverUrl != null
? _isLocalCover
? BlurPaddedCover(blurChild: Image.file(File(_coverUrl!), fit: BoxFit.cover,
errorBuilder: (_, __, ___) => const SizedBox.shrink()),
@@ -824,7 +827,7 @@ class _ExpandedCardState extends State<ExpandedCard> {
httpHeaders: mediaHeaders,
placeholder: (_, __) => CoverPlaceholder(title: _title, author: _author),
errorWidget: (_, __, ___) => CoverPlaceholder(title: _title, author: _author)))
- : CoverPlaceholder(title: _title, author: _author),
+ : CoverPlaceholder(title: _title, author: _author)),
// Play/pause overlay
if (_coverPlayButton && !isCastingThis && !isFinished)
Positioned.fill(