itkach / aard2-android

Aard2 for Android, a simple dictionary app
GNU General Public License v3.0
464 stars 98 forks source link

Bright flash in dark theme when changing article #23

Open ChristianKurz opened 9 years ago

ChristianKurz commented 9 years ago

When clicking a link using the dark theme, the screen turns white before the new page is rendered. The page is rendered in bright mode - black text on white background - and is inverted afterwards.

This behaviour is unwanted, as night vision is destroyed through the bright white screen.

Solution: Show a dark grey screen until the inversion of the rendered article is done.

itkach commented 9 years ago

Actualy there are two flashes - first is blank view with "loading" indicator, which has light background like the rest of the user interface, second is article page briefly rendering with default style before alternative style or user css actually applies. The first one will be addressed in the upcoming release - user will be able to swtich user interface between light and dark theme. The second flash is actually quite tricky: it looks like there is no way to reliably detect proper moment during page load when styles are already available and can be applied but before rendering starts. Currently implemented brute-force approach that tries to apply style periodically while page loads helps to ensure we don't wait for images, but can't prevent flashes.

ThomasLeigh commented 4 years ago

@itkach I have the same flashing issue. I find incredibly amazing the ability to apply my own CSS to the displayed content - thanks to which the app becomes virtually much more readable and usable for Me (one example is that I need a font to be larger than max. size available by tapping on “zoom in”).

For Me it’s also a matter of vision: I am not able to read anything on bright background.

I was thinking about the flashing, You’ve mentioned that:

second is article page briefly rendering with default style

What if a user could overwrite this default style? Or totally disable its loading? Maybe it could help - the point is: could it be possible?