Animation on a view doesn't 'stick' in reality

by fg1921 » Fri, 10 Apr 2009 07:38:05 GMT

Sponsored Links

I'm using a TranslateAnimation to slide a ViewGroup in and out of
screen. However after the animation slides the view out, the
transparent view is still 'clickable' in the same place. I used
setFillAfter to TRUE thinking that the animation would 'stick' but I
can't seem to get the view out of my 'face'.

Any way to do this without setting up an animation completion handler
and then hide the view explicitly?

Animation on a view doesn't 'stick' in reality

by fg1921 » Fri, 10 Apr 2009 08:21:16 GMT


Thanks Romain - I did this (and the completion listener) neither of
these work. Basically the 'AbsoluteLayout' ViewGroup slides out of the
screen but then when you tap on the are where that view once was, the
old buttons apparently still get tapped (eventhough completely
invisible). If I've 'translated' a view, shouldn't it stay where it is
and not get the kind of focus/clicks it's getting right now? I tried
setEnabled(false), setVisibility(View.GONE) -- nothing seems to work.
The 'invisible' view still gets touch events and buttons are being
pressed from the view that got slid away.

Am I doing something wrong?

Sponsored Links

Animation on a view doesn't 'stick' in reality

by fg1921 » Fri, 10 Apr 2009 08:33:39 GMT

 Okay I've figured it out. I would personally consider this a bug but
not sure if this is how it's meant to be.

Basically in onAnimationEnd I had to loop over all children inside the
viewgroup (and children of children) and set their visibility to GONE/
INVISIBLE and the buttons stopped getting touch events after animation
ended. And then onAnimationStart I had to set their visibility back to

Shouldn't setting visibility/focusability/enabled state etc on the
parent ViewGroup apply these down to its children as well (especially
the visibility part). Since the parent view became invisible, which is
fine, but the children view didn't (well internally) and thus were
intercepting Touch events eventhough the view as a whole was not

Other Threads

1. Dynamically adding view in layout xml in android

Hi All,

              I have created a xml layout which includes ImageButtons in
row,col format.So,layout having some initial number of views.Now,I want to
add extra views at run time i.e through code.Is it possible? How to do it?



2. Custom Kernel developement for Android Emulator


I like to build my own custom kernel to use with the Android Emulator.
I know how to build my own Android Emulator image and how to set the
kernel that you want use when booting the emulator. But I have no idea
how to build a custom kernel for the emulator and what should be in
there to keep the emulator working.

Does anyone has some starting point for me or some documentation?


3. figure out country in a device without SIM card

4. Android Native Code: remote()

5. live wallpaper as background of our application?

6. The purpose of resource name "mipmap"?!

7. Preparing an app for the small screen.