修复
#3002 java.io.FileNotFoundException res/drawable-xhdpi-v4/ic_daily_00028.png com.mogo.module.apps.anim.OthersAnim$1.handleMessage(OthersAnim.java:44) https://bugly.qq.com/v2/crash-reporting/crashes/ac71228f85/3002?pid=1 Signed-off-by: 董宏宇 <martindhy@gmail.com>
This commit is contained in:
@@ -32,34 +32,38 @@ public class OthersAnim implements Anim {
|
||||
@Override
|
||||
public void handleMessage( Message msg ) {
|
||||
super.handleMessage( msg );
|
||||
switch ( msg.what ) {
|
||||
case MSG_LOOP:
|
||||
if ( mStarted ) {
|
||||
if ( AnimRes.sRes.length == 0 ) {
|
||||
return;
|
||||
try {
|
||||
switch ( msg.what ) {
|
||||
case MSG_LOOP:
|
||||
if ( mStarted ) {
|
||||
if ( AnimRes.sRes.length == 0 ) {
|
||||
return;
|
||||
}
|
||||
if ( mStartIndex >= AnimRes.sRes.length - 1 ) {
|
||||
mStartIndex = mKeyPoint;
|
||||
}
|
||||
mImageView.setImageResource( AnimRes.sRes[mStartIndex++ % AnimRes.sRes.length] );
|
||||
mHandler.sendEmptyMessageDelayed( MSG_LOOP, FRAME_INTERVAL );
|
||||
}
|
||||
if ( mStartIndex >= AnimRes.sRes.length - 1 ) {
|
||||
mStartIndex = mKeyPoint;
|
||||
break;
|
||||
case MSG_CHANGE:
|
||||
if ( mLastType == AnimRes.EmojiType.Others ) {
|
||||
boolean start = mStarted;
|
||||
stop();
|
||||
mEmojiIndex++;
|
||||
AnimRes.sRes = AnimRes.sAll[mEmojiIndex % AnimRes.sAll.length];
|
||||
mKeyPoint = AnimRes.sKeyPoint[mEmojiIndex % AnimRes.sKeyPoint.length];
|
||||
mBkg.setImageResource( AnimRes.sBkgRes[mEmojiIndex % AnimRes.sBkgRes.length] );
|
||||
mStartIndex = 0;
|
||||
if ( start ) {
|
||||
start();
|
||||
}
|
||||
mHandler.sendEmptyMessageDelayed( MSG_CHANGE, ANIM_INTERVAL );
|
||||
}
|
||||
mImageView.setImageResource( AnimRes.sRes[mStartIndex++ % AnimRes.sRes.length] );
|
||||
mHandler.sendEmptyMessageDelayed( MSG_LOOP, FRAME_INTERVAL );
|
||||
}
|
||||
break;
|
||||
case MSG_CHANGE:
|
||||
if ( mLastType == AnimRes.EmojiType.Others ) {
|
||||
boolean start = mStarted;
|
||||
stop();
|
||||
mEmojiIndex++;
|
||||
AnimRes.sRes = AnimRes.sAll[mEmojiIndex % AnimRes.sAll.length];
|
||||
mKeyPoint = AnimRes.sKeyPoint[mEmojiIndex % AnimRes.sKeyPoint.length];
|
||||
mBkg.setImageResource( AnimRes.sBkgRes[mEmojiIndex % AnimRes.sBkgRes.length] );
|
||||
mStartIndex = 0;
|
||||
if ( start ) {
|
||||
start();
|
||||
}
|
||||
mHandler.sendEmptyMessageDelayed( MSG_CHANGE, ANIM_INTERVAL );
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user