Перезагрузить ListView анимацию при смене курсора - PullRequest
3 голосов
/ 17 декабря 2011

У меня есть ListView с анимацией. Анимация хорошо воспроизводится при первой загрузке ListView. Я хочу, чтобы анимация воспроизводилась при смене курсора.

<ListView
    android:id="@android:id/list"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:cacheColorHint="@android:color/transparent"
    android:divider="@drawable/gradienthorizontal"
    android:dividerHeight="1px"
    android:layoutAnimation="@anim/layout_cascade"
    android:listSelector="@drawable/selector" >
</ListView>

Я меняю курсор здесь:

private void majCurseurListe(long id, boolean choixvente) {
    Cursor curseurPtVente = null;

    if (choixvente) {
        curseurPtVente = mDbHelper
                .listePtsVentes(DBhelper.TYPE_PTVENTE, id);
    } else {
        curseurPtVente = mDbHelper.listePtsVentes(DBhelper.TYPE_PTSERVICE,
                id);
    }

    // Android s'occupe du cycle de vie du curseur
    startManagingCursor(curseurPtVente);
    ((CursorAdapter) getListAdapter()).changeCursor(curseurPtVente);
}

1 Ответ

5 голосов
/ 17 декабря 2011

Просто вызвать

listView.startLayoutAnimation();
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...