I am working on an app for ICS and I would like my Activity to have the same background than the settings, with the cool gradient.
I tried Theme.DeviceDefault and some other, but I cannot get it.
Is that possible or should I forget?
It is relatively simple to create this app background directly yourself.
drawable/app_background_ics.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="270"
android:startColor="@color/ics_background_start"
android:endColor="@color/ics_background_end"
android:type="linear" />
</shape>
values/colors.xml
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<color name="ics_background_start">#ff020202</color>
<color name="ics_background_end">#ff272D33</color>
</resources>
Then add the app_background_ics drawable as a background to your main view (in this example ListView). Do not forget a transparent android:cacheColorHint in order to avoid a black background when scrolling in the ListView
<ListView android:id="@+id/video_list"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:dividerHeight="2dip"
android:background="@drawable/app_background_ics"
android:cacheColorHint="#00000000"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With