It's really device specific. I have 2 ways of doing it.
1) Dirty hack
First create "negative" Paint:
float[] colorMatrix_Negative = { -1.0f, 0, 0, 0, 255, // red
0, -1.0f, 0, 0, 255, // green
0, 0, -1.0f, 0, 255, // blue
0, 0, 0, 1.0f, 0 // alpha
};
private final Paint mPaintNegative = new Paint();
private final ColorFilter colorFilter_Negative = new ColorMatrixColorFilter(colorMatrix_Negative);
When showing an image in ImageView you can do something like this in onDraw:
protected void onDraw(Canvas canvas) {
if (mBitmap != null && !mBitmap.isRecycled()) {
if(isNewImage) {
canvas.drawBitmap(mBitmap, mImgTrans.srcRect, mImgTrans.viewRect, mPaintNegative);
invalidate();
} else {
canvas.drawBitmap(mBitmap, mImgTrans.srcRect, mImgTrans.viewRect, mPaint);
}
}
}
This will first paint negative picture for a frame, then normal one. It works pretty well with removing ghosting, and simulates the real thing. You can improve on it in many ways, for example show negative frame a bit longer etc. Overall it's pretty ugly hack, but works well on most devices.
2) Real way
As far as Onyx Devices are concerned you can ask Onyx to provide you with access to their SDK. It provides EpdController which has functions like:
- refreshScreen(view, mode)
- invalidate(view, mode)
- postInvalidate(view, mode)
which let you force a refresh when necessary. You can also select the refreshing mode depending on your needs, but it's not well documented which mode is what.
Even better you can use, in the same Controller
- setViewDefaultUpdateMode(view, mode)
Which lets you change to a mode more fitting your needs and let the device take care of the rest. There are tons of other useful things over there.
I've used sales@onyx-international.com in order to contact them, but you probably would do better to use dev@onyx-international.com
Since you can detect if you are on Onyx device using that SDK you can still let users activate E-ink mode in settings and then fallback into hack from answer 1) or something similar.