Android: Make application background behave like homescreen background

Posted by Mannaz on Stack Overflow See other posts from Stack Overflow or by Mannaz
Published on 2010-05-31T12:49:31Z Indexed on 2010/05/31 12:53 UTC
Read the original article Hit count: 639

Filed under:
|
|
|

Hi, I have a big background image for my views's background, which also can be tiled (it's repeadable). When switching from one Activity to another i want the background to behave like on the homescreen (the background moves only a bit, but the foreground moves one screen with).

Is this possible and how?

Here is my current background definition:

Manifest.xml:

<application android:icon="@drawable/icon" android:label="@string/app_name" 
android:theme="@style/MyAppStyle">

styles.xml:

<style name="MyAppStyle" parent="@android:style/Theme.NoTitleBar">
    <item name="android:windowBackground">@drawable/window_background_descriptor</item>

window_background_descriptor.xml:

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/window_background" android:tileMode="repeat" />

© Stack Overflow or respective owner

Related posts about android

Related posts about layout