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. Lack of onscreen keyboard

Hi Everyone,

I hope that I reach the developers on this one as it is very
important.  Upon reading the first review of the g1 I found out that
there is no onscreen keyboard. An onscreen keyboard is essential for
touchscreen smartphones. With out it you are inhibiting the phone's
potential. A qwerty keyboard is wonderful to use but what about when
you dont wish to use the keyboard and want to work on only the touch
screen. I and many others prefer to have both an on screen keyboard as
well as a physical keyboard based on our daily needs. For example if i
want to quickly text someone without using my keyboard i could simply
type a quick reply on my screen, rather than opening the keyboard to
say "ok."  I would rather pull my phone out of my pocket at the office
type quickly on the screen the small menial task i needed to do slide
it just as quick back in my pocket than open the phone all the way to
communicate with someone.
 And how about web browsing? It seems you can start to web browse with
the phone closed but to type in the address or put in key search
information, i would have to open up the phone.

I have 2 windows mobile phones that I use and one is a pc phone and I
love switching back and forth on its "keyboards."  For heavy texting,
emails webbrowsing I use the keyboard, when I dont wish to open my
phone up and type i use my on screen keyboard. This issue will come up
again and again as soon as the phone is released to the public. This
is along the same lines as the iphone not having the mms feature.
Something so small and benign yet so important to so many people.

Does anyone know if an onscreen keyboard app is coming soon and also
if a developer sees this would you please take my suggestion into
consideration?  There's already mild disappointment out there in
internet blogosphere that there is no onscreen keyboard. This mild
disappointment will turn into complaints.


2. Need advice for implementation "best practices" for multi-level game

I'm working on a multi-level game using the Lunar Lander example as my
"base". IOW, I'm using an activitiy with a view, and doing sprite

I can easily enough change the background image and work the sprites,
but I'm having a heck of a time figuring out how to handle the "in
between" pages. My game is sort of like a visual novel (Trauma Center
as one example) in that as you complete each level, I then want to
give a page or two of story explaining why you are going to the next
level, and explaining a bit about the new challenges on it.

My first (somewhat lame) attempt was to setup an AlertDialog. However,
doing the AlertDialog build using the mContext keeps causing my
application to "unexpectedly quit". Probably not the best way to do it

Should I be thinking of creating another activity and then go to it
for the couple pages of explanation each time and then come back? If
so, I presume I really want to prerender the page to be shown rather
than use strings in a text view (i.e. have a graphic with the text on
it)? Other suggestions?

Thanks in advance!


3. Few programming problems.

4. read IM Contacts

5. new Socket("", 2142)

6. Modifying Phone Information

7. Can I record an audio file via MediaRecorder on the simulator which based on android-sdk-windows-1.0_r1?