diff --git a/.idea/misc.xml b/.idea/misc.xml index 0a4b372510..0acef90ee0 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -25,6 +25,14 @@ + + + + + + + + diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/OthersAnim.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/OthersAnim.java index a41054d775..083710a47f 100644 --- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/OthersAnim.java +++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/anim/OthersAnim.java @@ -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(); } } };