creating background drawable using layer-list, icon getting stretched : <p>Hi I am trying to create a background <code>drawable</code> for my splash screen which I'll be setting in theme itself. But the bitmap drawable used to keep in the center is getting stretched and I am not able to figure how to keep it normal. Below is my drawable code:
<strong>splash_screen_bg.xml</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt;
&lt;item&gt;
    &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle"&gt;
        &lt;gradient
            android:angle="360"
            android:centerColor="@color/colorAccentXDark"
            android:endColor="@color/Black"
            android:gradientRadius="500dp"
            android:startColor="@color/colorAccentXDark"
            android:type="radial"
            android:useLevel="false" /&gt;
    &lt;/shape&gt;
&lt;/item&gt;
&lt;item
    android:bottom="50dp"
    android:top="50dp"&gt;
    &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:innerRadius="500dp"
        android:innerRadiusRatio="1"
        android:shape="oval"&gt;
        &lt;gradient
            android:angle="360"
            android:centerColor="@color/colorAccentXDark"
            android:endColor="@color/colorAccentXDark"
            android:gradientRadius="400dp"
            android:startColor="@color/colorAccent"
            android:type="radial"
            android:useLevel="false" /&gt;
    &lt;/shape&gt;
&lt;/item&gt;
&lt;item android:gravity="center"&gt;
    &lt;bitmap android:src="@drawable/ty_logo" /&gt;
&lt;/item&gt;
&lt;/layer-list&gt;
</code></pre>

<p>Here is code where I am setting this drawable as background of an activity:</p>

<pre><code> &lt;style name="TYTheme" parent="SearchActivityTheme.NoActionBar"&gt;
    &lt;item name="colorPrimaryDark"&gt;@color/colorAccentXDark&lt;/item&gt;
    &lt;item name="android:alertDialogTheme"&gt;@style/AlertDialogTheme&lt;/item&gt;
    &lt;item name="android:windowBackground"&gt;@drawable/splash_screen_bg&lt;/item&gt;
&lt;/style&gt;
</code></pre>

<p>So here the bitmap drawable <code>ty_logo</code> is an <code>png</code> is  getting stretched in my phone. Since there is no <code>scaleType</code> option with <code>bitmapDrawable</code> I don't know how to handle it. </p>
