android - LinearLayout Animation behind other views -
i'm programming application in android, have problem animations. simplicate, have 3 "object" in horizontal linear layout (2 buttons @ extremities, , vertical linear layout in center want animate). problem when try move left, pass on button (and want behind). when try move right, pass behind button (like want).
in topic it's same problem think there no answer :( android animation behind other views
i have tried setzadjustment(animation.zorder_bottom)
animations doesn't change anything.
any idea ?
my java code quite simple :
layout_main= (linearlayout)this.findviewbyid(r.id.main_layout); movenext= animationutils.loadanimation(this, r.anim.move_next_seq); movenext.setzadjustment(animation.zorder_bottom); layout_main.startanimation(movenext);
and xml :
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" > <imagebutton android:id="@+id/button_previous" android:layout_width="@dimen/next_previous_button_width" android:layout_height="fill_parent" android:background="@drawable/button_classic" android:contentdescription="@string/button_previous_description" android:src="@android:drawable/ic_media_previous" /> <linearlayout android:id="@+id/main_layout" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:gravity="center_horizontal" android:orientation="vertical" >
</linearlayout> <imagebutton android:id="@+id/button_next" android:layout_width="@dimen/next_previous_button_width" android:layout_height="match_parent" android:background="@drawable/button_classic" android:contentdescription="@string/button_next_description" android:src="@android:drawable/ic_media_next" />
and animation :
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:fillafter="true" android:interpolator="@android:anim/linear_interpolator" > <set> <translate android:duration="300" android:fromxdelta="0%" android:startoffset="300" android:toxdelta="-100%" /> <translate android:duration="1" android:fromxdelta="-100%" android:startoffset="600" android:toxdelta="100%" /> <translate android:duration="400" android:fromxdelta="100%" android:startoffset="601" android:toxdelta="0%" /> </set>
Comments
Post a Comment