I want to add animation to my game board when updating tile positions. I can start an animation at the right point, but there's a catch: When the translate animation starts, it seems like the animation is confined within the tile (button) or is just hidden behind another button. Instead, I want it to look like it is moving.

This is what happens:

actual scenario

This is what I want to happen:

desired scenario

Here's how I start the animations:

    Animation tile_up = AnimationUtils.loadAnimation(this, R.anim.tile_up);
    // This was a valid move. Add to moves and enable undo for this
    for(int i = 0; i < 5; i++)

Here's the animation spec (in res/anim/tile_up.xml):

    <?xml version="1.0" encoding="utf-8"?>

How can I fix this?


1 Answer 1


Okay, finally after 6-7 hours of searching through the internet i finally found the answer i was looking for. Since my layout is made up of nested LinearLayouts, I had to add a android:clipChildren="false" attribute to all my LinearLayouts(button parents).

Seems like the issue was the linear layouts didn't want to let it's childs outside to play. Which is understandable, and they're great parents none the less. But i had to make them let go. (Joking here)


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .