3

First of all I am completely new to animation on android but would like to include it in my next application. The application will be as follows:

For example, I will be having 2 layers, each one containing their own data.

Layer 1 will contain data 1

Layer 2 will contain data 2

And layer 1 will be superimposed on layer 2; that is on top of layer 2.

Layer 1 will be over layer 2 and thus masking/hiding layer 2

When a button is clicked (with intention to show layer 2), layer 1 will slide out and revealing layer 2. And another button will allow layer 1 to slide back in again.

Note that I used the word layers to give a general image of what I am trying to achieve. I do not really know which elements are used in animation for android since I did not come across any layout elements that can be superimposed on each over yet.

Also, how I am thinking it right now is that those so called layers will be in a linearlayout.

So my question is how can I achieve this?What elements/objects/library should I be using?And of course links to some documentation and tutorials are more than welcomed.

Thank you.

Yash
  • 2,259
  • 4
  • 26
  • 33

2 Answers2

2

Try starting by looking at ViewFlipper and taking a look at this tutorial on animating a ViewFlipper to get an idea of how something similar was accomplished.

Brian
  • 16,196
  • 3
  • 27
  • 28
0

If you would be implementing this slide behaviour within an android game, it would be much more efficient to utilize a game engine. Value being that it handles the slide animation for you and you can animating an entire game layer(populated with child elements) in a single line of codewould e.g layer.MoveTo(newPositionOutsideScreen). I recommend cocos2d for android and you can find a detailed tutorial on building a slider puzzle to help you get started ..

http://denvycom.com/blog/step-by-step-guide-on-how-to-build-your-first-slider-puzzle-game-in-cocos2d-for-android-part-1/

Vykthur D .
  • 351
  • 2
  • 7