views:

122

answers:

0

Hi all, In my app i have gradient as drawable which i am using as background and i wan't it to make it look as smooth as possible. After googling and trying by myself i came up with the following. On nexus one if you call only setDither(true) your gradient is still banding so you have to set PixelFormat like this Window.setFormat(PixelFormat.RGBA_8888). But on the other side G1 does not support RGBA_8888 so calling it make the gradient even uglier than before so Window.setFormat(PixelFormat.RGBA_8888) will not work well on devices that don't support it.

What is the correct way smooth my gradient on all devices on which my app will run.

PS: i found some related topics

http://stackoverflow.com/questions/2936803/how-to-draw-a-smooth-dithered-gradient-on-a-canvas-in-android

http://stackoverflow.com/questions/2791045/is-it-possible-to-dither-a-gradient-drawable