From 44dc368a137ba2add4e5953a0c603b3b33f339a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Mon, 9 Nov 2020 10:55:06 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=87=8D=E5=A4=8D=20?= =?UTF-8?q?=E7=82=B9=E8=B5=9E=E5=9B=9E=E8=B0=83bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/module/v2x/view/HeartLikeView.java | 50 +++++++++---------- .../mogo/module/v2x/view/HeartUnLikeView.java | 50 +++++++++---------- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartLikeView.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartLikeView.java index 9966c37b11..817d7c67f6 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartLikeView.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/HeartLikeView.java @@ -18,7 +18,7 @@ import com.mogo.module.v2x.R; * * @author donghongyu */ -public class HeartLikeView extends LinearLayout { +public class HeartLikeView extends LinearLayout implements Animator.AnimatorListener { private ImageView mIllegalParkingLike; private AnimatorSet mAnimatorSet; @@ -46,36 +46,36 @@ public class HeartLikeView extends LinearLayout { mAnimatorSet = (AnimatorSet) AnimatorInflater.loadAnimator(getContext(), R.anim.v2x_like_heart_animation); mAnimatorSet.setTarget(mIllegalParkingLike); + mAnimatorSet.addListener(this); } - mAnimatorSet.addListener(new Animator.AnimatorListener() { - @Override - public void onAnimationStart(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 onAnimationStart(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) { + + } + public interface OnClickCallListener { /** * 点击回调 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 129b23e03a..de8765c1d4 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 @@ -18,7 +18,7 @@ import com.mogo.module.v2x.R; * * @author donghongyu */ -public class HeartUnLikeView extends LinearLayout { +public class HeartUnLikeView extends LinearLayout implements Animator.AnimatorListener { private ImageView mIllegalParkingUnLike; private AnimatorSet mAnimatorSet; @@ -46,36 +46,36 @@ public class HeartUnLikeView extends LinearLayout { mAnimatorSet = (AnimatorSet) AnimatorInflater.loadAnimator(getContext(), R.anim.v2x_unlike_heart_animation); mAnimatorSet.setTarget(mIllegalParkingUnLike); + mAnimatorSet.addListener(this); } - mAnimatorSet.addListener(new Animator.AnimatorListener() { - @Override - public void onAnimationStart(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 onAnimationStart(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) { + + } + public interface OnClickCallListener { /** * 点击回调 From 4ff860a9e9d6747fcb8530b0273ff1bd85bf1713 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Mon, 9 Nov 2020 10:58:49 +0800 Subject: [PATCH 2/6] opt --- .../main/java/com/mogo/module/share/manager/UploadHelper.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/UploadHelper.kt b/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/UploadHelper.kt index 4bd01b72f7..d99e437e32 100644 --- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/UploadHelper.kt +++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/UploadHelper.kt @@ -39,6 +39,7 @@ object UploadHelper { // } // } else { if (ServiceApisManager.serviceApis.statusManagerApi.isUploading) { + Logger.d("UploadHelper", "upload is going -- ") // 上报即成功,当前还有正在上报的事件,仅做界面展示,不做具体操作 ServiceApisManager.serviceApis.tanluUiApi.shareSuccess(type.eventType, type.location) } else { @@ -59,6 +60,7 @@ object UploadHelper { } else { // 没网就直接提示失败 + Logger.e("UploadHelper", "upload not net ") AIAssist.getInstance(context).speakTTSVoice("分享失败,请检查网络") TipToast.tip("分享失败,请检查网络", TipDrawable(context.resources.getDrawable(R.drawable.module_share_upload_fail))) } @@ -72,7 +74,6 @@ object UploadHelper { if (shareItemSum < VOICE_ALERT_COUNT) { Log.d("UploadHelper", "shareItemSum = $shareItemSum --- intervalTime = $intervalTime --type = ${type}") var time = System.currentTimeMillis() - Log.d("UploadHelper", "time = $time ") if (intervalTime == 0.toLong()) { SharedPrefsMgr.getInstance(context).putLong(KEY_CLICK_SHARE_ITEM_TIME, time) SharedPrefsMgr.getInstance(context).putInt(KEY_CLICK_SHARE_ITEM_BUTTON, ++shareItemSum) From d1ff61cadc431dc6cc9cf658839a5812a6ae8cdc Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 9 Nov 2020 11:11:08 +0800 Subject: [PATCH 3/6] update callchat --- .idea/gradle.xml | 1 - gradle.properties | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.idea/gradle.xml b/.idea/gradle.xml index b59a552525..8e9756d758 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -77,7 +77,6 @@ diff --git a/gradle.properties b/gradle.properties index 5563739527..59320cacf4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -106,7 +106,7 @@ TTS_NOOP_VERSION=2.0.6 ######## 外部依赖引用 # 车聊聊 -CARCHATTING_VERSION=2.0.0 +CARCHATTING_VERSION=2.0.1 # 车聊聊接口 CARCHATTINGPROVIDER_VERSION=1.4.1 # loglib From 47a9f4bbd683f6157c0333b2d467e0b0507c2470 Mon Sep 17 00:00:00 2001 From: liujing Date: Mon, 9 Nov 2020 11:28:13 +0800 Subject: [PATCH 4/6] =?UTF-8?q?sn=E5=88=A4=E6=96=AD,=E8=AF=B4=E8=87=AA?= =?UTF-8?q?=E5=B7=B1=E9=9A=90=E8=97=8F=E6=8B=A8=E6=89=93=E7=94=B5=E8=AF=9D?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mogo/module/v2x/utils/ChartingUtil.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/ChartingUtil.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/ChartingUtil.java index 63a723fa47..d9cc294f8b 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/ChartingUtil.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/ChartingUtil.java @@ -1,10 +1,12 @@ package com.mogo.module.v2x.utils; +import com.mogo.commons.network.Utils; import com.mogo.module.common.entity.MarkerLocation; import com.mogo.module.common.entity.MarkerUserInfo; import com.mogo.module.v2x.V2XConst; import com.mogo.module.v2x.V2XServiceManager; import com.mogo.utils.logger.Logger; +import com.mogo.utils.network.utils.Util; import com.zhidao.carchattingprovider.CallChattingProviderConstant; import com.zhidao.carchattingprovider.ICallChatResponse; @@ -62,6 +64,16 @@ public class ChartingUtil { */ public static void isOnLine(String sn, ChartStatusListener chartStatusListener) { try { + String isMe = Utils.getSn(); + if (isMe.equals(sn)) { + Logger.d("", "是我的分享"); + if (chartStatusListener != null) { + chartStatusListener.canCall(false); + return; + } + } else { + Logger.d("", "不是我的分享"); + } V2XServiceManager.getCarsChattingProvider().isOnLine( "CAR_CALL_TO_" + V2XConst.MODULE_NAME, V2XUtils.getApp(), From 6c4f74050269ca954130401ea5f91a8577f343d2 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 9 Nov 2020 12:44:58 +0800 Subject: [PATCH 5/6] fix bug --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 59320cacf4..a95ab390e3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -106,7 +106,7 @@ TTS_NOOP_VERSION=2.0.6 ######## 外部依赖引用 # 车聊聊 -CARCHATTING_VERSION=2.0.1 +CARCHATTING_VERSION=2.0.2 # 车聊聊接口 CARCHATTINGPROVIDER_VERSION=1.4.1 # loglib From d2856c7c48be7e9be5b56d6aa90ee4dc6933b588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Mon, 9 Nov 2020 12:46:04 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3=20=E3=80=90=E8=98=91?= =?UTF-8?q?=E8=8F=87=E5=87=BA=E8=A1=8C1.1.7=E3=80=91=E8=B7=AF=E5=86=B5?= =?UTF-8?q?=E4=BB=8D=E5=8F=AF=E4=BB=A5=E8=A2=AB=E9=87=8D=E5=A4=8D=E7=82=B9?= =?UTF-8?q?=E8=B5=9E=EF=BC=8C=E4=B8=94=E7=82=B9=E8=B5=9E=E8=AF=AD=E9=9F=B3?= =?UTF-8?q?=E6=92=AD=E6=8A=A5=E4=B8=8D=E6=AD=A3=E7=A1=AE=20http://jira.zhi?= =?UTF-8?q?daohulian.com/browse/FX-528=20v2x=E4=BA=8B=E4=BB=B6=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E7=82=B9=E8=B5=9E=EF=BC=8C=E7=82=B9=E5=87=BB=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E6=AC=A1=E5=90=8C=E6=A0=B7=E6=8F=90=E7=A4=BA=E2=80=9D?= =?UTF-8?q?=E4=BB=A5=E7=82=B9=E8=B5=9E=E2=80=9C=20http://jira.zhidaohulian?= =?UTF-8?q?.com/browse/D80XCD-1587?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/entity/MarkerExploreWay.java | 11 ++++ .../module/common/entity/V2XEventZanData.java | 51 +++++++++++++++ .../v2x/adapter/holder/V2XBaseViewHolder.java | 24 ++++--- .../v2x/adapter/holder/V2XRoadEventVH.java | 10 ++- .../mogo/module/v2x/utils/V2XSQLiteUtils.java | 65 +++++++++++++++++++ .../main/res/layout/item_v2x_event_detail.xml | 2 +- 6 files changed, 151 insertions(+), 12 deletions(-) create mode 100644 modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventZanData.java diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerExploreWay.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerExploreWay.java index e4c719eb8c..a21132d754 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerExploreWay.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerExploreWay.java @@ -30,6 +30,8 @@ public class MarkerExploreWay implements Serializable { //上报类型:1-用户上报,2-后台上报 3-三方上报 private String uploadType; + private boolean fabulous; + // http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=42321443 // 1 需要用户判断是否拥堵 进行UGC问答 private int infoCheckNode; @@ -200,6 +202,14 @@ public class MarkerExploreWay implements Serializable { this.infoCheckNode = infoCheckNode; } + public boolean isFabulous() { + return fabulous; + } + + public void setFabulous(boolean fabulous) { + this.fabulous = fabulous; + } + @Override public String toString() { return "MarkerExploreWay{" + @@ -218,6 +228,7 @@ public class MarkerExploreWay implements Serializable { ", userInfo=" + userInfo + ", items=" + items + ", uploadType='" + uploadType + '\'' + + ", fabulous=" + fabulous + ", infoCheckNode=" + infoCheckNode + '}'; } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventZanData.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventZanData.java new file mode 100644 index 0000000000..0301db0b9a --- /dev/null +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventZanData.java @@ -0,0 +1,51 @@ +package com.mogo.module.common.entity; + +import com.mogo.utils.sqlite.annotation.DbDatabase; +import com.mogo.utils.sqlite.annotation.DbField; +import com.mogo.utils.sqlite.annotation.DbTable; + +/** + * V2X 被点赞的事件 + * + * @author donghongyu + */ +@DbDatabase(dbName = "MoGoScenario.db") +@DbTable(tableName = "tb_event_zan") +public class V2XEventZanData { + + /** + * 事件ID + */ + @DbField(fieldName = "eventId") + public String eventId; + + /** + * 触发时间 + */ + @DbField(fieldName = "triggerTime") + public Long triggerTime; + + public String getEventId() { + return eventId; + } + + public void setEventId(String eventId) { + this.eventId = eventId; + } + + public Long getTriggerTime() { + return triggerTime; + } + + public void setTriggerTime(Long triggerTime) { + this.triggerTime = triggerTime; + } + + @Override + public String toString() { + return "V2XEventZanData{" + + "eventId=" + eventId + + ", triggerTime=" + triggerTime + + '}'; + } +} diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XBaseViewHolder.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XBaseViewHolder.java index daf41e1b83..475b80bfde 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XBaseViewHolder.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XBaseViewHolder.java @@ -1,6 +1,5 @@ package com.mogo.module.v2x.adapter.holder; -import android.content.Intent; import android.util.Log; import android.view.View; @@ -16,19 +15,20 @@ import com.mogo.map.navi.MogoTraffic; import com.mogo.module.carchattingprovider.ICarsChattingProvider; import com.mogo.module.common.entity.MarkerExploreWay; import com.mogo.module.common.entity.MarkerLocation; +import com.mogo.module.common.entity.V2XEventZanData; import com.mogo.module.v2x.V2XConst; import com.mogo.module.v2x.V2XServiceManager; import com.mogo.module.v2x.utils.ChartingUtil; import com.mogo.module.v2x.utils.RoadConditionUtils; +import com.mogo.module.v2x.utils.TimeUtils; import com.mogo.module.v2x.utils.TrackUtils; +import com.mogo.module.v2x.utils.V2XSQLiteUtils; import com.mogo.module.v2x.utils.V2XUtils; import com.mogo.utils.TipToast; import com.mogo.utils.logger.Logger; import com.zhidao.carchattingprovider.CallChattingProviderConstant; import com.zhidao.carchattingprovider.MogoDriverInfo; -import java.util.HashMap; - import static com.mogo.module.v2x.V2XConst.MODULE_NAME; /** @@ -68,10 +68,18 @@ public abstract class V2XBaseViewHolder AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("已点赞", null); showTip("已点赞"); if (noveltyInfo != null) { + // 调用网络API接口 V2XServiceManager.getV2XMarkerService() .getV2XRefreshModel() .giveLikeLiveVideo(null, noveltyInfo.getSn()); + V2XEventZanData v2XEventZanData = new V2XEventZanData(); + v2XEventZanData.setEventId(noveltyInfo.getInfoId()); + v2XEventZanData.setTriggerTime(TimeUtils.getNowMills()); + V2XSQLiteUtils.saveEventZanLocalStory(v2XEventZanData); + + + // 上报数据统计 TrackUtils.trackV2xRoadEvent( noveltyInfo.getInfoId(), noveltyInfo.getSn(), @@ -84,23 +92,23 @@ public abstract class V2XBaseViewHolder } public void triggerIVReportHead(MarkerExploreWay noveltyInfo) { - Log.d(TAG,"点击头像"+mCarsChattingProvider); + Log.d(TAG, "点击头像" + mCarsChattingProvider); try { mCarsChattingProvider = (ICarsChattingProvider) ARouter.getInstance().build(CallChattingProviderConstant.CAR_CALL_PROVIDER).navigation(); MogoDriverInfo mogoDriverInfo = new MogoDriverInfo(); int ageNumber = noveltyInfo.getUserInfo().getAgeNumber(); mogoDriverInfo.setAge(ageNumber); String gender = noveltyInfo.getUserInfo().getGender(); - mogoDriverInfo.setGender(gender != null ? gender:null); + mogoDriverInfo.setGender(gender != null ? gender : null); String sn = noveltyInfo.getUserInfo().getSn(); - mogoDriverInfo.setSn(sn != null ? sn:""); + mogoDriverInfo.setSn(sn != null ? sn : ""); String name = noveltyInfo.getUserInfo().getUserName(); - mogoDriverInfo.setUserName(name != null ? name:""); + mogoDriverInfo.setUserName(name != null ? name : ""); mogoDriverInfo.setUserHead(noveltyInfo.getUserInfo().getUserHead()); mCarsChattingProvider.showUserWindow(MODULE_NAME, mogoDriverInfo, this.itemView.getContext()); } catch (Exception e) { - Log.d(TAG,"点击头像发生错误--triggerIVReportHead"+e); + Log.d(TAG, "点击头像发生错误--triggerIVReportHead" + e); e.printStackTrace(); } } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventVH.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventVH.java index d92b98d136..19376eb451 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventVH.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XRoadEventVH.java @@ -24,10 +24,9 @@ import com.mogo.module.v2x.scenario.scene.livecar.V2XRoadLiveCarScenario; import com.mogo.module.v2x.scenario.scene.road.V2XRoadEventScenario; import com.mogo.module.v2x.scenario.scene.road.V2XRoadEventWindow; import com.mogo.module.v2x.scenario.scene.road.V2XRoadVideoCarScenario; -import com.mogo.module.v2x.scenario.scene.road.V2XRoadVideoWindow; import com.mogo.module.v2x.utils.ChartingUtil; import com.mogo.module.v2x.utils.EventTypeUtils; -import com.mogo.module.v2x.utils.SpanUtils; +import com.mogo.module.v2x.utils.V2XSQLiteUtils; import com.mogo.module.v2x.view.HeartLikeView; import com.mogo.module.v2x.voice.V2XVoiceCallbackListener; import com.mogo.module.v2x.voice.V2XVoiceConstants; @@ -256,7 +255,12 @@ public class V2XRoadEventVH extends V2XBaseViewHolder { ivEventReportTrue.setVisibility(GONE); ivEventReportErr.setVisibility(GONE); - ivEventZan.setVisibility(VISIBLE); + + if (V2XSQLiteUtils.isZanEvent(mNoveltyInfo.getInfoId())) { + ivEventZan.setVisibility(GONE); + } else { + ivEventZan.setVisibility(VISIBLE); + } // 用户上报的才会展示拨打电话 if (!TextUtils.isEmpty(mNoveltyInfo.getUploadType()) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/V2XSQLiteUtils.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/V2XSQLiteUtils.java index 1be148ea12..374db86fa8 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/V2XSQLiteUtils.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/V2XSQLiteUtils.java @@ -1,5 +1,6 @@ package com.mogo.module.v2x.utils; +import com.mogo.module.common.entity.V2XEventZanData; import com.mogo.module.common.entity.V2XHistoryScenarioData; import com.mogo.module.v2x.V2XConst; import com.mogo.module.v2x.fragment.V2XEventPanelFragment; @@ -21,6 +22,11 @@ public class V2XSQLiteUtils { */ private static SQLIDao mScenarioHistoryDao; + /** + * 点赞数据管理 + */ + private static SQLIDao mV2XEventZanDao; + /** * 场景数据管理 */ @@ -36,6 +42,21 @@ public class V2XSQLiteUtils { return mScenarioHistoryDao; } + /** + * 点赞数据管理 + */ + public static SQLIDao getV2XEventZanDao() { + if (mV2XEventZanDao == null) { + synchronized (V2XSQLiteUtils.class) { + if (mV2XEventZanDao == null) { + mV2XEventZanDao = SQLDaoFactory.Companion.getInstance() + .getBaseDao(V2XUtils.getApp(), V2XEventZanData.class); + } + } + } + return mV2XEventZanDao; + } + /** * 删除数据库中存储的昨天的数据 */ @@ -153,4 +174,48 @@ public class V2XSQLiteUtils { e.printStackTrace(); } } + + /** + * 存储本地数据 + * + * @param v2XEventZanData 要存储的场景 + */ + public static void saveEventZanLocalStory(V2XEventZanData v2XEventZanData) { + try { + if (!isZanEvent(v2XEventZanData.eventId)) { + // 进行数据库存储 + V2XSQLiteUtils.getV2XEventZanDao().insert(v2XEventZanData); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 判断是否已经存在 + * + * @param eventId 要判断的事件ID + * @return true-已存在,false-没存在 + */ + public static boolean isZanEvent(String eventId) { + try { + // 查询数据库,判断是否存在 + for (V2XEventZanData eventZanDatum : getEventZanData()) { + if (eventZanDatum.eventId.equals(eventId)) { + return true; + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + /** + * 查询当天的V2X数据 + */ + public static List getEventZanData() { + return getV2XEventZanDao().query(new V2XEventZanData()); + } + } diff --git a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail.xml b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail.xml index 99867b46ab..bc25522ee9 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail.xml @@ -161,7 +161,7 @@ android:layout_width="@dimen/module_v2x_event_button_size_detail" android:layout_height="@dimen/module_v2x_event_button_size_detail" android:padding="@dimen/dp_15" - android:src="@drawable/v2x_selector_icon_report_err_light" + android:src="@drawable/v2x_selector_icon_report_err" android:visibility="gone" app:layout_constraintBottom_toBottomOf="@+id/ivEventLive" app:layout_constraintStart_toEndOf="@id/ivEventReportTrue"