Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added configuration options to e-ink page flashes #625

Merged
merged 5 commits into from
Jun 26, 2024

Conversation

sirlag
Copy link
Contributor

@sirlag sirlag commented Apr 6, 2024

Adds some configuration options for the e-ink page flash to better support a variety of devices.

Added Flash duration options - 100-1500ms
Added Flash style options - Black, White, White/Black
Added Flash spacing options - 1 - 10 pages

The current page flash system really is a hack over the reader (adding a colored rectangle over the reader for the duration of the flash) hooked into every page. Trying to use this hook to enable and disable the invert filter had low success, particularly because it only triggers after the page change animation has already started to play. Attempt to add a proper invert or inline screen clear will probably require a refactor for on-exit hooks that can delay a transition, but that seemed beyond the scope of getting this more usable for our e-ink users.

Disabled Enabled
image image

Closes #585

Copy link
Member

@AntsyLich AntsyLich left a comment

Choose a reason for hiding this comment

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

Make all strings into string resource. And add the settings in reader settings sheet

Copy link
Contributor

@mainrs mainrs left a comment

Choose a reason for hiding this comment

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

As far as I can tell all requested changes have been made!

@sirlag
Copy link
Contributor Author

sirlag commented Apr 11, 2024

As far as I can tell all requested changes have been made!

There is one outstanding issue that is being discussed, where the state management for the flash interval is currently loaded in a non-reactive way, and thus does not update when set in the reader quick settings sheet

@mainrs
Copy link
Contributor

mainrs commented Apr 11, 2024

Before this gets merged I'd like to bring up something I just discovered.

My Ebook offers a SDK that can be used to properly flash the screen similar to the procedure Kindle devices do.

Would it be possible to somehow abstract the flashing logic using an interface? And mihon could then inject different implementations depending on which device it runs on.

https://github.com/artatechsoft/InkbookSDK

@sirlag
Copy link
Contributor Author

sirlag commented Apr 11, 2024

My Ebook offers a SDK...

Seems interesting. At a glance, it does appear to be designed for pre-compose android development, so I am not 100% sure how well their refresh hook would work with compose.

As mentioned in the initial PR Comment, trying to get this properly supported with the way the current reader is implemented will be a lot more work, think of this PR as a bandage to help out e-ink users, without needing substantial changes at this time.

@sirlag sirlag closed this Jun 22, 2024
@AntsyLich AntsyLich reopened this Jun 23, 2024
@AntsyLich AntsyLich merged commit 2f86f25 into mihonapp:main Jun 26, 2024
1 check passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The "Flash on page change" flashing of black screen is not enough to combat ghosting
3 participants