add workaround for listview animations not working after clear()
This commit is contained in:
parent
17327f1457
commit
6b6f3db8c3
@ -47,6 +47,7 @@ import android.widget.TextView;
|
||||
import com.amulyakhare.textdrawable.TextDrawable;
|
||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.nhaarman.listviewanimations.appearance.AnimationAdapter;
|
||||
import com.nhaarman.listviewanimations.appearance.simple.SwingBottomInAnimationAdapter;
|
||||
import com.nostra13.universalimageloader.core.DisplayImageOptions;
|
||||
import com.nostra13.universalimageloader.core.ImageLoader;
|
||||
@ -90,6 +91,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
private SharedPreferences m_prefs;
|
||||
|
||||
private ArticleListAdapter m_adapter;
|
||||
private AnimationAdapter m_animationAdapter;
|
||||
private ArticleList m_articles = new ArticleList(); //GlobalState.getInstance().m_loadedArticles;
|
||||
//private ArticleList m_selectedArticles = new ArticleList();
|
||||
private ArticleList m_readArticles = new ArticleList();
|
||||
@ -377,10 +379,10 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
}
|
||||
|
||||
m_adapter = new ArticleListAdapter(getActivity(), R.layout.headlines_row, (ArrayList<Article>)m_articles);
|
||||
SwingBottomInAnimationAdapter animationAdapter = new SwingBottomInAnimationAdapter(m_adapter);
|
||||
m_animationAdapter = new SwingBottomInAnimationAdapter(m_adapter);
|
||||
|
||||
animationAdapter.setAbsListView(m_list);
|
||||
m_list.setAdapter(animationAdapter);
|
||||
m_animationAdapter.setAbsListView(m_list);
|
||||
m_list.setAdapter(m_animationAdapter);
|
||||
|
||||
m_list.setOnItemClickListener(this);
|
||||
m_list.setOnScrollListener(this);
|
||||
@ -481,7 +483,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
m_autoCatchupDisabled = true;
|
||||
m_list.setSelection(0);
|
||||
m_autoCatchupDisabled = false;
|
||||
//m_articles.clear();
|
||||
m_animationAdapter.reset();
|
||||
m_articles.clear();
|
||||
m_adapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user