tags:

views:

38

answers:

1

Hello guys, hope you guys can give me a hand now! this is tricky to me

I have run into an requirement of my application that i cant find a way to do this.

I need my application to be fullscreen and no title bar (done), and this application will have a background image. However, all the activities/views of my application must be transparent/translucent so the application background will be visible all the time behind the information i am displaying.

Basically i would like to have this behavior

http://www.geeky-gadgets.com/wp-content/uploads/2010/05/amazon-kindle-android-app.jpg

supousing that the image you see is not the phone wallpaper, but the application background image. What would be the application configuration in the manifest file and what would be the configuration for eacy activity/view?

I also noticed that, i need to setup each activity to be fullscreen without title bar. Is there a way to do this globaly in the application so all activities will behave this way?

Many thanks for your time

A: 

To hide the title bar in all your activities you should set a custom theme in your AndroidManifest.xml file like so:

<application 
    android:icon="@drawable/application_icon"
    android:label="@string/app_name"
    stuff..
    android:theme="@style/MyTheme">

Then define the theme in styles.xml:

<style name="MyTheme" parent="android:Theme.Black">
    <item name="android:windowNoTitle">true</item>
</style>

For the background, I'm pretty sure you can just set a the background of a ListView to point to a .PNG that you have in your resource folder (it probably has to be the exact dimensions of the screen).

Brandon
So, If I want the same background image for all my views inside the application, I need to set the image view per view instead of having the background image for all of them set in one place like you exlained me for the title bar? Am I correct?
Thiago
I thought there wasn't, but it looks like there is a <item name="windowBackground">@drawable/screen_background_light</item> in Themes.xml: http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/values/themes.xml;h=6b3d7407d1c895a3c297e60d5beac98e2d34c271;hb=HEAD
Brandon