修复了因为用户没有点击操作导致ugc数据过多的问题

This commit is contained in:
董宏宇
2020-11-13 10:51:30 +08:00
parent d553cb31b3
commit 468d8b7000

View File

@@ -14,7 +14,6 @@ import com.mogo.module.common.entity.V2XEventShowEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.alarm.V2XEarlyWarningServer;
import com.mogo.module.v2x.scenario.scene.ugc.V2XEventUgcScenario;
import com.mogo.module.v2x.utils.EventTypeUtils;
import com.mogo.module.v2x.utils.V2XUtils;
@@ -54,6 +53,10 @@ public class V2XEventUgcVH extends V2XBaseViewHolder<V2XEventShowEntity> {
private V2XEventShowEntity mV2XEventShowEntity;
// 判断用户是否点击了,如果没有点击的话就自动设置为无效
private boolean isFeedbackClick;
public V2XEventUgcVH(ViewGroup viewGroup) {
super(LayoutInflater.from(viewGroup.getContext())
.inflate(R.layout.item_v2x_event_ugc, viewGroup, false));
@@ -85,6 +88,11 @@ public class V2XEventUgcVH extends V2XBaseViewHolder<V2XEventShowEntity> {
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_YES_UN_WAKEUP)
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_FEEDBACK_SHI_GONG_NO_UN_WAKEUP);
// 如果用户没有点击则自动设置为无效
if (!isFeedbackClick) {
manualMarkingTrafficJam(0);
}
}
});
}
@@ -93,7 +101,7 @@ public class V2XEventUgcVH extends V2XBaseViewHolder<V2XEventShowEntity> {
public void initView(V2XEventShowEntity v2XEventShowEntity) {
try {
Log.w(MODULE_NAME + "_" + TAG, "v2XEventShowEntity=" + GsonUtil.jsonFromObject(v2XEventShowEntity));
isFeedbackClick = false;
if (v2XEventShowEntity == null) {
return;
}
@@ -127,12 +135,14 @@ public class V2XEventUgcVH extends V2XBaseViewHolder<V2XEventShowEntity> {
ivEventReportTrue.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
isFeedbackClick = true;
manualMarkingTrafficJam(1);
}
});
ivEventReportErr.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
isFeedbackClick = true;
manualMarkingTrafficJam(0);
}
});