Skip to content

Add e-ink mode with device detection and grayscale theme#22663

Open
jkmassel wants to merge 2 commits intotrunkfrom
jkmassel/ereader-support
Open

Add e-ink mode with device detection and grayscale theme#22663
jkmassel wants to merge 2 commits intotrunkfrom
jkmassel/ereader-support

Conversation

@jkmassel
Copy link
Contributor

@jkmassel jkmassel commented Mar 7, 2026

Description

Adds e-ink mode support for e-reader devices (Onyx BOOX, PocketBook, Kobo, reMarkable, etc.). When enabled, the app uses a grayscale color scheme optimized for e-ink displays (typically 16 shades of gray) and disables all animations for faster screen refreshes.

Key changes:

  • E-ink device detection (EinkDeviceDetector): Checks Build.MANUFACTURER, Build.BRAND, and Build.MODEL against a list of known e-ink devices sourced from KOReader's device database. Handles dual-use manufacturers (e.g. Hisense, Xiaomi) by requiring model pattern matches.
  • Auto-detection prompt: On first launch, if an e-ink device is detected, a dialog prompts the user to enable e-ink mode. The prompt only shows once.
  • Grayscale theme (colorSchemeEink): A dedicated Material 3 color scheme using black, white, and gray values. Forces light mode when active.
  • Animation suppression: All AniUtils animations skip to their end state immediately. Activity transitions are disabled via BaseAppCompatActivity.
  • Settings toggle: "E-ink mode (Beta)" switch in App Settings for manual enable/disable.
  • Device Info screen: New Compose screen accessible from Help & Support showing device build properties and whether the device matches the e-reader list. Includes a "Copy to Clipboard" button for easy bug reporting.
  • Analytics: Tracks EINK_PROMPT_SHOWN, EINK_PROMPT_ACCEPTED, EINK_PROMPT_DISMISSED, and APP_SETTINGS_EINK_MODE_CHANGED.

Testing instructions

E-ink auto-detection prompt:

  1. Install the app on an e-ink device (or modify EinkDeviceDetector to return true for your device – this is the more likely testing flow)
  2. Launch the app for the first time
  • Verify a dialog appears with title "E-ink display detected"
  1. Tap "Enable"
  • Verify the app recreates with the grayscale theme and no animations
  1. Force stop and relaunch the app
  • Verify the prompt does not appear again

Manual toggle:

  1. Go to Me → App Settings
  • Verify "E-ink mode (Beta)" toggle is visible
  1. Enable the toggle
  • Verify the app recreates with grayscale colors (black/white/gray only)
  • Verify no animations occur when navigating between screens
  • Verify dark mode is ignored (always light)
  1. Disable the toggle
  • Verify normal colors and animations return

Device Info screen:

  1. Go to Me → Help & Support
  • Verify "Device Info" button is visible below "Application Log"
  1. Tap "Device Info"
  • Verify the screen shows Application, Device, and Android sections
  • Verify "Matches known E-reader list" shows "Yes" or "No" correctly
  1. Tap "Copy to Clipboard"
  • Verify a toast confirms the copy and the clipboard contains the device info text

🤖 Generated with Claude Code

jkmassel and others added 2 commits March 6, 2026 17:19
Adds e-ink support for Android e-readers (Onyx Boox, Kobo, etc.):

- Device detection using known manufacturer, brand, and model lists
- Grayscale Compose color scheme with forced light mode
- Animation disabling across all AniUtils methods and activity
  transitions
- Settings toggle in App Settings (marked Beta)
- Auto-detect prompt shown on first launch for detected e-ink devices
- Analytics tracking for prompt and settings interactions
- Preferences stored via AppPrefs (EINK_MODE_ENABLED,
  EINK_AUTO_DETECT_DONE)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a dedicated Device Info screen accessible from Help & Support
showing manufacturer, brand, model, Android version, SDK level, app
version, and e-ink detection status. Includes a copy-to-clipboard
button for sharing device details with support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dangermattic
Copy link
Collaborator

1 Error
🚫 PR requires at least one label.
2 Warnings
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 7, 2026

@wpmobilebot
Copy link
Contributor

Project manifest changes for WordPress

The following changes in the WordPress's merged AndroidManifest.xml file were detected (build variant: jetpackVanillaRelease):

--- ./build/reports/diff_manifest/WordPress/jetpackVanillaRelease/base_manifest.txt	2026-03-07 00:30:35.377801970 +0000
+++ ./build/reports/diff_manifest/WordPress/jetpackVanillaRelease/head_manifest.txt	2026-03-07 00:30:38.607805702 +0000
@@ -478,6 +478,10 @@
             android:label="@string/help_buttons_screen_title"
             android:theme="@style/WordPress.NoActionBar" />
         <activity
+            android:name="org.wordpress.android.ui.accounts.DeviceInfoActivity"
+            android:label="@string/device_info_title"
+            android:theme="@style/WordPress.NoActionBar" />
+        <activity
             android:name="org.wordpress.android.ui.main.feedbackform.FeedbackFormActivity"
             android:label="@string/feedback_form_title"
             android:theme="@style/WordPress.NoActionBar" />

Go to https://buildkite.com/automattic/wordpress-android/builds/25353/canvas?sid=019cc5af-2015-40e7-8fab-28fac5c1692a, click on the Artifacts tab and audit the files.

@wpmobilebot
Copy link
Contributor

Project manifest changes for WordPress

The following changes in the WordPress's merged AndroidManifest.xml file were detected (build variant: wordpressVanillaRelease):

--- ./build/reports/diff_manifest/WordPress/wordpressVanillaRelease/base_manifest.txt	2026-03-07 00:30:58.678425926 +0000
+++ ./build/reports/diff_manifest/WordPress/wordpressVanillaRelease/head_manifest.txt	2026-03-07 00:31:02.518439524 +0000
@@ -284,6 +284,10 @@
             android:label="@string/help_buttons_screen_title"
             android:theme="@style/WordPress.NoActionBar" />
         <activity
+            android:name="org.wordpress.android.ui.accounts.DeviceInfoActivity"
+            android:label="@string/device_info_title"
+            android:theme="@style/WordPress.NoActionBar" />
+        <activity
             android:name="org.wordpress.android.ui.main.feedbackform.FeedbackFormActivity"
             android:label="@string/feedback_form_title"
             android:theme="@style/WordPress.NoActionBar" />

Go to https://buildkite.com/automattic/wordpress-android/builds/25353/canvas?sid=019cc5af-2013-4eec-90e6-693cc182f0dc, click on the Artifacts tab and audit the files.

@wpmobilebot
Copy link
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
FlavorJalapeno
Build TypeDebug
Versionpr22663-c6ba1d2
Build Number1485
Application IDorg.wordpress.android.prealpha
Commitc6ba1d2
Installation URL1k1ho7n219luo
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
FlavorJalapeno
Build TypeDebug
Versionpr22663-c6ba1d2
Build Number1485
Application IDcom.jetpack.android.prealpha
Commitc6ba1d2
Installation URL0ab1kg0qvn5p0
Note: Google Login is not supported on these builds.

Comment on lines +107 to +109
context.getString(
R.string.device_info_title
),

Check failure

Code scanning / Android Lint

Querying resource properties using LocalContext.current Error

Querying resource values using LocalContext.current
private WPPreference mLanguagePreference;
private ListPreference mAppThemePreference;
private ListPreference mInitialScreenPreference;
private WPSwitchPreference mEinkModePref;

Check notice

Code scanning / Android Lint

Nullable/NonNull annotation missing on field Note

Missing null annotation
return AppPrefs.isEinkModeEnabled();
}

private static ObjectAnimator noopAnimator(View target) {

Check notice

Code scanning / Android Lint

Nullable/NonNull annotation missing on method parameter Note

Missing null annotation
@wpmobilebot
Copy link
Contributor

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants