I've got a splash screen with an ImageView
playing the part of a background. Regardless of whether or not I allow my bitmap to be scaled (which I do), the image quality is horrible. I think it's reducing the color depth. I've looked around SO already and one suggestion was to place my image in raw
instead of drawable
but that didn't help either. Here is a screenshot:
What exactly is going on here and how do I fix it?
EDIT: I didn't apply this bitmap programmatically so there's no relevant Java code. Here is the XML code for this activity:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/RelativeLayoutSplash"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawingCacheQuality="high"
android:orientation="vertical"
android:padding="@dimen/splash_padding"
android:scrollbarAlwaysDrawVerticalTrack="true"
tools:context=".SplashActivity" >
<ImageView
android:id="@+id/ImageViewBg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/logo_description"
android:scaleType="centerCrop"
android:src="@drawable/splash_bg_register" />
<ImageView
android:id="@+id/ImageViewLogo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/logo_description"
android:maxHeight="@dimen/logo_maxheight"
android:maxWidth="@dimen/logo_maxwidth"
android:layout_centerVertical="true"
android:src="@drawable/logo" />
<TextView
android:id="@+id/TextViewCopyright"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:text="@string/copyright"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/white_50"
android:textSize="@dimen/copyright_size" />
</RelativeLayout>
EDIT: I tried getWindow().setFormat(PixelFormat.RGBA_8888);
as suggested which made a visible difference but the banding is still present. This is the image I'm using as the background.