Kindda's unusual situation ...
I have an ImageView that click interaction is associated with.
In code, I reposition ImageView through animation.
But when the animation ends, the clickable area is still in the original ImageView location (I can actually click this area and see how the click is processed).
Was there some kind of research, it seems that the animation only moves the pixels of the view, the view remains where it was originally.
As a bit of criticism for Android, this is not an intuitive design / implementation. This does not correspond to "What you see, what you get . "
And my question
is there any way (other than switching between two different ImageViews) to make the moved area move to where the pixels of the view are?
My layout structures and animation animations are as follows.
location:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/keywords_layer" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_margin="0dp" android:padding="0dp" android:orientation="vertical" android:visibility="gone" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="35dp" > <ImageView android:layout_width="fill_parent" android:layout_height="35dp" android:layout_centerInParent="true" android:adjustViewBounds="false" android:scaleType="fitXY" android:src="@drawable/keyword_bar_handle" /> <ImageView android:id="@+id/bar_handle" android:layout_width="45dp" android:layout_height="fill_parent" android:layout_alignParentRight="true" android:adjustViewBounds="false" android:scaleType="fitXY" /> </RelativeLayout> <HorizontalScrollView android:layout_width="fill_parent" android:layout_height="@dimen/browser_address_bar_1_5_height" android:layout_margin="0dp" android:padding="0dp" android:background="@drawable/keyword_bar_bg" android:scrollbars="none" > <LinearLayout android:layout_width="wrap_content" android:layout_height="@dimen/browser_address_bar_1_5_height" android:layout_margin="0dp" android:padding="0dp" /> </HorizontalScrollView>
Animation:
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator" android:fillEnabled="true" android:fillAfter="true"> <translate android:fromYDelta="60" android:toYDelta="0" android:duration="300" /> </set>
Here the layout is aligned to the bottom of the screen and should be smoothly switched - hidden or shown. "bar_handle" ImageView handles the switch. "bar_handle" is inside the animated structure, so it moves with it.
Thanks for any help.
source share