From 548982a66c00c9d5c7cf5c5007ff66368c1d46af Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Sep 2020 14:11:56 +0800 Subject: [PATCH 1/2] changed the roadcross live from server --- .../scene/livecar/V2XVoiceCallLiveBiz.java | 47 ++++++++++--------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveBiz.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveBiz.java index 3fa4c42b92..911b7db6c0 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveBiz.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XVoiceCallLiveBiz.java @@ -10,6 +10,9 @@ import com.mogo.module.v2x.R; import com.mogo.module.v2x.V2XDemoManager; import com.mogo.module.v2x.V2XServiceManager; import com.mogo.module.v2x.entity.net.V2XDemoUserInfoRes; +import com.mogo.module.v2x.entity.net.V2XLiveCrossRoad; +import com.mogo.module.v2x.network.V2XRefreshCallback; +import com.mogo.module.v2x.network.V2XRefreshModel; import com.mogo.module.v2x.utils.ToastUtils; import com.mogo.module.v2x.voice.V2XVoiceCallbackListener; import com.mogo.module.v2x.voice.V2XVoiceManager; @@ -109,28 +112,28 @@ public class V2XVoiceCallLiveBiz { } public void getOpenRoadCameraLive() { - String liveUrl = "rtmp://154.8.189.110:19350/live/10_1"; - V2XMessageEntity v2XMessageEntity = buildCallLiveParams(null, liveUrl); - V2XVoiceCallLiveScenario.getInstance().setV2XWindow(new V2XVoiceCrossRoadLiveWindow()); - V2XVoiceCallLiveScenario.getInstance().init(v2XMessageEntity); -// V2XRefreshModel.getInstance(mContext).queryCrossRoadsLive(new V2XRefreshCallback() { -// @Override -// public void onSuccess(V2XLiveCrossRoad result) { -// if (result != null && result.getResult().getUrl() != null) { -// String liveUrl = result.getResult().getUrl(); -// V2XMessageEntity v2XMessageEntity = buildCallLiveParams(null, liveUrl); -// V2XVoiceCallLiveScenario.getInstance().setV2XWindow(new V2XVoiceCrossRoadLiveWindow()); -// V2XVoiceCallLiveScenario.getInstance().init(v2XMessageEntity); -// } else { -// Logger.d(MODULE_NAME, "getOpenRoadCameraLive 路口实况直播地址为空"); -// } -// } -// -// @Override -// public void onFail(String msg) { -// Logger.d(MODULE_NAME, "getOpenRoadCameraLive : " + msg); -// } -// }); +// String liveUrl = "rtmp://154.8.189.110:19350/live/10_1"; +// V2XMessageEntity v2XMessageEntity = buildCallLiveParams(null, liveUrl); +// V2XVoiceCallLiveScenario.getInstance().setV2XWindow(new V2XVoiceCrossRoadLiveWindow()); +// V2XVoiceCallLiveScenario.getInstance().init(v2XMessageEntity); + V2XRefreshModel.getInstance(mContext).queryCrossRoadsLive(new V2XRefreshCallback() { + @Override + public void onSuccess(V2XLiveCrossRoad result) { + if (result != null && result.getResult().getUrl() != null) { + String liveUrl = result.getResult().getUrl(); + V2XMessageEntity v2XMessageEntity = buildCallLiveParams(null, liveUrl); + V2XVoiceCallLiveScenario.getInstance().setV2XWindow(new V2XVoiceCrossRoadLiveWindow()); + V2XVoiceCallLiveScenario.getInstance().init(v2XMessageEntity); + } else { + Logger.d(MODULE_NAME, "getOpenRoadCameraLive 路口实况直播地址为空"); + } + } + + @Override + public void onFail(String msg) { + Logger.d(MODULE_NAME, "getOpenRoadCameraLive : " + msg); + } + }); } private V2XMessageEntity buildCallLiveParams(String sn, String liveUrl) { From a71b8f735e7ff735ccd25ec58d2392fbd61c053e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Mon, 14 Sep 2020 19:09:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3bug=20http://jira.zhidaoh?= =?UTF-8?q?ulian.com/browse/FX-438=20http://jira.zhidaohulian.com/browse/F?= =?UTF-8?q?X-443?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/codeStyles/Project.xml | 15 ++++-- .../V2XScenarioHistoryIllegalParkVH.java | 1 + .../V2XScenarioHistoryOtherSeekHelpVH.java | 2 +- .../holder/V2XScenarioHistoryRoadEventVH.java | 4 +- .../mogo/module/v2x/view/HeartLikeView.java | 50 +++++++++++-------- .../mogo/module/v2x/view/HeartUnLikeView.java | 48 ++++++++++-------- 6 files changed, 72 insertions(+), 48 deletions(-) diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 663459aa50..0d156937bb 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -3,9 +3,18 @@ + diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XScenarioHistoryIllegalParkVH.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XScenarioHistoryIllegalParkVH.java index 03d346838b..e32d6aef52 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XScenarioHistoryIllegalParkVH.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XScenarioHistoryIllegalParkVH.java @@ -100,6 +100,7 @@ public class V2XScenarioHistoryIllegalParkVH extends V2XBaseViewHolder { - if (mAnimatorSet == null) { - mAnimatorSet = (AnimatorSet) AnimatorInflater.loadAnimator(getContext(), - R.anim.v2x_like_heart_animation); - mAnimatorSet.setTarget(mIllegalParkingLike); - } - mAnimatorSet.addListener(new Animator.AnimatorListener() { - @Override - public void onAnimationStart(Animator animation) { - + if (!isAnimator) { + isAnimator = true; + if (mAnimatorSet == null) { + mAnimatorSet = (AnimatorSet) AnimatorInflater.loadAnimator(getContext(), + R.anim.v2x_like_heart_animation); + mAnimatorSet.setTarget(mIllegalParkingLike); } + mAnimatorSet.addListener(new Animator.AnimatorListener() { + @Override + public void onAnimationStart(Animator animation) { - @Override - public void onAnimationEnd(Animator animation) { - if (mOnClickCallListener != null) { - mOnClickCallListener.onClicked(HeartLikeView.this); } - } - @Override - public void onAnimationCancel(Animator animation) { + @Override + public void onAnimationEnd(Animator animation) { + isAnimator = false; + if (mOnClickCallListener != null) { + mOnClickCallListener.onClicked(HeartLikeView.this); + } + } - } + @Override + public void onAnimationCancel(Animator animation) { - @Override - public void onAnimationRepeat(Animator animation) { + } - } - }); - mAnimatorSet.start(); + @Override + public void onAnimationRepeat(Animator animation) { + + } + }); + mAnimatorSet.start(); + } }); } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartUnLikeView.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartUnLikeView.java index 65524495b3..129b23e03a 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartUnLikeView.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartUnLikeView.java @@ -23,6 +23,7 @@ public class HeartUnLikeView extends LinearLayout { private ImageView mIllegalParkingUnLike; private AnimatorSet mAnimatorSet; private OnClickCallListener mOnClickCallListener; + private boolean isAnimator = false; public HeartUnLikeView(Context context) { this(context, null); @@ -38,35 +39,40 @@ public class HeartUnLikeView extends LinearLayout { mIllegalParkingUnLike = findViewById(R.id.ivIllegalParkingUnLike); setOnClickListener(v -> { - if (mAnimatorSet == null) { - mAnimatorSet = (AnimatorSet) AnimatorInflater.loadAnimator(getContext(), - R.anim.v2x_unlike_heart_animation); - mAnimatorSet.setTarget(mIllegalParkingUnLike); - } - mAnimatorSet.addListener(new Animator.AnimatorListener() { - @Override - public void onAnimationStart(Animator animation) { + if (!isAnimator) { + isAnimator = true; + if (mAnimatorSet == null) { + mAnimatorSet = (AnimatorSet) AnimatorInflater.loadAnimator(getContext(), + R.anim.v2x_unlike_heart_animation); + mAnimatorSet.setTarget(mIllegalParkingUnLike); } + mAnimatorSet.addListener(new Animator.AnimatorListener() { + @Override + public void onAnimationStart(Animator animation) { - @Override - public void onAnimationEnd(Animator animation) { - if (mOnClickCallListener != null) { - mOnClickCallListener.onClicked(HeartUnLikeView.this); } - } - @Override - public void onAnimationCancel(Animator animation) { + @Override + public void onAnimationEnd(Animator animation) { + isAnimator = false; + if (mOnClickCallListener != null) { + mOnClickCallListener.onClicked(HeartUnLikeView.this); + } + } - } + @Override + public void onAnimationCancel(Animator animation) { - @Override - public void onAnimationRepeat(Animator animation) { + } - } - }); - mAnimatorSet.start(); + @Override + public void onAnimationRepeat(Animator animation) { + + } + }); + mAnimatorSet.start(); + } }); }