views:

187

answers:

1

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" />
A: 

This is a semi-duplicate of another question. Unfortunately, that guy didn't get a full answer either, though I did point him towards some good tutorials for handling graphics. In short, as far as I know, what you're trying to do is not easy. It will require a lot of work with Canvas objects, and understanding how to accurately use touch gestures. Another thing you can try is going to the Android source code repository and looking how they did it. It's called "Launcher", but I don't know whether it's Launcher or Launcher2.

Steve H