Skip to content

feat: E-ink theme - #21371

Open
BrayanDSO wants to merge 19 commits into
ankidroid:mainfrom
BrayanDSO:feat/eink-theme
Open

feat: E-ink theme#21371
BrayanDSO wants to merge 19 commits into
ankidroid:mainfrom
BrayanDSO:feat/eink-theme

Conversation

@BrayanDSO

Copy link
Copy Markdown
Member

Note

Assisted-by: Gemini 3.1 Pro - setting the background color on snackbars

Purpose / Description

Improves the accessibility on E-ink devices by adding a theme aimed at them.

It's basically a Black and white/Grayscale/High contrast theme, with thicker borders/dividers/strokes so components are easier to see.

It's okay to keep the color of some things like the flags, so the user can differentiate them at least a little even if the E-ink screen isn't colored. But there are things that I may have forgotten.

Please let me know if there is anything that should be changed to B/W before this is merged. Some things can be changed on later PRs as well

Approach

How does this change address the problem?

How Has This Been Tested?

Emulator 33

Screen_recording_20260714_154935.webm

I'll send the photos on an E-ink device later

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

@BrayanDSO BrayanDSO added the squash-merge A squash & force push is required. The PR author may do this to speed up the merge process. label Jul 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Important

Maintainers: This PR contains Strings changes

  1. Sync Translations before merging this PR and wait for the action to complete
  2. Review and merge the auto-generated PR in order to sync all user-submitted translations
  3. Sync Translations again and merge the PR so the huge automated string changes caused by merging this PR are by themselves and easy to review

@BrayanDSO
BrayanDSO force-pushed the feat/eink-theme branch 2 times, most recently from 2d2bd00 to e0ce67c Compare July 18, 2026 13:52

@david-allison david-allison left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would strongly consider enabling 'safe display mode' when this is turned on.

My past comment on the padding of the bottom of the buttons remains (new study screen). Implementer's choice:

Image

Only blocker is a decision on the UX for safe display mode.

I find the light/plain/e-ink distinction to be a little unusual, but don't immediately have a UI suggestion to fix it.

)
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
binding = DialogTagsBinding.inflate(layoutInflater)
val builder = AlertDialog.Builder(requireActivity())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes would be useful to split into a separate PR (or commit) if feasible

@BrayanDSO BrayanDSO Jul 26, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed them from this PR. I'll leave it to the future

val hasAttr = requireContext().theme.resolveAttribute(R.attr.studyScreenElevation, typedValue, true)
brushConfigPopup?.elevation =
if (hasAttr) {
TypedValue.complexToDimensionPixelSize(typedValue.data, resources.displayMetrics).toFloat()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use typedValue.getDimension(resources.displayMetrics) (and typedValue.type == TypedValue.TYPE_DIMENSION)

Comment thread AnkiDroid/src/main/java/com/ichi2/ui/BadgeDrawableBuilder.kt
Comment thread AnkiDroid/src/main/java/com/ichi2/ui/BadgeDrawableBuilder.kt Outdated
}
}

// ./gradlew :AnkiDroid:recordRoborazziPlayDebug -Pscreenshot -Ptheme=black,plain

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason you omitted eink?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's just an example of how to use the command.

<item name="learnCountColor">@color/black</item>
<item name="reviewCountColor">@color/black</item>
<item name="buryCountColor">@color/material_grey_700</item>
<item name="zeroCountColor">@color/material_grey_300</item>

@david-allison david-allison Jul 26, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: material_grey_300 doesn't meet WCAG for contrast (neither does the current theme, this isn't a break/blocking) - probably split this into an issue

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Jul 26, 2026
Adds an initial implementation of a theme for E-ink display devices.

It's designed to use mostly grayscale and high contrast colors

Light mode only for now.
produced by editing the colors at "navigation_drawer_background.svg" on InkScape, then exporting it as a PNG, like the other nav_drawer_logo files
@BrayanDSO
BrayanDSO force-pushed the feat/eink-theme branch 2 times, most recently from ea8b8c6 to bd6385c Compare July 26, 2026 14:14
@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Snapshot diff report vs main. Open screenshot-diff for diffs.

  • PreferencesScreenshotTest: 1 change
All 1 changed screenshots

PreferencesScreenshotTest

  • AppearanceSettingsFragment_compare.png

@BrayanDSO

Copy link
Copy Markdown
Member Author

I would strongly consider enabling 'safe display mode' when this is turned on.

Some people may want to use the theme even without an E-ink screen. Or their E-ink screen could have a reasonable refresh rate.

Added a "Related setting" guiding to the accessibility page. That should help

image

@BrayanDSO

Copy link
Copy Markdown
Member Author

My past comment on the padding of the bottom of the buttons remains (new study screen). Implementer's choice:

I don't want the padding to look different among themes. Only the colors should be different

@BrayanDSO BrayanDSO removed the Needs Author Reply Waiting for a reply from the original author label Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review squash-merge A squash & force push is required. The PR author may do this to speed up the merge process. Strings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants