Buenas estoy tratando de hacer una animacion usando un XML y animation-list, me sale todo correcto pero el problema que tengo es que quiero que el orden de la animación sea siempre distinto cada vez que se inicie es activity
<?xml version="1.0" encoding="utf-8"?>
<animation-list
xmlns:android= "http://schemas.android.com/apk/res/android"
android:oneshot= "false">
<item android:drawable="@drawable/dice1"
android:duration="200" />
<item android:drawable="@drawable/dice2"
android:duration="200" />
<item android:drawable="@drawable/dice3"
android:duration="200" />
<item android:drawable="@drawable/dice4"
android:duration="200" />
<item android:drawable="@drawable/dice5"
android:duration="200" />
<item android:drawable="@drawable/dice6"
android:duration="200" />
</animation-list>
Ese seria el xml que uso, solo las 6 imagenes que uso, y a continuación pondre como inicio la animacion en el activity
private AnimationDrawable animacion;
private AnimationDrawable animacion2;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.pantalla_partida);
dado = (ImageView) findViewById(R.id.Dado);
dado2 = (ImageView) findViewById(R.id.Dado2);
animacion = (AnimationDrawable) ContextCompat.getDrawable(this,R.drawable.animacion);
animacion2 = (AnimationDrawable) ContextCompat.getDrawable(this,R.drawable.animacion);
dado.setImageDrawable(animacion);
dado2.setImageDrawable(animacion2);
Este seria todo el codigo, si es posible también querria saber si es posible saber que frame actual tiene la animación.