Страница 1 из 1

Анимация Item в listview

Добавлено: 30 янв 2013, 14:23
John
Всем привет, помогите разобраться. При открытии listview есть анимация item, которая перекрывает основной фон белым (системным цветом). По задумке анимироваться дожна только сама запись(String[]) item. Код прилагаю.

MainActivity

Код: Выделить всё

...
		setContentView(R.layout.customlist);
		setListAdapter(adapter);
		
		LayoutAnimationController controller = AnimationUtils
				.loadLayoutAnimation(this, R.anim.list_layout_controller);
		
		getListView().setLayoutAnimation(controller);
...
customlist.xml

Код: Выделить всё

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <ListView
        android:id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="@drawable/bg_page" />

    <TextView
        android:id="@android:id/empty"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</LinearLayout>


list_layout_controller.xml

Код: Выделить всё

<layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"
    android:animation="@anim/scale"
    android:delay="50%" 
    />
scale.xml

Код: Выделить всё

<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/accelerate_interpolator" >

    <scale
        android:duration="1000"
        android:fromXScale="0.1"
        android:fromYScale="0.1"
        android:pivotX="50%"
        android:pivotY="50%"
        android:startOffset="100"
        android:toXScale="1"
        android:toYScale="1.0"
         />

</set>