3

I use an ProgressBar in xml Android bus is very slow. Optimal is 60fps. Is it possible to change the frame rate or to add custom progress circle with more fps?

 <ProgressBar
                    android:id="@+id/progressBar1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="17dp"
                    android:layout_gravity="center" />
StarsSky
  • 6,721
  • 6
  • 38
  • 63
e-info128
  • 3,727
  • 10
  • 40
  • 57

2 Answers2

6

You can modify the duration with:

android:indeterminateDuration=<duration in ms>

http://developer.android.com/reference/android/widget/ProgressBar.html#indeterminateDuration

Enrichman
  • 11,157
  • 11
  • 67
  • 101
0

Solution: Add picture and use animation rotation in 360º:

<ImageView
  android:id="@+id/resultados_estado_carga_imagen"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:src="@drawable/cargador"
  android:layout_gravity="center" />

...

final ImageView resultados_estado_carga_imagen = (ImageView) findViewById(R.id.resultados_estado_carga_imagen);

RotateAnimation anim = new RotateAnimation(360, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);

anim.setInterpolator(new LinearInterpolator());
anim.setRepeatCount(Animation.INFINITE);
anim.setDuration(700);

resultados_estado_carga_imagen.startAnimation(anim);

Thanks :)

e-info128
  • 3,727
  • 10
  • 40
  • 57