From c32448dfc62fa0f1c82e3dc2f3e4f9078f733b4a Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Thu, 13 Aug 2020 10:06:42 +0800 Subject: [PATCH] opt --- .../roadcondition/service/MainService.kt | 6 +- .../tanlu/fragment/TanluListWindow.java | 75 ++++++++++--------- .../scene/road/V2XRoadEventScenario.java | 2 +- 3 files changed, 44 insertions(+), 39 deletions(-) diff --git a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainService.kt b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainService.kt index 2011b50422..6b1d364db3 100644 --- a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainService.kt +++ b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainService.kt @@ -96,7 +96,11 @@ class MainService : Service() { || shareType == TANLU_ROAD_ACCIDENT || shareType == TANLU_ROAD_WORK ) { // takePhoto(1, false, true) - takeVideo(it.duration, isCustom = true, id = id) + if (!fromType.equals("5")) { // 是策略触发,不提示 + takeVideo(it.duration, isCustom = true, id = id) + } else { + takeVideo(it.duration) + } } } } else { diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluListWindow.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluListWindow.java index 3f53375103..6440669f53 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluListWindow.java +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluListWindow.java @@ -1065,53 +1065,54 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL String fromType = event.fromType; boolean isCumtom = event.isCumtom; Logger.d(TAG, "onMarkerInfo share poiType = " + poiType + " --isCumtom = " + isCumtom + " >> getMathRandom = " + getMathRandom() + " >>> bearing = " + bearing + ">>>fromType = " + fromType); - if (isCumtom && !poiType.equals("0")) { - double lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude(); - double lon = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude(); - Log.d(TAG, "onMarkerInfo lat = " + lat + " >>>> lon = " + lon); - String cityName = TanluServiceManager.getLocationClient().getLastKnowLocation().getCityName(); - String address = TanluServiceManager.getLocationClient().getLastKnowLocation().getAddress(); - MarkerExploreWay markerExploreWay = new MarkerExploreWay(); - markerExploreWay.setCityName(cityName); - markerExploreWay.setPoiType(poiType); + if (!fromType.equals("5")) { + if (isCumtom && !poiType.equals("0")) { + double lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude(); + double lon = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude(); + Log.d(TAG, "onMarkerInfo lat = " + lat + " >>>> lon = " + lon); + String cityName = TanluServiceManager.getLocationClient().getLastKnowLocation().getCityName(); + String address = TanluServiceManager.getLocationClient().getLastKnowLocation().getAddress(); + MarkerExploreWay markerExploreWay = new MarkerExploreWay(); + markerExploreWay.setCityName(cityName); + markerExploreWay.setPoiType(poiType); - MarkerLocation markerLocation = new MarkerLocation(); - markerLocation.setLat(lat); - markerLocation.setLon(lon); - markerLocation.setAddress(address); + MarkerLocation markerLocation = new MarkerLocation(); + markerLocation.setLat(lat); + markerLocation.setLon(lon); + markerLocation.setAddress(address); - MarkerShowEntity markerShowEntity = new MarkerShowEntity(); - markerShowEntity.setBindObj(markerExploreWay); - markerShowEntity.setTextContent(address); - markerShowEntity.setMarkerType(TanluConstants.MODEL_NAME); - markerShowEntity.setMarkerLocation(markerLocation); + MarkerShowEntity markerShowEntity = new MarkerShowEntity(); + markerShowEntity.setBindObj(markerExploreWay); + markerShowEntity.setTextContent(address); + markerShowEntity.setMarkerType(TanluConstants.MODEL_NAME); + markerShowEntity.setMarkerLocation(markerLocation); - if (!fromType.equals("5")) { AIAssist.getInstance(getContext()).speakTTSVoice(( String.format(voiceShareSuccessTts, getMathRandom())), null); TipToast.shortTip("分享成功"); - } - IMogoMarker mogoMarker = TanluServiceManager.getServiceApis().getMarkerService().drawMarker(markerShowEntity); - mogoMarker.setClickable(false); - //开启动画 - mogoMarker.startScaleAnimationWithAlpha(0, 1.2f, 0, 1.2f, 0f, 1f, 300, new LinearInterpolator(), new OnMarkerAnimationListener() { - @Override - public void onAnimStart() { - Logger.d(TAG, " onAnimStart ---1----> "); - } + IMogoMarker mogoMarker = TanluServiceManager.getServiceApis().getMarkerService().drawMarker(markerShowEntity); + mogoMarker.setClickable(false); - @Override - public void onAnimEnd() { - if (mogoMarker.isDestroyed()) { - return; + //开启动画 + mogoMarker.startScaleAnimationWithAlpha(0, 1.2f, 0, 1.2f, 0f, 1f, 300, new LinearInterpolator(), new OnMarkerAnimationListener() { + @Override + public void onAnimStart() { + Logger.d(TAG, " onAnimStart ---1----> "); } - mogoMarker.startScaleAnimation(1.2f, 1, 1.2f, 1, 100, new LinearInterpolator(), null); - } - }); - } else { - Logger.e(TAG, "onMarkerInfo share onCompleted poiType = -1 --- else ---->"); + + @Override + public void onAnimEnd() { + if (mogoMarker.isDestroyed()) { + return; + } + mogoMarker.startScaleAnimation(1.2f, 1, 1.2f, 1, 100, new LinearInterpolator(), null); + } + }); + } else { + Logger.e(TAG, "onMarkerInfo share onCompleted poiType = -1 --- else ---->"); + } } } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventScenario.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventScenario.java index 855303c8bc..52ef87731e 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventScenario.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventScenario.java @@ -63,7 +63,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp if (v2XRoadEventEntity != null) { //只上报事故 if (v2XRoadEventEntity.getPoiType() != null && v2XRoadEventEntity.getPoiType().equals(MarkerPoiTypeEnum.FOURS_ACCIDENT)) { - V2XServiceManager.getMoGoStatusManager().setUploadingStatus(ServiceConst.CARD_TYPE_ROAD_CONDITION, true); +// V2XServiceManager.getMoGoStatusManager().setUploadingStatus(ServiceConst.CARD_TYPE_ROAD_CONDITION, true); TanluUploadParams params = new TanluUploadParams(v2XRoadEventEntity.getPoiType(), IMogoTanluProvider.UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO); V2XServiceManager.getTanluManager().uploadRoadCondition(params);