<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"> <item android:drawable="@drawable/chatfrom_voice_playing_f3" android:duration="200" /> <item android:drawable="@drawable/chatfrom_voice_playing_f1" android:duration="200" /> <item android:drawable="@drawable/chatfrom_voice_playing_f2" android:duration="200" /> <item android:drawable="@drawable/chatfrom_voice_playing_f1" android:duration="200" /> <item android:drawable="@drawable/chatfrom_voice_playing_f3" android:duration="200" /> </animation-list>
//必须把一下两行设置去掉 // holder.fromImgContent.setImageResource(R.drawable.voice_from_icon); // holder.toImgContent.setImageResource(R.drawable.voice_to_icon); if(!chatInfo.getAudioMessage().isAnimation()) { ((AnimationDrawable) holder.fromImgContent.getDrawable()).setOneShot(true); ((AnimationDrawable) holder.toImgContent.getDrawable()).setOneShot(true);