В майском приложении я предоставляю пользователю выбор шапки, шарфа из разных вариантов
в зависимости от выбора пользователя мне нужно анимировать этот карестр с выбранной пользователем шапкой и шарфом
//Iam posting the some sample code here
public int maledance[]={R.drawable.char01,R.drawable.char02,R.drawable.char03,R.drawable.char04,R.drawable.char05,R.drawable.char06
,R.drawable.char07,R.drawable.char08,R.drawable.char09,R.drawable.char10,R.drawable.char11,R.drawable.char12,R.drawable.char13,R.drawable.char14,R.drawable.char15};
public int maledancescarf1[]={R.drawable.scarve101,R.drawable.scarve102,R.drawable.scarve103,R.drawable.scarve104,R.drawable.scarve105,R.drawable.scarve106,
R.drawable.scarve107,R.drawable.scarve108,R.drawable.scarve109,R.drawable.scarve110,R.drawable.scarve111,R.drawable.scarve112,R.drawable.scarve113,R.drawable.scarve114,R.drawable.scarve115};
и т.д ......
charecteranimation=new AnimationDrawable();
capanimation=new AnimationDrawable();
capboarderanimation=new AnimationDrawable();
scarfmainanimaiton=new AnimationDrawable();
scarfboarderanimation=new AnimationDrawable();
faceexpressionanimation=new AnimationDrawable();
for(int i=0;i<maledance.length;i++)
{
Log.i("fani","string lenth is "+maledance.length+" delay is "+delay);
charecteranimation.addFrame(getResources().getDrawable(maledance[i]),t);
capanimation.addFrame(getResources().getDrawable(maledancecap[i]),t);
scarfmainanimaiton.addFrame(getResources().getDrawable(maledancescarf[i]),t);
faceexpressionanimation.addFrame(getResources().getDrawable(malefaceexpression[i]),t);
}
capanimation.setOneShot(false);
charecteranimation.setOneShot(false);
scarfmainanimaiton.setOneShot(false);
faceexpressionanimation.setOneShot(false);
//in onwindowfocuschanged listner i am starting the animations