diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/utils/BigFrameAnimatorContainer.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/utils/BigFrameAnimatorContainer.kt index 6e286cbd0d..12d3f53912 100644 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/utils/BigFrameAnimatorContainer.kt +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/utils/BigFrameAnimatorContainer.kt @@ -131,38 +131,40 @@ class BigFrameAnimatorContainer (resId: Int, writeQueue.add(Pair(mBitmap,mBitmapOptions)) } - decodeImage = ThreadUtils.getIoPool().submit { - while (true) { - val startTime = System.currentTimeMillis() - val (bitmap1, options) = writeQueue.take() - mIndex++ - if (mIndex >= mFrames.size){ - mIndex = 0 - if(isOnce){ - stop() - return@submit + decodeImage = OCHThreadPoolManager.getsInstance().submit(object: Runnable{ + override fun run() { + while (true) { + val startTime = System.currentTimeMillis() + val (bitmap1, options) = writeQueue.take() + mIndex++ + if (mIndex >= mFrames.size){ + mIndex = 0 + if(isOnce){ + stop() + return + } + } + val index: Int = mIndex + val imageRes: Int = mFrames[index] + var bitmap: Bitmap? = null + try { + bitmap = BitmapFactory.decodeResource( + imageView.resources, + imageRes, + options + ) + options.inBitmap = bitmap + } catch (e: Exception) { + e.printStackTrace() + } + if (bitmap != null) { + readQueue.put(Pair(bitmap, options)) + } + val dexTime = System.currentTimeMillis() - startTime + CallerLogger.d(TAG, "decode用时:${dexTime}ms index ${index}") } } - val index: Int = mIndex - val imageRes: Int = mFrames[index] - var bitmap: Bitmap? = null - try { - bitmap = BitmapFactory.decodeResource( - imageView.resources, - imageRes, - options - ) - options.inBitmap = bitmap - } catch (e: Exception) { - e.printStackTrace() - } - if (bitmap != null) { - readQueue.put(Pair(bitmap, options)) - } - val dexTime = System.currentTimeMillis() - startTime - CallerLogger.d(TAG, "decode用时:${dexTime}ms index ${index}") - } - } + }) } //循环读取下一帧 diff --git a/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/arrived/ArrivedView.kt b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/arrived/ArrivedView.kt index 9aae279e6b..b90de80abf 100644 --- a/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/arrived/ArrivedView.kt +++ b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/arrived/ArrivedView.kt @@ -73,6 +73,8 @@ class ArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback { ZhiViewmanager.showListeningAni(ZhiViewmanager.loveAni) } else { v_video_right_rear_view.resetView() + taxiPxiaozhiLove?.stop() + taxiPxiaozhiLove?.release() taxiPxiaozhiLove = null RxUtils.disposeSubscribe(subscribe) ZhiViewmanager.showListeningAni(ZhiViewmanager.normalAni) diff --git a/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/checkstartautopilot/ChekAndStartAutopilotView.kt b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/checkstartautopilot/ChekAndStartAutopilotView.kt index e8897bfddf..416fddcc6e 100644 --- a/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/checkstartautopilot/ChekAndStartAutopilotView.kt +++ b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/checkstartautopilot/ChekAndStartAutopilotView.kt @@ -17,6 +17,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.eagle.core.utilcode.util.ThreadUtils +import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.mogo.och.common.module.manager.xiaozhimanager.ZhiViewmanager import com.mogo.och.common.module.utils.BigFrameAnimatorContainer import com.mogo.och.common.module.utils.RxUtils @@ -88,6 +89,8 @@ class ChekAndStartAutopilotView : WindowRelativeLayout, aciv_start_autopilt_success_ani.alpha = 0f d(SceneConstant.M_TAXI_P + TAG, "透明度${aciv_start_autopilt_success_bg.alpha}---${aciv_start_autopilt_success_ani.alpha}") } else { + aniCheck2StartAutopilotView?.stop() + aniCheck2StartAutopilotView?.release() aniCheck2StartAutopilotView = null ZhiViewmanager.showListeningAni(ZhiViewmanager.normalAni) } @@ -168,15 +171,9 @@ class ChekAndStartAutopilotView : WindowRelativeLayout, // 启动公司logo动画 startAnimal() }else { - waitCount++ - if(waitCount {} @@ -196,7 +192,7 @@ class ChekAndStartAutopilotView : WindowRelativeLayout, d(SceneConstant.M_TAXI_P + TAG, "透明度${aciv_start_autopilt_success_bg.alpha}---${aciv_start_autopilt_success_ani.alpha}") } override fun onAnimationStart(animation: Animator) { - RxUtils.createSubscribe(350) { + UiThreadHandler.postDelayed({ val aniStartAutopilotSuccessAni = BigFrameAnimatorContainer(R.array.taxi_p_start_autopilot_fail, 20, aciv_start_autopilt_success_ani, true) aniStartAutopilotSuccessAni.setOnAnimStopListener(object : @@ -228,8 +224,7 @@ class ChekAndStartAutopilotView : WindowRelativeLayout, } } }) - aniStartAutopilotSuccessAni.start() - } + aniStartAutopilotSuccessAni.start()},350) } }) animatorSetCompat.start()