9

I'm trying to get a view to "slide behind" another view. Consider a set of cards as an example: if I put card A behind card B, card A is still there but it is being blocked because card B is OVER or IN-FRONT-OF card A.

I am well aware of setInvisibilty() but that is not the effect I'm looking for.

I have an animation that animates a Google-Now-card-like view onto the screen. The card passes over some text that is shown in front of the card (whereas I want the card to slide above the text) during the animation. I have an alpha animation on the text which does not help as it's already pretty solid by the time the card passes over.

Any response to the problem above or suggestions for a different method are highly appreciated.

sjbhalli
  • 317
  • 3
  • 10
  • 1
    http://stackoverflow.com/questions/2614393/defining-z-order-of-views-of-relativelayout-in-android Maybe this will help you, View.bringToFront() ? – Rogue Dec 23 '14 at 16:04
  • @Rogue Wow, I don't know how I missed that one. That's perfect. Can you put that as an answer so I can accept it. – sjbhalli Dec 23 '14 at 16:09

1 Answers1

9

See this previous question : Defining Z order of views of RelativeLayout in Android

View.bringToFront()

Is what you're looking for.

Community
  • 1
  • 1
Rogue
  • 751
  • 1
  • 17
  • 36