I want to set an animation for a ListView
for when a user scrolls the ListView
. I am setting an animation for ListView
when loading, b
Simple and fabulous animation on listview scrolling
@Override`
public View getView(final int i, View view, ViewGroup viewGroup) {
View converview = view;`
// other coding related to view
if (animateOrNot) { //boolean if want to animate
doCards(converview, i, prevPos);}
`prevPos=i; //take prevPos as global variable of int
return converview;
}`
public static void doCards(View view, int position, int prevPosition) {
view.setScaleX(0.5f);
if (position > prevPosition) {
view.setRotationX(90);
} else {
view.setRotationX(-90);
}
view.animate().rotationX(0).scaleX(1.0f).start();
}