Quote:
Originally Posted by bardo
In order to see more e-ink friendly applications and to get app designers on board, we need a replacement class for the usual WebView.
|
It should simply be a matter of overriding the methods that have updateMode overloads - basically, copying the methods in the EinkListView I posted about except the constructors and then adding the WebView constructors and an mUpdateMode variable. Then the update mode can be controlled by changing the mUpdateMode variable.
Quote:
Being not an Android programmer, I looked around for generic code which could make it in such a replacement. So far I found these:
- The flicker-free page turn code used in cool reader:
credits to DairyKnight <dairyknight@gmail.com>
http://crengine.git.sourceforge.net/...ontroller.java
- Max Kammerer's code for his nook port of aarddict:
http:///github.com/max-kammerer/aarddict_nook
Code:
// from kbs - trook.projectsource code.
private final void pageUp() {
int cury = articleView2.getScrollY();
if (cury == 0) { return; }
int newy = cury - WEB_SCROLL_PX;
if (newy < 0) {
newy = 0;
}
articleView2.scrollTo(0, newy);
}
private final void pageDown() {
int cury = articleView2.getScrollY();
int hmax = articleView2.getContentHeight() - 200;
if (hmax < 0) {
hmax = 0;
}
int newy = cury + WEB_SCROLL_PX;
if (newy > hmax) {
newy = hmax;
}
if (cury != newy) {
articleView2.scrollTo(0, newy);
}
}
Cool reader has very low page turn flicker, the second code I could not see in action.
In an e-ink friendly app, there would be an option to select high-contrast skins and optimize page refreshes.
Once the keyword "e-ink" or "e-ink friendly" will show up in the Android Market, then we've got the ball rolling.
|
The Cool Reader code looks like it does some device specific hardware magic to turn of the flashing, and the aardict code seems to be generic "page up"/"page down" code (i.e. it reduces superfluous flicker due to scrolling animations, but does not affect the way the screen behaves).
I guess the former is what everyone would like to be able to do, and the latter is something that should be the very minimal effort expected from a developer of an app if it is to be called E-ink friendly (i.e. avoiding animations of all kinds, aiming instead for static screens whenever possible).
Luckily, Sony has provided us with a higher level interface with the "update modes" in the android.view.View class, so on the PRS-T1 a non-flickery app doesn't have to worry about the hardware as long as it utilizes the update modes. It still goes in the former category though, since the methods are device-specific.
Anyhow, the source code for my ListView experiment is available at
SourceForge if anyone wants to take a peek, and an APK is available
here.