| Issue 54: | Android - flickering while switching Displayable | |
| 2 people starred this issue and may be notified of changes. | Back to list |
When midlet switching Displayable (fullscreen Canvas) I see some flickering. With r2211 (as recommended in Android J2me converting manual) it is not so annoying, but in later revisions next Canvas sometime not cover all display area. Tested with Android SDK emulator and r2211, r2377, r2390.
Jun 17, 2010
#1
vitalyster
Jun 17, 2010
Does "much better" means that there is no flickering now (with r2392)?
Jun 18, 2010
There is no flickering, but if Displayable relies on Canvas height and width - it may paints incorrectly, under display area, or so. Switching more times may obtain right size, may not.
Jun 18, 2010
I'm not entirely sure what "switching Displayable" means. Is that a flipping a device from portait to the landscape position or switching between two different Displayable objects?
Jun 18, 2010
it is: http://java.sun.com/javame/reference/apis/jsr037/javax/microedition/lcdui/Display.html#setCurrent(javax.microedition.lcdui.Displayable)
Jun 27, 2010
I discover that regression was in r2304, older revisions returns size correctly
Nov 3, 2010
r2423 improve size calculating, with attached patch it improve calculating more.
Nov 4, 2010
One question, you added to CanvasView:
@Override
public void onSizeChanged(int w, int h, int oldw, int oldh) {
initGraphics(w, h);
}
Is it necessary? I mean, there is already surfaceChanged callback mathod set in CanvasView which calls initGraphics with new size of the view.
Nov 8, 2010
Yes, it not needed, I got debug log and see, that surfaceChanged properly called on device rotation and tell right sizes to application. But graphics still may paints incorrectly after several size changes, I have no idea why.
Nov 25, 2010
r2446 is great - after device rotation graphics area first draws incorrectly but in second or shorter time period it repaints correctly.
Nov 26, 2010
I admit I haven't checked the canvas code thoroughly, so, I wonder how is sizeChanged event propagated user's Canvas? In my midlet I'm using GameCanvas, and I had to modify AndroidCanvasUI in order to have sizeChanged callback invoked (my diff against r2446 attached). But it was a long time, so maybe I should review it...
Nov 30, 2010
r2447 calls the Canvas.sizeChanged. I modified the acui.diff in some places, but the functionality should be the same.
Dec 7, 2010
Now greatly works with sizeChanged, but an older bug come again: after Display.setCurrent(...) - new Displayable(Canvas) not paints (showing black screen) until we explicitly call repaint().
Dec 7, 2010
I've made some simpifications to AndroidCanvasUI: CanvasView extends base View class instead of SurfaceView, and haven't any listed problems with flickering and size changes. I think that is enough for simple (all j2me?) applications.
Dec 8, 2010
I'm afraid I cannot accept the patch since you removed the setAndroidRepaintListener method from AndroidCanvasUI class. That functionality is used by other projects. Also graphics object accessible from getGraphics is created every time when onDraw method is called.
Dec 8, 2010
second try: restored setAndroidRepaintListener and initGraphics methods
Dec 8, 2010
I can see one problem with the latest patch, it removes support for scaling, previously it was handled in onDraw by: androidCanvas.drawBitmap(bitmap, scale, null);
Dec 8, 2010
If we can modify initGraphics parameters signature, then this patch should handle scaling properly
Dec 20, 2010
simpleacui3.patch has been applied, let's test our applications now
Jan 5, 2011
I had to revert the simpleacui3.patch since it makes flickering (repainting a canvas in a loop, causes the entire canvas to flicker with a white background).
while(true) {
repaint();
serviceRepaints();
}
Jan 16, 2011
(No comment was entered for this change.)
Status:
Fixed
Labels: Milestone-3.0 |