There are actually two types of animations you are talking about here:

- View animations are like the one in the calculator switching panels.
These happen entirely within the view hierarchy of your app, and must have
been started by your app, so you can just poke anything related to the
animation in your view hierarchy to see what is going on, including the
Animation object itself.

- Window animations are like the soft keyboard animation.  There are
performed entirely by the window manager, purely through moving window
surfaces around, and so are not directly accessible to you.  The only
information you have about them is any impact the relayout of the windows
has on your app, such as the keyboard causing your view hierarchy to resize,
and this is not done as an animation but as a single update giving you the
ultimately final new layout (whether this happens at the start or end of the
animation depends on how the window manager wants to do this to try to best
keep the screen looking nice).

There is a small final thing that can happen, for non-resizeable windows,
when the IME is shown and the window is given the update to account for it,
internally the window will scroll itself into place instead of jumping.
There is very little visibility you have into this, though, except for
repeated draws of the view hierarchy (at the same location since it is just
offsetting your drawing).

On Tue, Jul 14, 2009 at 9:26 AM, Sam <sam.quir...@windriver.com> wrote:

>
> How can we detect that an animation is currently going on?  An example
> would be in the calculator app when you click on the "advanced panel"
> menu, a new keyboard slides (animates) into place.  As soon as you
> click a key on this keyboard, it slides (animate) back out of view.
> We have not found a way programmatically to detect either that an
> animation is underway or that it has finished.  Another example is
> when you click in an EditText view causing the soft keyboard to slide
> (animate) into view and possibly push up (animate) the EditText view.
>
> We see there are flag settings, ANIMATION_STARTED and DRAW_ANIMATION,
> for View.mPrivateFlags.  But in situations where we dump the views
> while we know an animation is going on, we have never seen these flags
> set for the views that we think are moving as part of an animation.
> Should they be?  Are there other flags or other values we should be
> examining to detect animations?
>
> Our goal, for example, is to programmatically click an EditText box
> and then be able to repeatedly examine the views to find out "has the
> soft keyboard finished it's animation into place?"
>
> We've tried putting in delays, but the delay time required is a
> function of the load on the computer running the phone/emulator.
>
> -Sam
>
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to