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 ae0c326c62..a297d23717 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 @@ -373,15 +373,24 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL mMogoRegisterCenter.registerMogoMarkerClickListener(TanluConstants.MODEL_NAME, new IMogoMarkerClickListener() { @Override public boolean onMarkerClicked(IMogoMarker marker) { - GSYVideoManager.releaseAllVideos(); - initVideo(); - releaseTimer(); - //埋点 - Map properties = new HashMap<>(); - properties.put("type", "2"); - mAnalytics.track(TanluConstants.LAUNCHER_ICON_CLICK, properties); + //点击的marker的具体数据 MarkerExploreWay exploreWay = extractFromMarker(marker); + V2XRoadEventEntity roadEventEntity = new V2XRoadEventEntity(); + roadEventEntity.setNoveltyInfo(exploreWay); + roadEventEntity.setPoiType(exploreWay.getPoiType()); + roadEventEntity.setExpireTime(20000); + //地理位置 + MarkerLocation location = exploreWay.getLocation(); + roadEventEntity.setLocation(location); + + V2XMessageEntity v2XMessageEntity = new V2XMessageEntity(); + v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING); + v2XMessageEntity.setShowState(true); + v2XMessageEntity.setOnlyShow(true); + v2XMessageEntity.setNeedAddLine(false); + + v2XMessageEntity.setContent(roadEventEntity); //更新数据 if (markerExploreWayList != null) { markerExploreWayList.clear(); @@ -390,48 +399,20 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL } markerExploreWayList.add(exploreWay); - boolean isAdd = TanluServiceManager.getIMogoTopViewManager().isViewAdded(TanluListWindow.this); - hideWindowTimerStart(); - Logger.d(TAG, "onMarkerClicked ------ isAdd = " + isAdd); + Intent intent = new Intent(Const.BROADCAST_SCENE_HANDLER_ACTION); + intent.putExtra(Const.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); + LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent); - //添加window窗口,重复创建 - if (!isAdd) { - ViewGroup.LayoutParams layoutParams = - new ViewGroup.LayoutParams( - ViewGroup.LayoutParams.MATCH_PARENT, - (int) getContext().getResources().getDimension((R.dimen.tanlu_module_card_height))); - TanluServiceManager.getIMogoTopViewManager().addView(TanluListWindow.this, layoutParams, new IMogoTopViewStatusListener() { - @Override - public void onViewAdded(View view) { - Logger.d(TAG, "onViewAdded -------->"); - } - - @Override - public void onViewRemoved(View view) { - Logger.e(TAG, "onViewRemoved -------->"); - releaseTimer(); - releaseAction(); - } - - @Override - public void beforeViewAddAnim(View view) { - - } - - @Override - public void beforeViewRemoveAnim(View view) { - - } - }); - - } - - renderCardViews(); + //埋点 + Map properties = new HashMap<>(); + properties.put("type", "2"); + mAnalytics.track(TanluConstants.LAUNCHER_ICON_CLICK, properties); return false; } }); } + private CountDownTimer mHideWindowTimer; private void hideWindowTimerStart() { diff --git a/modules/mogo-module-v2x/src/main/res/layout/window_push_event_detail.xml b/modules/mogo-module-v2x/src/main/res/layout/window_push_event_detail.xml index 20b5ac78b9..b8244cb9c5 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/window_push_event_detail.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/window_push_event_detail.xml @@ -7,5 +7,6 @@ android:layout_height="@dimen/module_v2x_event_window_height_ground" android:orientation="horizontal" android:overScrollMode="never" + android:padding="@dimen/module_v2x_widow_top_gaps" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" tools:listitem="@layout/item_v2x_push_event_detail" />