9

I've tried everything, and searched the whole web, but still, nothing works.
Here is the background my designer designed:
enter image description here

And here how it looks on my screen (Galaxy S I9000):
enter image description here

I've tried to enable dithering with this code:

findViewById(R.id.LinearLayout_Main).getBackground().setDither(true);
    @Override
public void onAttachedToWindow() {
    super.onAttachedToWindow();
    Window window = getWindow();
    window.setFormat(PixelFormat.RGBA_8888);
}

Can anyone tell me why?

i_am_jorf
  • 53,608
  • 15
  • 131
  • 222
Omar
  • 7,835
  • 14
  • 62
  • 108

1 Answers1

5

I think, this article will be interesting for you:

Android perfect UI: fighting with dithering

And you can read about dithering background here on SO too

android:dither="true" does not dither, what's wrong?

And last suggestion comes from Android Google Groups

https://groups.google.com/group/android-developers/browse_thread/thread/aebef48635d04334/2e3d86e62e0452e5?lnk=gst&q=dithering#2e3d86e62e0452e5

to use gradient proxy drawable shape instead of @drawable/image like this:

<?xml version="1.0" encoding="utf-8"?> 
<shape 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:src="@drawable/image" 
    android:dither="true" /> 
Community
  • 1
  • 1
Marek Sebera
  • 39,650
  • 37
  • 158
  • 244