1

How do I fade in windows/Activities from white? And how do I fade out to white? Showld I use an Animation? And if so ... How do I do that?

Thank you for your time and help.

stanete
  • 4,062
  • 9
  • 21
  • 30

1 Answers1

2

I would use:

  • A relative layout that contains:
    • The real content of your activity
    • An overlay view, with white background, matching parent widht and height.
  • And animation that changes the alpha of the overlay to transparent or to solid, as you need.
  • If you have problems receiving touch and dont get to get crazy animation listener to remove the view as soon as its alfa is cero.
Carlos Robles
  • 10,828
  • 3
  • 41
  • 60
  • What about overriding the pending transitions between the activities? It should give more granularity giving the control on the time between one and another... – Simone Casagranda Jan 14 '14 at 22:39
  • 1
    yeah, that could be nice, but he didn't say that the fade is when an activity is started (and actually there are some solutions around on how to do that, like this one (http://stackoverflow.com/questions/18475826/fade-in-animation-on-activity-transition), so i assume that is not what he wants, so i'm giving a more generic solution :) – Carlos Robles Jan 14 '14 at 22:43
  • Thank you!! It was helpfull. I used the same for fade in and out. – stanete Jan 24 '14 at 16:55