I am using a translate
animation:
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="-75%p"
android:toXDelta="0%p"
android:duration="1000" />
</set>
on a basic ImageView
. This animation will slide the image out from the left until it reaches the right edge of the screen. I have an OnClickListener
set on the ImageView
which toggles it from sliding out and in - works great.
Problem: It seems that the ImageView
is not actually moving it's coordinates, but it just looks like it's moving. When the ImageView
is only partly visible(waiting to be animated out into the screen), if I click on an area where the ImageView
would be if it were slid out, the animation starts(OnClickListener
is fired off).
I wasn't clicking on the ImageView
!
Question:
So, components with an animation such as this do not actually move?
How can I handle this onClick event, as it would be unexpected for an animation to occur when pressing on the screen where the ImageView
is not visible to the user?