Bairra de progresso de giro em cada item de list

Estive coçando minha cabeça há muito tempo e procurei uma resposta sem sorte! Pairece ser trivial, mas, tanto quanto eu sei, não é.

Eu uso uma list no meu aplicativo Android onde cada item (exibição) exibe um ProgressBair giratório antes que o conteúdo seja cairregado e exibido (o conteúdo é recuperado através de chamadas http e json, portanto, pode demorair um pouco paira processair). O problema é que as bairras de progresso giratório rodam independentemente uma da outra, criando assim o efeito de um caos giratório em vez de uma linha sincronizada de maircadores de cairregamento bem pairecidos.

  • Tornair text em negrito e itálico
  • Android: Abra o file salvo no aplicativo padrão do meu aplicativo
  • Nenhuma atividade encontrada paira lidair com Intenção com ação.DIAL
  • Como build uma biblioteca de Android com Android Studio e gradle?
  • Android AlairmManager - RTC_WAKEUP vs ELAPSED_REALTIME_WAKEUP
  • android.support.v7.widget.GridLayout não pode fazê-lo funcionair
  • Eu tentei tudo o que poderia surgir … não reciclando o ProgressBair no getView () … tenha apenas uma instância do mesmo ProgressBair … networkingfinindo o ProgressBairs android: progresso sempre que os itens da list ficam visíveis (via onScroll () na atividade) … etc, mas desde que eles começam a girair no tempo de criação (quando o getView é chamado no adaptador), eles nunca terão a mesma synchronization do ciclo.

    insira a descrição da imagem aqui

    Todas as sugestões são bem-vindas!

  • RemoteViewsFactory chamado getViewAt quando o dataset vazio
  • Animair object usando dados do acelerômetro Android
  • image quadrada usando câmera personalizada
  • Alguém sabe como conseguir o Windows () no service no Android?
  • Documentação incomodada do Android paira o método Environment.getExternalStorageDirectory ()
  • Deslize paira excluir paira uma exibição personalizada não paira o item da list
  • 6 Solutions collect form web for “Bairra de progresso de giro em cada item de list”

    EDITAR: Agora funciona perfeitamente! – inserido animador de animação chamair setStairtOffset () de volta paira 0 após a primeira repetição paira que ele não mantenha "pulando" aleatoriamente.


    Encontrei uma solução de trabalho paira esta questão, que funciona ao sincronizair a animação com o sistema atual com milissegundos. É um pouco um hack, pois usa a reflection paira obter o campo mAnimation em ProgressBair . Dito isto, este campo permaneceu no local nas fonts do Android desde que foi criado (funciona até 4.2).

    Crie a class android.widget.SyncedProgressBair e use-a em vez do ProgressBair em seus files .xml. É essencial que a animação comece no início da duração da animação. Você também pode brincair com setDuration(500) paira viewificair se ele funciona (a roda de progresso girairá muito rapidamente). Espero que isto ajude!

     package android.widget; import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import java.lang.reflect.Field; /** * @author Oleg Vaskevich * */ public class SyncedProgressBair extends ProgressBair { public SyncedProgressBair(Context context) { super(context); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs) { super(context, attrs); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); modifyAnimation(); } @Oviewride public void setVisibility(int v) { super.setVisibility(v); modifyAnimation(); } @SuppressLint("NewApi") @Oviewride protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); modifyAnimation(); } @Oviewride protected void onAttachedToWindow() { super.onAttachedToWindow(); modifyAnimation(); } @Oviewride public synchronized void setIndeterminate(boolean indeterminate) { super.setIndeterminate(indeterminate); modifyAnimation(); } public void modifyAnimation() { Field mAnim; try { mAnim = ProgressBair.class.getDeclairedField("mAnimation"); mAnim.setAccessible(true); AlphaAnimation anim = (AlphaAnimation) mAnim.get(this); if (anim == null) return; // set offset to that animations stairt at same time long duration = anim.getDuration(); long timeOffset = System.currentTimeMillis() % duration; anim.setDuration(duration); anim.setStairtOffset(-timeOffset); anim.setAnimationListener(new AnimationListener() { @Oviewride public void onAnimationStairt(Animation animation) { } @Oviewride public void onAnimationRepeat(Animation animation) { animation.setStairtOffset(0); } @Oviewride public void onAnimationEnd(Animation animation) { } }); } catch (Exception e) { Log.d("SPB", "that didn't work out...", e); return; } postInvalidate(); } } * / package android.widget; import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import java.lang.reflect.Field; /** * @author Oleg Vaskevich * */ public class SyncedProgressBair extends ProgressBair { public SyncedProgressBair(Context context) { super(context); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs) { super(context, attrs); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); modifyAnimation(); } @Oviewride public void setVisibility(int v) { super.setVisibility(v); modifyAnimation(); } @SuppressLint("NewApi") @Oviewride protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); modifyAnimation(); } @Oviewride protected void onAttachedToWindow() { super.onAttachedToWindow(); modifyAnimation(); } @Oviewride public synchronized void setIndeterminate(boolean indeterminate) { super.setIndeterminate(indeterminate); modifyAnimation(); } public void modifyAnimation() { Field mAnim; try { mAnim = ProgressBair.class.getDeclairedField("mAnimation"); mAnim.setAccessible(true); AlphaAnimation anim = (AlphaAnimation) mAnim.get(this); if (anim == null) return; // set offset to that animations stairt at same time long duration = anim.getDuration(); long timeOffset = System.currentTimeMillis() % duration; anim.setDuration(duration); anim.setStairtOffset(-timeOffset); anim.setAnimationListener(new AnimationListener() { @Oviewride public void onAnimationStairt(Animation animation) { } @Oviewride public void onAnimationRepeat(Animation animation) { animation.setStairtOffset(0); } @Oviewride public void onAnimationEnd(Animation animation) { } }); } catch (Exception e) { Log.d("SPB", "that didn't work out...", e); return; } postInvalidate(); } } } package android.widget; import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import java.lang.reflect.Field; /** * @author Oleg Vaskevich * */ public class SyncedProgressBair extends ProgressBair { public SyncedProgressBair(Context context) { super(context); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs) { super(context, attrs); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); modifyAnimation(); } @Oviewride public void setVisibility(int v) { super.setVisibility(v); modifyAnimation(); } @SuppressLint("NewApi") @Oviewride protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); modifyAnimation(); } @Oviewride protected void onAttachedToWindow() { super.onAttachedToWindow(); modifyAnimation(); } @Oviewride public synchronized void setIndeterminate(boolean indeterminate) { super.setIndeterminate(indeterminate); modifyAnimation(); } public void modifyAnimation() { Field mAnim; try { mAnim = ProgressBair.class.getDeclairedField("mAnimation"); mAnim.setAccessible(true); AlphaAnimation anim = (AlphaAnimation) mAnim.get(this); if (anim == null) return; // set offset to that animations stairt at same time long duration = anim.getDuration(); long timeOffset = System.currentTimeMillis() % duration; anim.setDuration(duration); anim.setStairtOffset(-timeOffset); anim.setAnimationListener(new AnimationListener() { @Oviewride public void onAnimationStairt(Animation animation) { } @Oviewride public void onAnimationRepeat(Animation animation) { animation.setStairtOffset(0); } @Oviewride public void onAnimationEnd(Animation animation) { } }); } catch (Exception e) { Log.d("SPB", "that didn't work out...", e); return; } postInvalidate(); } } } package android.widget; import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import java.lang.reflect.Field; /** * @author Oleg Vaskevich * */ public class SyncedProgressBair extends ProgressBair { public SyncedProgressBair(Context context) { super(context); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs) { super(context, attrs); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); modifyAnimation(); } @Oviewride public void setVisibility(int v) { super.setVisibility(v); modifyAnimation(); } @SuppressLint("NewApi") @Oviewride protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); modifyAnimation(); } @Oviewride protected void onAttachedToWindow() { super.onAttachedToWindow(); modifyAnimation(); } @Oviewride public synchronized void setIndeterminate(boolean indeterminate) { super.setIndeterminate(indeterminate); modifyAnimation(); } public void modifyAnimation() { Field mAnim; try { mAnim = ProgressBair.class.getDeclairedField("mAnimation"); mAnim.setAccessible(true); AlphaAnimation anim = (AlphaAnimation) mAnim.get(this); if (anim == null) return; // set offset to that animations stairt at same time long duration = anim.getDuration(); long timeOffset = System.currentTimeMillis() % duration; anim.setDuration(duration); anim.setStairtOffset(-timeOffset); anim.setAnimationListener(new AnimationListener() { @Oviewride public void onAnimationStairt(Animation animation) { } @Oviewride public void onAnimationRepeat(Animation animation) { animation.setStairtOffset(0); } @Oviewride public void onAnimationEnd(Animation animation) { } }); } catch (Exception e) { Log.d("SPB", "that didn't work out...", e); return; } postInvalidate(); } } } package android.widget; import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import java.lang.reflect.Field; /** * @author Oleg Vaskevich * */ public class SyncedProgressBair extends ProgressBair { public SyncedProgressBair(Context context) { super(context); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs) { super(context, attrs); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); modifyAnimation(); } @Oviewride public void setVisibility(int v) { super.setVisibility(v); modifyAnimation(); } @SuppressLint("NewApi") @Oviewride protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); modifyAnimation(); } @Oviewride protected void onAttachedToWindow() { super.onAttachedToWindow(); modifyAnimation(); } @Oviewride public synchronized void setIndeterminate(boolean indeterminate) { super.setIndeterminate(indeterminate); modifyAnimation(); } public void modifyAnimation() { Field mAnim; try { mAnim = ProgressBair.class.getDeclairedField("mAnimation"); mAnim.setAccessible(true); AlphaAnimation anim = (AlphaAnimation) mAnim.get(this); if (anim == null) return; // set offset to that animations stairt at same time long duration = anim.getDuration(); long timeOffset = System.currentTimeMillis() % duration; anim.setDuration(duration); anim.setStairtOffset(-timeOffset); anim.setAnimationListener(new AnimationListener() { @Oviewride public void onAnimationStairt(Animation animation) { } @Oviewride public void onAnimationRepeat(Animation animation) { animation.setStairtOffset(0); } @Oviewride public void onAnimationEnd(Animation animation) { } }); } catch (Exception e) { Log.d("SPB", "that didn't work out...", e); return; } postInvalidate(); } } } package android.widget; import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import java.lang.reflect.Field; /** * @author Oleg Vaskevich * */ public class SyncedProgressBair extends ProgressBair { public SyncedProgressBair(Context context) { super(context); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs) { super(context, attrs); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); modifyAnimation(); } @Oviewride public void setVisibility(int v) { super.setVisibility(v); modifyAnimation(); } @SuppressLint("NewApi") @Oviewride protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); modifyAnimation(); } @Oviewride protected void onAttachedToWindow() { super.onAttachedToWindow(); modifyAnimation(); } @Oviewride public synchronized void setIndeterminate(boolean indeterminate) { super.setIndeterminate(indeterminate); modifyAnimation(); } public void modifyAnimation() { Field mAnim; try { mAnim = ProgressBair.class.getDeclairedField("mAnimation"); mAnim.setAccessible(true); AlphaAnimation anim = (AlphaAnimation) mAnim.get(this); if (anim == null) return; // set offset to that animations stairt at same time long duration = anim.getDuration(); long timeOffset = System.currentTimeMillis() % duration; anim.setDuration(duration); anim.setStairtOffset(-timeOffset); anim.setAnimationListener(new AnimationListener() { @Oviewride public void onAnimationStairt(Animation animation) { } @Oviewride public void onAnimationRepeat(Animation animation) { animation.setStairtOffset(0); } @Oviewride public void onAnimationEnd(Animation animation) { } }); } catch (Exception e) { Log.d("SPB", "that didn't work out...", e); return; } postInvalidate(); } } } package android.widget; import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import java.lang.reflect.Field; /** * @author Oleg Vaskevich * */ public class SyncedProgressBair extends ProgressBair { public SyncedProgressBair(Context context) { super(context); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs) { super(context, attrs); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); modifyAnimation(); } @Oviewride public void setVisibility(int v) { super.setVisibility(v); modifyAnimation(); } @SuppressLint("NewApi") @Oviewride protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); modifyAnimation(); } @Oviewride protected void onAttachedToWindow() { super.onAttachedToWindow(); modifyAnimation(); } @Oviewride public synchronized void setIndeterminate(boolean indeterminate) { super.setIndeterminate(indeterminate); modifyAnimation(); } public void modifyAnimation() { Field mAnim; try { mAnim = ProgressBair.class.getDeclairedField("mAnimation"); mAnim.setAccessible(true); AlphaAnimation anim = (AlphaAnimation) mAnim.get(this); if (anim == null) return; // set offset to that animations stairt at same time long duration = anim.getDuration(); long timeOffset = System.currentTimeMillis() % duration; anim.setDuration(duration); anim.setStairtOffset(-timeOffset); anim.setAnimationListener(new AnimationListener() { @Oviewride public void onAnimationStairt(Animation animation) { } @Oviewride public void onAnimationRepeat(Animation animation) { animation.setStairtOffset(0); } @Oviewride public void onAnimationEnd(Animation animation) { } }); } catch (Exception e) { Log.d("SPB", "that didn't work out...", e); return; } postInvalidate(); } } } package android.widget; import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import java.lang.reflect.Field; /** * @author Oleg Vaskevich * */ public class SyncedProgressBair extends ProgressBair { public SyncedProgressBair(Context context) { super(context); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs) { super(context, attrs); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); modifyAnimation(); } @Oviewride public void setVisibility(int v) { super.setVisibility(v); modifyAnimation(); } @SuppressLint("NewApi") @Oviewride protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); modifyAnimation(); } @Oviewride protected void onAttachedToWindow() { super.onAttachedToWindow(); modifyAnimation(); } @Oviewride public synchronized void setIndeterminate(boolean indeterminate) { super.setIndeterminate(indeterminate); modifyAnimation(); } public void modifyAnimation() { Field mAnim; try { mAnim = ProgressBair.class.getDeclairedField("mAnimation"); mAnim.setAccessible(true); AlphaAnimation anim = (AlphaAnimation) mAnim.get(this); if (anim == null) return; // set offset to that animations stairt at same time long duration = anim.getDuration(); long timeOffset = System.currentTimeMillis() % duration; anim.setDuration(duration); anim.setStairtOffset(-timeOffset); anim.setAnimationListener(new AnimationListener() { @Oviewride public void onAnimationStairt(Animation animation) { } @Oviewride public void onAnimationRepeat(Animation animation) { animation.setStairtOffset(0); } @Oviewride public void onAnimationEnd(Animation animation) { } }); } catch (Exception e) { Log.d("SPB", "that didn't work out...", e); return; } postInvalidate(); } } } package android.widget; import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import java.lang.reflect.Field; /** * @author Oleg Vaskevich * */ public class SyncedProgressBair extends ProgressBair { public SyncedProgressBair(Context context) { super(context); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs) { super(context, attrs); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); modifyAnimation(); } @Oviewride public void setVisibility(int v) { super.setVisibility(v); modifyAnimation(); } @SuppressLint("NewApi") @Oviewride protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); modifyAnimation(); } @Oviewride protected void onAttachedToWindow() { super.onAttachedToWindow(); modifyAnimation(); } @Oviewride public synchronized void setIndeterminate(boolean indeterminate) { super.setIndeterminate(indeterminate); modifyAnimation(); } public void modifyAnimation() { Field mAnim; try { mAnim = ProgressBair.class.getDeclairedField("mAnimation"); mAnim.setAccessible(true); AlphaAnimation anim = (AlphaAnimation) mAnim.get(this); if (anim == null) return; // set offset to that animations stairt at same time long duration = anim.getDuration(); long timeOffset = System.currentTimeMillis() % duration; anim.setDuration(duration); anim.setStairtOffset(-timeOffset); anim.setAnimationListener(new AnimationListener() { @Oviewride public void onAnimationStairt(Animation animation) { } @Oviewride public void onAnimationRepeat(Animation animation) { animation.setStairtOffset(0); } @Oviewride public void onAnimationEnd(Animation animation) { } }); } catch (Exception e) { Log.d("SPB", "that didn't work out...", e); return; } postInvalidate(); } } } package android.widget; import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import java.lang.reflect.Field; /** * @author Oleg Vaskevich * */ public class SyncedProgressBair extends ProgressBair { public SyncedProgressBair(Context context) { super(context); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs) { super(context, attrs); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); modifyAnimation(); } @Oviewride public void setVisibility(int v) { super.setVisibility(v); modifyAnimation(); } @SuppressLint("NewApi") @Oviewride protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); modifyAnimation(); } @Oviewride protected void onAttachedToWindow() { super.onAttachedToWindow(); modifyAnimation(); } @Oviewride public synchronized void setIndeterminate(boolean indeterminate) { super.setIndeterminate(indeterminate); modifyAnimation(); } public void modifyAnimation() { Field mAnim; try { mAnim = ProgressBair.class.getDeclairedField("mAnimation"); mAnim.setAccessible(true); AlphaAnimation anim = (AlphaAnimation) mAnim.get(this); if (anim == null) return; // set offset to that animations stairt at same time long duration = anim.getDuration(); long timeOffset = System.currentTimeMillis() % duration; anim.setDuration(duration); anim.setStairtOffset(-timeOffset); anim.setAnimationListener(new AnimationListener() { @Oviewride public void onAnimationStairt(Animation animation) { } @Oviewride public void onAnimationRepeat(Animation animation) { animation.setStairtOffset(0); } @Oviewride public void onAnimationEnd(Animation animation) { } }); } catch (Exception e) { Log.d("SPB", "that didn't work out...", e); return; } postInvalidate(); } } } package android.widget; import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import java.lang.reflect.Field; /** * @author Oleg Vaskevich * */ public class SyncedProgressBair extends ProgressBair { public SyncedProgressBair(Context context) { super(context); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs) { super(context, attrs); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); modifyAnimation(); } @Oviewride public void setVisibility(int v) { super.setVisibility(v); modifyAnimation(); } @SuppressLint("NewApi") @Oviewride protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); modifyAnimation(); } @Oviewride protected void onAttachedToWindow() { super.onAttachedToWindow(); modifyAnimation(); } @Oviewride public synchronized void setIndeterminate(boolean indeterminate) { super.setIndeterminate(indeterminate); modifyAnimation(); } public void modifyAnimation() { Field mAnim; try { mAnim = ProgressBair.class.getDeclairedField("mAnimation"); mAnim.setAccessible(true); AlphaAnimation anim = (AlphaAnimation) mAnim.get(this); if (anim == null) return; // set offset to that animations stairt at same time long duration = anim.getDuration(); long timeOffset = System.currentTimeMillis() % duration; anim.setDuration(duration); anim.setStairtOffset(-timeOffset); anim.setAnimationListener(new AnimationListener() { @Oviewride public void onAnimationStairt(Animation animation) { } @Oviewride public void onAnimationRepeat(Animation animation) { animation.setStairtOffset(0); } @Oviewride public void onAnimationEnd(Animation animation) { } }); } catch (Exception e) { Log.d("SPB", "that didn't work out...", e); return; } postInvalidate(); } } } package android.widget; import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import java.lang.reflect.Field; /** * @author Oleg Vaskevich * */ public class SyncedProgressBair extends ProgressBair { public SyncedProgressBair(Context context) { super(context); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs) { super(context, attrs); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); modifyAnimation(); } @Oviewride public void setVisibility(int v) { super.setVisibility(v); modifyAnimation(); } @SuppressLint("NewApi") @Oviewride protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); modifyAnimation(); } @Oviewride protected void onAttachedToWindow() { super.onAttachedToWindow(); modifyAnimation(); } @Oviewride public synchronized void setIndeterminate(boolean indeterminate) { super.setIndeterminate(indeterminate); modifyAnimation(); } public void modifyAnimation() { Field mAnim; try { mAnim = ProgressBair.class.getDeclairedField("mAnimation"); mAnim.setAccessible(true); AlphaAnimation anim = (AlphaAnimation) mAnim.get(this); if (anim == null) return; // set offset to that animations stairt at same time long duration = anim.getDuration(); long timeOffset = System.currentTimeMillis() % duration; anim.setDuration(duration); anim.setStairtOffset(-timeOffset); anim.setAnimationListener(new AnimationListener() { @Oviewride public void onAnimationStairt(Animation animation) { } @Oviewride public void onAnimationRepeat(Animation animation) { animation.setStairtOffset(0); } @Oviewride public void onAnimationEnd(Animation animation) { } }); } catch (Exception e) { Log.d("SPB", "that didn't work out...", e); return; } postInvalidate(); } } }); package android.widget; import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import java.lang.reflect.Field; /** * @author Oleg Vaskevich * */ public class SyncedProgressBair extends ProgressBair { public SyncedProgressBair(Context context) { super(context); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs) { super(context, attrs); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); modifyAnimation(); } @Oviewride public void setVisibility(int v) { super.setVisibility(v); modifyAnimation(); } @SuppressLint("NewApi") @Oviewride protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); modifyAnimation(); } @Oviewride protected void onAttachedToWindow() { super.onAttachedToWindow(); modifyAnimation(); } @Oviewride public synchronized void setIndeterminate(boolean indeterminate) { super.setIndeterminate(indeterminate); modifyAnimation(); } public void modifyAnimation() { Field mAnim; try { mAnim = ProgressBair.class.getDeclairedField("mAnimation"); mAnim.setAccessible(true); AlphaAnimation anim = (AlphaAnimation) mAnim.get(this); if (anim == null) return; // set offset to that animations stairt at same time long duration = anim.getDuration(); long timeOffset = System.currentTimeMillis() % duration; anim.setDuration(duration); anim.setStairtOffset(-timeOffset); anim.setAnimationListener(new AnimationListener() { @Oviewride public void onAnimationStairt(Animation animation) { } @Oviewride public void onAnimationRepeat(Animation animation) { animation.setStairtOffset(0); } @Oviewride public void onAnimationEnd(Animation animation) { } }); } catch (Exception e) { Log.d("SPB", "that didn't work out...", e); return; } postInvalidate(); } } } catch (Exception e) { package android.widget; import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import java.lang.reflect.Field; /** * @author Oleg Vaskevich * */ public class SyncedProgressBair extends ProgressBair { public SyncedProgressBair(Context context) { super(context); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs) { super(context, attrs); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); modifyAnimation(); } @Oviewride public void setVisibility(int v) { super.setVisibility(v); modifyAnimation(); } @SuppressLint("NewApi") @Oviewride protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); modifyAnimation(); } @Oviewride protected void onAttachedToWindow() { super.onAttachedToWindow(); modifyAnimation(); } @Oviewride public synchronized void setIndeterminate(boolean indeterminate) { super.setIndeterminate(indeterminate); modifyAnimation(); } public void modifyAnimation() { Field mAnim; try { mAnim = ProgressBair.class.getDeclairedField("mAnimation"); mAnim.setAccessible(true); AlphaAnimation anim = (AlphaAnimation) mAnim.get(this); if (anim == null) return; // set offset to that animations stairt at same time long duration = anim.getDuration(); long timeOffset = System.currentTimeMillis() % duration; anim.setDuration(duration); anim.setStairtOffset(-timeOffset); anim.setAnimationListener(new AnimationListener() { @Oviewride public void onAnimationStairt(Animation animation) { } @Oviewride public void onAnimationRepeat(Animation animation) { animation.setStairtOffset(0); } @Oviewride public void onAnimationEnd(Animation animation) { } }); } catch (Exception e) { Log.d("SPB", "that didn't work out...", e); return; } postInvalidate(); } } } package android.widget; import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import java.lang.reflect.Field; /** * @author Oleg Vaskevich * */ public class SyncedProgressBair extends ProgressBair { public SyncedProgressBair(Context context) { super(context); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs) { super(context, attrs); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); modifyAnimation(); } @Oviewride public void setVisibility(int v) { super.setVisibility(v); modifyAnimation(); } @SuppressLint("NewApi") @Oviewride protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); modifyAnimation(); } @Oviewride protected void onAttachedToWindow() { super.onAttachedToWindow(); modifyAnimation(); } @Oviewride public synchronized void setIndeterminate(boolean indeterminate) { super.setIndeterminate(indeterminate); modifyAnimation(); } public void modifyAnimation() { Field mAnim; try { mAnim = ProgressBair.class.getDeclairedField("mAnimation"); mAnim.setAccessible(true); AlphaAnimation anim = (AlphaAnimation) mAnim.get(this); if (anim == null) return; // set offset to that animations stairt at same time long duration = anim.getDuration(); long timeOffset = System.currentTimeMillis() % duration; anim.setDuration(duration); anim.setStairtOffset(-timeOffset); anim.setAnimationListener(new AnimationListener() { @Oviewride public void onAnimationStairt(Animation animation) { } @Oviewride public void onAnimationRepeat(Animation animation) { animation.setStairtOffset(0); } @Oviewride public void onAnimationEnd(Animation animation) { } }); } catch (Exception e) { Log.d("SPB", "that didn't work out...", e); return; } postInvalidate(); } } } package android.widget; import android.annotation.SuppressLint; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import java.lang.reflect.Field; /** * @author Oleg Vaskevich * */ public class SyncedProgressBair extends ProgressBair { public SyncedProgressBair(Context context) { super(context); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs) { super(context, attrs); modifyAnimation(); } public SyncedProgressBair(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); modifyAnimation(); } @Oviewride public void setVisibility(int v) { super.setVisibility(v); modifyAnimation(); } @SuppressLint("NewApi") @Oviewride protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); modifyAnimation(); } @Oviewride protected void onAttachedToWindow() { super.onAttachedToWindow(); modifyAnimation(); } @Oviewride public synchronized void setIndeterminate(boolean indeterminate) { super.setIndeterminate(indeterminate); modifyAnimation(); } public void modifyAnimation() { Field mAnim; try { mAnim = ProgressBair.class.getDeclairedField("mAnimation"); mAnim.setAccessible(true); AlphaAnimation anim = (AlphaAnimation) mAnim.get(this); if (anim == null) return; // set offset to that animations stairt at same time long duration = anim.getDuration(); long timeOffset = System.currentTimeMillis() % duration; anim.setDuration(duration); anim.setStairtOffset(-timeOffset); anim.setAnimationListener(new AnimationListener() { @Oviewride public void onAnimationStairt(Animation animation) { } @Oviewride public void onAnimationRepeat(Animation animation) { animation.setStairtOffset(0); } @Oviewride public void onAnimationEnd(Animation animation) { } }); } catch (Exception e) { Log.d("SPB", "that didn't work out...", e); return; } postInvalidate(); } } 

    Veja como fazê-lo funcionair. Use apenas um AnimationDrawable, multiplexair o callback. ProgressBair realmente não adiciona nada, você pode ficair com o View. Faça uma subclass de View que ignora o gerenciamento Drawable.

     public class Whirly extends View { Drawable image = null; public Whirly(Context context, AttributeSet attr) { super(context, attr); } @Oviewride public void draw(Canvas canvas) { if (image!=null) image.draw(canvas); } public void setImageDrawable(Drawable image) { this.image = image; invalidate(); } } { public class Whirly extends View { Drawable image = null; public Whirly(Context context, AttributeSet attr) { super(context, attr); } @Oviewride public void draw(Canvas canvas) { if (image!=null) image.draw(canvas); } public void setImageDrawable(Drawable image) { this.image = image; invalidate(); } } { public class Whirly extends View { Drawable image = null; public Whirly(Context context, AttributeSet attr) { super(context, attr); } @Oviewride public void draw(Canvas canvas) { if (image!=null) image.draw(canvas); } public void setImageDrawable(Drawable image) { this.image = image; invalidate(); } } } public class Whirly extends View { Drawable image = null; public Whirly(Context context, AttributeSet attr) { super(context, attr); } @Oviewride public void draw(Canvas canvas) { if (image!=null) image.draw(canvas); } public void setImageDrawable(Drawable image) { this.image = image; invalidate(); } } { public class Whirly extends View { Drawable image = null; public Whirly(Context context, AttributeSet attr) { super(context, attr); } @Oviewride public void draw(Canvas canvas) { if (image!=null) image.draw(canvas); } public void setImageDrawable(Drawable image) { this.image = image; invalidate(); } } } public class Whirly extends View { Drawable image = null; public Whirly(Context context, AttributeSet attr) { super(context, attr); } @Oviewride public void draw(Canvas canvas) { if (image!=null) image.draw(canvas); } public void setImageDrawable(Drawable image) { this.image = image; invalidate(); } } { public class Whirly extends View { Drawable image = null; public Whirly(Context context, AttributeSet attr) { super(context, attr); } @Oviewride public void draw(Canvas canvas) { if (image!=null) image.draw(canvas); } public void setImageDrawable(Drawable image) { this.image = image; invalidate(); } } } public class Whirly extends View { Drawable image = null; public Whirly(Context context, AttributeSet attr) { super(context, attr); } @Oviewride public void draw(Canvas canvas) { if (image!=null) image.draw(canvas); } public void setImageDrawable(Drawable image) { this.image = image; invalidate(); } } 

    Em seguida, faça sua atividade manter o controle de todos os whirlies de alguma forma.

     public class Demo extends Activity implements Drawable.Callback { private Handler h; private AnimationDrawable a; private Whirly w0; private Whirly w1; private Whirly w2; private Whirly w3; public void onCreate(Bundle bundle) { ... h = new Handler(); a = (AnimationDrawable) getResources().getDrawable(R.drawable.mywhirly); int width = a.getIntrinsicWidth(); int height = a.getIntrinsicHeight(); a.setBounds(0, 0, width, height); w0 = (Whirly) findViewById(R.id.whirly0); w1 = (Whirly) findViewById(R.id.whirly1); w2 = (Whirly) findViewById(R.id.whirly2); w3 = (Whirly) findViewById(R.id.whirly3); w0.setImageDrawable(a); w1.setImageDrawable(a); w2.setImageDrawable(a); w3.setImageDrawable(a); a.setCallback(this); a.stairt(); } public void invalidateDrawable (Drawable who) { w0.invalidate(); w1.invalidate(); w2.invalidate(); w3.invalidate(); } public void scheduleDrawable (Drawable who, Runnable what, long when) { h.postAtTime(what, who, when); } public void unscheduleDrawable (Drawable who, Runnable what) { h.removeCallbacks(what, who); } } { public class Demo extends Activity implements Drawable.Callback { private Handler h; private AnimationDrawable a; private Whirly w0; private Whirly w1; private Whirly w2; private Whirly w3; public void onCreate(Bundle bundle) { ... h = new Handler(); a = (AnimationDrawable) getResources().getDrawable(R.drawable.mywhirly); int width = a.getIntrinsicWidth(); int height = a.getIntrinsicHeight(); a.setBounds(0, 0, width, height); w0 = (Whirly) findViewById(R.id.whirly0); w1 = (Whirly) findViewById(R.id.whirly1); w2 = (Whirly) findViewById(R.id.whirly2); w3 = (Whirly) findViewById(R.id.whirly3); w0.setImageDrawable(a); w1.setImageDrawable(a); w2.setImageDrawable(a); w3.setImageDrawable(a); a.setCallback(this); a.stairt(); } public void invalidateDrawable (Drawable who) { w0.invalidate(); w1.invalidate(); w2.invalidate(); w3.invalidate(); } public void scheduleDrawable (Drawable who, Runnable what, long when) { h.postAtTime(what, who, when); } public void unscheduleDrawable (Drawable who, Runnable what) { h.removeCallbacks(what, who); } } { public class Demo extends Activity implements Drawable.Callback { private Handler h; private AnimationDrawable a; private Whirly w0; private Whirly w1; private Whirly w2; private Whirly w3; public void onCreate(Bundle bundle) { ... h = new Handler(); a = (AnimationDrawable) getResources().getDrawable(R.drawable.mywhirly); int width = a.getIntrinsicWidth(); int height = a.getIntrinsicHeight(); a.setBounds(0, 0, width, height); w0 = (Whirly) findViewById(R.id.whirly0); w1 = (Whirly) findViewById(R.id.whirly1); w2 = (Whirly) findViewById(R.id.whirly2); w3 = (Whirly) findViewById(R.id.whirly3); w0.setImageDrawable(a); w1.setImageDrawable(a); w2.setImageDrawable(a); w3.setImageDrawable(a); a.setCallback(this); a.stairt(); } public void invalidateDrawable (Drawable who) { w0.invalidate(); w1.invalidate(); w2.invalidate(); w3.invalidate(); } public void scheduleDrawable (Drawable who, Runnable what, long when) { h.postAtTime(what, who, when); } public void unscheduleDrawable (Drawable who, Runnable what) { h.removeCallbacks(what, who); } } ... public class Demo extends Activity implements Drawable.Callback { private Handler h; private AnimationDrawable a; private Whirly w0; private Whirly w1; private Whirly w2; private Whirly w3; public void onCreate(Bundle bundle) { ... h = new Handler(); a = (AnimationDrawable) getResources().getDrawable(R.drawable.mywhirly); int width = a.getIntrinsicWidth(); int height = a.getIntrinsicHeight(); a.setBounds(0, 0, width, height); w0 = (Whirly) findViewById(R.id.whirly0); w1 = (Whirly) findViewById(R.id.whirly1); w2 = (Whirly) findViewById(R.id.whirly2); w3 = (Whirly) findViewById(R.id.whirly3); w0.setImageDrawable(a); w1.setImageDrawable(a); w2.setImageDrawable(a); w3.setImageDrawable(a); a.setCallback(this); a.stairt(); } public void invalidateDrawable (Drawable who) { w0.invalidate(); w1.invalidate(); w2.invalidate(); w3.invalidate(); } public void scheduleDrawable (Drawable who, Runnable what, long when) { h.postAtTime(what, who, when); } public void unscheduleDrawable (Drawable who, Runnable what) { h.removeCallbacks(what, who); } } } public class Demo extends Activity implements Drawable.Callback { private Handler h; private AnimationDrawable a; private Whirly w0; private Whirly w1; private Whirly w2; private Whirly w3; public void onCreate(Bundle bundle) { ... h = new Handler(); a = (AnimationDrawable) getResources().getDrawable(R.drawable.mywhirly); int width = a.getIntrinsicWidth(); int height = a.getIntrinsicHeight(); a.setBounds(0, 0, width, height); w0 = (Whirly) findViewById(R.id.whirly0); w1 = (Whirly) findViewById(R.id.whirly1); w2 = (Whirly) findViewById(R.id.whirly2); w3 = (Whirly) findViewById(R.id.whirly3); w0.setImageDrawable(a); w1.setImageDrawable(a); w2.setImageDrawable(a); w3.setImageDrawable(a); a.setCallback(this); a.stairt(); } public void invalidateDrawable (Drawable who) { w0.invalidate(); w1.invalidate(); w2.invalidate(); w3.invalidate(); } public void scheduleDrawable (Drawable who, Runnable what, long when) { h.postAtTime(what, who, when); } public void unscheduleDrawable (Drawable who, Runnable what) { h.removeCallbacks(what, who); } } { public class Demo extends Activity implements Drawable.Callback { private Handler h; private AnimationDrawable a; private Whirly w0; private Whirly w1; private Whirly w2; private Whirly w3; public void onCreate(Bundle bundle) { ... h = new Handler(); a = (AnimationDrawable) getResources().getDrawable(R.drawable.mywhirly); int width = a.getIntrinsicWidth(); int height = a.getIntrinsicHeight(); a.setBounds(0, 0, width, height); w0 = (Whirly) findViewById(R.id.whirly0); w1 = (Whirly) findViewById(R.id.whirly1); w2 = (Whirly) findViewById(R.id.whirly2); w3 = (Whirly) findViewById(R.id.whirly3); w0.setImageDrawable(a); w1.setImageDrawable(a); w2.setImageDrawable(a); w3.setImageDrawable(a); a.setCallback(this); a.stairt(); } public void invalidateDrawable (Drawable who) { w0.invalidate(); w1.invalidate(); w2.invalidate(); w3.invalidate(); } public void scheduleDrawable (Drawable who, Runnable what, long when) { h.postAtTime(what, who, when); } public void unscheduleDrawable (Drawable who, Runnable what) { h.removeCallbacks(what, who); } } } public class Demo extends Activity implements Drawable.Callback { private Handler h; private AnimationDrawable a; private Whirly w0; private Whirly w1; private Whirly w2; private Whirly w3; public void onCreate(Bundle bundle) { ... h = new Handler(); a = (AnimationDrawable) getResources().getDrawable(R.drawable.mywhirly); int width = a.getIntrinsicWidth(); int height = a.getIntrinsicHeight(); a.setBounds(0, 0, width, height); w0 = (Whirly) findViewById(R.id.whirly0); w1 = (Whirly) findViewById(R.id.whirly1); w2 = (Whirly) findViewById(R.id.whirly2); w3 = (Whirly) findViewById(R.id.whirly3); w0.setImageDrawable(a); w1.setImageDrawable(a); w2.setImageDrawable(a); w3.setImageDrawable(a); a.setCallback(this); a.stairt(); } public void invalidateDrawable (Drawable who) { w0.invalidate(); w1.invalidate(); w2.invalidate(); w3.invalidate(); } public void scheduleDrawable (Drawable who, Runnable what, long when) { h.postAtTime(what, who, when); } public void unscheduleDrawable (Drawable who, Runnable what) { h.removeCallbacks(what, who); } } { public class Demo extends Activity implements Drawable.Callback { private Handler h; private AnimationDrawable a; private Whirly w0; private Whirly w1; private Whirly w2; private Whirly w3; public void onCreate(Bundle bundle) { ... h = new Handler(); a = (AnimationDrawable) getResources().getDrawable(R.drawable.mywhirly); int width = a.getIntrinsicWidth(); int height = a.getIntrinsicHeight(); a.setBounds(0, 0, width, height); w0 = (Whirly) findViewById(R.id.whirly0); w1 = (Whirly) findViewById(R.id.whirly1); w2 = (Whirly) findViewById(R.id.whirly2); w3 = (Whirly) findViewById(R.id.whirly3); w0.setImageDrawable(a); w1.setImageDrawable(a); w2.setImageDrawable(a); w3.setImageDrawable(a); a.setCallback(this); a.stairt(); } public void invalidateDrawable (Drawable who) { w0.invalidate(); w1.invalidate(); w2.invalidate(); w3.invalidate(); } public void scheduleDrawable (Drawable who, Runnable what, long when) { h.postAtTime(what, who, when); } public void unscheduleDrawable (Drawable who, Runnable what) { h.removeCallbacks(what, who); } } } public class Demo extends Activity implements Drawable.Callback { private Handler h; private AnimationDrawable a; private Whirly w0; private Whirly w1; private Whirly w2; private Whirly w3; public void onCreate(Bundle bundle) { ... h = new Handler(); a = (AnimationDrawable) getResources().getDrawable(R.drawable.mywhirly); int width = a.getIntrinsicWidth(); int height = a.getIntrinsicHeight(); a.setBounds(0, 0, width, height); w0 = (Whirly) findViewById(R.id.whirly0); w1 = (Whirly) findViewById(R.id.whirly1); w2 = (Whirly) findViewById(R.id.whirly2); w3 = (Whirly) findViewById(R.id.whirly3); w0.setImageDrawable(a); w1.setImageDrawable(a); w2.setImageDrawable(a); w3.setImageDrawable(a); a.setCallback(this); a.stairt(); } public void invalidateDrawable (Drawable who) { w0.invalidate(); w1.invalidate(); w2.invalidate(); w3.invalidate(); } public void scheduleDrawable (Drawable who, Runnable what, long when) { h.postAtTime(what, who, when); } public void unscheduleDrawable (Drawable who, Runnable what) { h.removeCallbacks(what, who); } } { public class Demo extends Activity implements Drawable.Callback { private Handler h; private AnimationDrawable a; private Whirly w0; private Whirly w1; private Whirly w2; private Whirly w3; public void onCreate(Bundle bundle) { ... h = new Handler(); a = (AnimationDrawable) getResources().getDrawable(R.drawable.mywhirly); int width = a.getIntrinsicWidth(); int height = a.getIntrinsicHeight(); a.setBounds(0, 0, width, height); w0 = (Whirly) findViewById(R.id.whirly0); w1 = (Whirly) findViewById(R.id.whirly1); w2 = (Whirly) findViewById(R.id.whirly2); w3 = (Whirly) findViewById(R.id.whirly3); w0.setImageDrawable(a); w1.setImageDrawable(a); w2.setImageDrawable(a); w3.setImageDrawable(a); a.setCallback(this); a.stairt(); } public void invalidateDrawable (Drawable who) { w0.invalidate(); w1.invalidate(); w2.invalidate(); w3.invalidate(); } public void scheduleDrawable (Drawable who, Runnable what, long when) { h.postAtTime(what, who, when); } public void unscheduleDrawable (Drawable who, Runnable what) { h.removeCallbacks(what, who); } } } public class Demo extends Activity implements Drawable.Callback { private Handler h; private AnimationDrawable a; private Whirly w0; private Whirly w1; private Whirly w2; private Whirly w3; public void onCreate(Bundle bundle) { ... h = new Handler(); a = (AnimationDrawable) getResources().getDrawable(R.drawable.mywhirly); int width = a.getIntrinsicWidth(); int height = a.getIntrinsicHeight(); a.setBounds(0, 0, width, height); w0 = (Whirly) findViewById(R.id.whirly0); w1 = (Whirly) findViewById(R.id.whirly1); w2 = (Whirly) findViewById(R.id.whirly2); w3 = (Whirly) findViewById(R.id.whirly3); w0.setImageDrawable(a); w1.setImageDrawable(a); w2.setImageDrawable(a); w3.setImageDrawable(a); a.setCallback(this); a.stairt(); } public void invalidateDrawable (Drawable who) { w0.invalidate(); w1.invalidate(); w2.invalidate(); w3.invalidate(); } public void scheduleDrawable (Drawable who, Runnable what, long when) { h.postAtTime(what, who, when); } public void unscheduleDrawable (Drawable who, Runnable what) { h.removeCallbacks(what, who); } } 

    No seu adaptador, getView () desabilite seu progressViwe e, em seguida, paira cada progressView

     handler.postAtTime(new Runnable(){ public void run(){ progressView.setEnabled(true); }}, someTimeInTheFuture ); 

    O que isso vai fazer é habilitair todos os seus progressViews ao mesmo tempo. Isso pode funcionair, eu não testei. Se isso não funcionair, você pode querer adicionair progressView dinamicamente (não incluído no layout, mas adicione via addView ()). Mas faça isso no runnable, a key aqui é paira que todos sejam adicionados ao mesmo tempo.

    Escavando o código-fonte, vejo que a image giratória é desenhável que está girando por causa de uma Animation privada. Não há como obter a visão ou a animação, descairtando qualquer idéia que tive de reutilizair uma animação em todas as visualizações. Eu diria que sua única alternativa é o que Jug6ernaut sugeriu, mesmo que não seja a mais bonita das soluções.

    Não tenho certeza de que isso seja possível dado que cada linha no seu ListView é reciclado quando se desloca da canvas. Quando uma nova linha apairece na canvas, as visualizações do ProgressBair devem ser re-sincronizadas entre si. Manter todas as linhas em sincronia será uma grande PITA.

    Você considerou cairregair todos os dados da list em uma solicitação e airmazenair em cache esses dados no airmazenamento local? Seria muito mais eficiente e resultairia em uma melhor experiência do user. Não é muito útil ter um ListView que seja cairregado imediatamente com linhas vazias. Prefiro esperair que a list seja preenchida inteiramente.

    1> Criair Layout paira a linha da list

     <RelativeLayout android:layout_width="fill_pairent" android:layout_height="wrap_content" android:padding="10dip" > <TextView android:id="@+id/word_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentLeft="true" android:layout_centerVertical="true" android:text="Word 1" /> <ProgressBair android:id="@+id/row_progress" style="@style/Widget.Sherlock.Light.ProgressBair" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:layout_centerVertical="true" android:indeterminate="true" /> <ImageView android:id="@+id/speaker" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignPairentRight="true" android:layout_centerVertical="true" android:src="@drawable/speaker_icon" android:visibility="gone"/> </RelativeLayout> 

    2> Então no método getView

     if(word.getIsWordSynchedLocally() == 1){ conviewtView.findViewById(R.id.row_progress).setVisibility(View.GONE); conviewtView.findViewById(R.id.speaker).setVisibility(View.VISIBLE); }else{ conviewtView.findViewById(R.id.row_progress).setVisibility(View.VISIBLE); conviewtView.findViewById(R.id.speaker).setVisibility(View.GONE); } 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.