mardi 2 septembre 2014

Android expand and contract animation on Layout


Vote count:

0




I have a normal Relative Layout with text view and progress bar.


Now, since i have a fixed width and height of the layout the text is properly placed in the center and looks good, onclick of layout we are changing the visibility of progress bar to "Visible", but since i have a fixed width the progress bar is on top of the text.


What i am trying to achieve is , onclick increase the right end width of the layout along with animation.


Here is my code :



<TextView
android:id="@+id/txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:text="click on this button"
android:textColor="#000000"
android:textSize="14sp" />

<ProgressBar
android:id="@+id/prgbar"
style="@android:style/Widget.ProgressBar.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="8dp"
android:visibility="visible" />
</RelativeLayout>


Screen shot of the layout :


enter image description here



asked 27 secs ago

Goofy

1,616






Android expand and contract animation on Layout

Aucun commentaire:

Enregistrer un commentaire