views:

88

answers:

0

I have a custom drawable object in one side, object1.xml:

<drawable ... />

I have another custom shape object in the other side, object2.xml:

<shape ...><gradient .../></shape>

In every activity, I want to have these two object as the Activity's background, so what I currently do is:

<LinearLayout android:background="@drawable/object1" ...>
<ImageView 
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 android:background="@drawable/object2"
 .../>
...
<LinearLayout/>

What I want to do is to remove this piece of code from every Activity and create a custom Theme for the whole application, that includes this composed background.

What I have achieved is to create the Theme with the object1 as background, but no way to get the second object.

<resources>
 <style name="CustomDialogTheme" parent="@android:style/Theme.NoTitleBar">
  <item name="android:windowFullscreen">true</item>
  <item name="android:windowBackground">@drawable/object1</item>
 </style>
</resources>

I've tried to use a <list-item> but the object2 is simply not displayed.