Lo que hago es configurar la animación en convertview y luego detengo la animación en cada convertview. De esta forma, la animación se detiene y luego se reproduce si la vista de conversión es nueva y continúa hasta el final si no se recicla antes de que finalice.
Editar Parece que no puedo encontrar un ejemplo, por lo que será en parte pseudocódigo.
En su adaptador Vas a tener algo parecido a lo siguiente:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final ViewHolder holder;
if(convertView == null) {
// setup holder
holder = new ViewHolder();
LayoutInflater Inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = Inflater.inflate(mResourceId, null);
holder.image = (ImageView) convertView.findViewById(R.id.row_image);
holder.headline = (TextView) convertView.findViewById(R.id.row_headline);
convertView.setTag(holder);
} else {
// get existing row view
holder = (ViewHolder) convertView.getTag();
}
// GetView is only called on new items
// so now we stop the previous animation and start a new
holder.animation.stop(); // First you stop the animation
holder.animation = new animation(); // then you create new
holder.animation.start(); // then you start the animation.
le puede facilitar las cosas código de ejemplo? –
@ AshrafSayied-Ahmad He añadido un pequeño ejemplo, no es perfecto, pero lo entiendes. – Warpzit