Android application transparency and window sizing at root level

Posted by ajoburg on Stack Overflow See other posts from Stack Overflow or by ajoburg
Published on 2009-12-21T18:03:52Z Indexed on 2010/04/30 19:07 UTC
Read the original article Hit count: 442

Filed under:
|

Is it possible to create an application with a transparent background on the root task such that you can see the task running beneath it when it is part of a separate stack? Alternatively, is it possible to run an application so the window of the root task is only a portion of the screen instead of the whole screen?

I understand how the transparency and window sizing is done with activities that are not the root task and this works fine. However, the root task of an activity seems to always fill the whole screen and be black even when a transparent theme is applied to the application object in the manifest file.

ApplicationManifest.xml:

<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true" android:theme="@style/Theme.Transparent">

Styles.xml

<resources> <style name="Theme.Transparent"> <item name="android:windowIsTranslucent">true</item> <item name="android:windowNoTitle">true</item> <item name="android:windowBackground">@drawable/ transparent_background</item> <item name="android:windowAnimationStyle">@android:style/ Animation.Translucent</item> <item name="android:colorForeground">#fff</item> <item name="android:windowIsFloating">true</item> <item name="android:gravity">bottom</item> </style> </resources>

Colors.xml

<resources> <drawable name="transparent_background">#00000000</drawable> </resources>

© Stack Overflow or respective owner

Related posts about android

Related posts about java