From 9fc4cd3cba32c8ba7b819bf399430e8e4bee07ab Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Fri, 20 Nov 2020 16:02:51 +0800 Subject: [PATCH] opt --- .../v2x/adapter/V2XSurroundingAdapter.java | 7 +- .../v2x/fragment/V2XEventPanelFragment.kt | 115 ++++++- .../v2x/fragment/V2XSurroundingFragment.java | 168 ++++------ .../SurroundingItemClickListener.java | 2 +- .../bg_v2x_surrounding_event_list_item.xml | 6 + .../drawable/bg_v2x_surrounding_road_type.xml | 8 + ...odule_event_panel_fragment_surrounding.xml | 291 +++++++----------- ...e_v2x_event_panel_fragment_event_panel.xml | 47 ++- ...dule_v2x_event_surrounding_detail_item.xml | 22 +- .../drawable-ldpi/v2x_back_image_light.png | Bin 0 -> 1457 bytes .../drawable-mdpi/v2x_back_image_light.png | Bin 0 -> 1457 bytes ..._v2x_surrounding_event_list_item_light.xml | 6 + 12 files changed, 370 insertions(+), 302 deletions(-) create mode 100644 modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_surrounding_event_list_item.xml create mode 100644 modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_surrounding_road_type.xml create mode 100644 skin/mogo-skin-light/src/main/module-v2x-res/drawable-ldpi/v2x_back_image_light.png create mode 100644 skin/mogo-skin-light/src/main/module-v2x-res/drawable-mdpi/v2x_back_image_light.png create mode 100644 skin/mogo-skin-light/src/main/module-v2x-res/drawable/bg_v2x_surrounding_event_list_item_light.xml diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XSurroundingAdapter.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XSurroundingAdapter.java index 2fefe935c1..fa111adadc 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XSurroundingAdapter.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XSurroundingAdapter.java @@ -74,16 +74,11 @@ public class V2XSurroundingAdapter extends RecyclerView.Adapter() + private val mV2XScenarioHistoryFragment = V2XScenarioHistoryFragment() private val mV2XShareEventsFragment = V2XShareEventsFragment() private val mV2XSurroundingFragment = V2XSurroundingFragment() @@ -77,6 +101,11 @@ class V2XEventPanelFragment : MvpFragment try { @@ -120,6 +149,12 @@ class V2XEventPanelFragment : MvpFragment "封路" + MarkerPoiTypeEnum.FOURS_ICE -> "道路结冰" + MarkerPoiTypeEnum.FOURS_FOG -> "浓雾" + MarkerPoiTypeEnum.TRAFFIC_CHECK -> "交通检查" + MarkerPoiTypeEnum.FOURS_ACCIDENT -> "交通事故" + MarkerPoiTypeEnum.FOURS_BLOCK_UP -> "拥堵" + MarkerPoiTypeEnum.FOURS_ROAD_WORK -> "施工" + MarkerPoiTypeEnum.FOURS_PONDING -> "道路积水" + MarkerPoiTypeEnum.FOURS_LIVING -> "实时路况" + else -> "实时路况" + } + return typeName + } + private fun selectWithItem(item: Int) { when (item) { 0 -> { diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XSurroundingFragment.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XSurroundingFragment.java index a9d2cfd849..92ebcde361 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XSurroundingFragment.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XSurroundingFragment.java @@ -26,6 +26,7 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.alibaba.android.arouter.launcher.ARouter; +import com.mogo.commons.debug.DebugConfig; import com.mogo.commons.mvp.MvpFragment; import com.mogo.commons.voice.AIAssist; import com.mogo.map.MogoLatLng; @@ -53,6 +54,8 @@ import com.mogo.service.MogoServicePaths; import com.mogo.utils.WorkThreadHandler; import com.mogo.utils.logger.Logger; +import org.greenrobot.eventbus.EventBus; + import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -82,14 +85,6 @@ public class V2XSurroundingFragment extends MvpFragment markerExploreWays = new ArrayList<>(); - - @Override protected int getLayoutId() { @@ -118,13 +113,6 @@ public class V2XSurroundingFragment extends MvpFragment 0) { AIAssist.getInstance(V2XUtils.getApp()). speakTTSVoice("为您找到周边以下事件请查看", null); @@ -323,99 +300,76 @@ public class V2XSurroundingFragment extends MvpFragment "); + } + + @Override + public void onAnimEnd() { + if (mogoMarker.isDestroyed()) { + return; + } + Logger.d(TAG, " onItemClickListener onAnimEnd ------> "); + mogoMarker.startScaleAnimation(1.2f, 1, 1.2f, 1, 100, new LinearInterpolator(), null); + } + }); + mogoMarker.setOwner(markerShowEntity.getMarkerType()); + mogoMarker.setObject(markerShowEntity); + } + }, i * 100L); + } + + //自适应显示 + showBonndsRoadtion(exploreWayList); + } else { + Logger.e(TAG, "onItemClickListener exploreWayList == null"); + } + } catch (Exception e) { + e.printStackTrace(); + } + } } } -// @Override -// public void onItemClickListener(View v, int position, SurroundingConstruction construction) { -// if (construction != null) { -// //卡片消失 -// V2XEventPanelFragment.Companion.getInstance().hidePanel(); -// //清除道路事件 -// V2XServiceManager.getMarkerManager().removeMarkers(ServiceConst.CARD_TYPE_ROAD_CONDITION); -// -// try { -// //处理 marker的显示 -// List exploreWayList = construction.getConstrutList(); -// Logger.d(TAG, "onItemClickListener exploreWayList.size() = " + exploreWayList.size()); -// if (exploreWayList != null && exploreWayList.size() > 0) { -// for (int i = 0; i < exploreWayList.size(); i++) { -// MarkerExploreWay exploreWay = exploreWayList.get(i); -// MarkerShowEntity markerShowEntity = new MarkerShowEntity(); -// markerShowEntity.setBindObj(exploreWay); -// markerShowEntity.setChecked(false); -// markerShowEntity.setTextContent(exploreWay.getAddr()); -// markerShowEntity.setMarkerLocation(exploreWay.getLocation()); -// markerShowEntity.setMarkerType(ServiceConst.CARD_TYPE_ROAD_CONDITION); -// -// WorkThreadHandler.getInstance().postDelayed(() -> { -// IMogoMarker mogoMarker = V2XServiceManager.getIMogoMarkerService().drawMarker(markerShowEntity); -// // 点击监听,天际弹窗展示详情 -// if (mogoMarker != null) { -// mogoMarker.startScaleAnimation(0, 1.2f, 0, 1.2f, 300, new AccelerateInterpolator(), new OnMarkerAnimationListener() { -// @Override -// public void onAnimStart() { -// Logger.d(TAG, " onItemClickListener onAnimStart -----> "); -// } -// -// @Override -// public void onAnimEnd() { -// if (mogoMarker.isDestroyed()) { -// return; -// } -// Logger.d(TAG, " onItemClickListener onAnimEnd ------> "); -// mogoMarker.startScaleAnimation(1.2f, 1, 1.2f, 1, 100, new LinearInterpolator(), null); -// } -// }); -// mogoMarker.setOwner(markerShowEntity.getMarkerType()); -// mogoMarker.setObject(markerShowEntity); -// } -// }, i * 100L); -// } -// -// //自适应显示 -// showBonndsRoadtion(exploreWayList); -// } else { -// Logger.e(TAG, "onItemClickListener exploreWayList == null"); -// } -// } catch (Exception e) { -// e.printStackTrace(); -// } -// } -// } - - /** * 自适应显示 * diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/SurroundingItemClickListener.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/SurroundingItemClickListener.java index 83eef72f09..3ebf7bccf3 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/SurroundingItemClickListener.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/SurroundingItemClickListener.java @@ -10,5 +10,5 @@ import com.mogo.module.v2x.entity.panel.SurroundingConstruction; * @since 2020/8/10 */ public interface SurroundingItemClickListener { - void onItemClickListener(View v, int position, SurroundingConstruction construction, String poiType); + void onItemClickListener(View v, int position, SurroundingConstruction construction); } diff --git a/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_surrounding_event_list_item.xml b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_surrounding_event_list_item.xml new file mode 100644 index 0000000000..d1f0a2354f --- /dev/null +++ b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_surrounding_event_list_item.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_surrounding_road_type.xml b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_surrounding_road_type.xml new file mode 100644 index 0000000000..e789d681a3 --- /dev/null +++ b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_surrounding_road_type.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/res/layout/module_event_panel_fragment_surrounding.xml b/modules/mogo-module-v2x/src/main/res/layout/module_event_panel_fragment_surrounding.xml index dca25c89b9..d335682a1c 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/module_event_panel_fragment_surrounding.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/module_event_panel_fragment_surrounding.xml @@ -5,201 +5,148 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - + - - + - + android:layout_height="@dimen/module_v2x_surrounding_top_height" + android:visibility="visible"> + + + + + android:layout_width="@dimen/module_v2x_surrounding_top_bt_width" + android:layout_height="@dimen/module_v2x_surrounding_top_bt_height" + android:layout_alignParentRight="true" + android:layout_centerVertical="true" + android:layout_marginEnd="@dimen/module_v2x_surrounding_margin_left" + android:background="@drawable/bg_v2x_refresh" + android:gravity="center"> + + + + + + + + + + + + + + + + - + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_below="@+id/tv_main_empty_2" + android:layout_marginTop="@dimen/module_v2x_surrounding_empty_bt_margin_top"> + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_surrounding_detail_item.xml b/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_surrounding_detail_item.xml index 3753401c25..cf502b43fc 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_surrounding_detail_item.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_surrounding_detail_item.xml @@ -5,7 +5,7 @@ android:id="@+id/surrounding_root" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/bg_v2x_event_list_item"> + android:background="@drawable/bg_v2x_surrounding_event_list_item"> + tools:text="小黄庄北街与北三环辅路交叉口" /> + tools:text="小蘑菇" /> @@ -51,14 +53,14 @@ android:id="@+id/surrounding_road_type" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginStart="@dimen/dp_36" - android:layout_marginTop="@dimen/dp_12" + android:layout_marginStart="20px" + android:layout_marginTop="6px" android:layout_marginBottom="@dimen/dp_36" android:background="@drawable/bg_v2x_event_type_read" android:gravity="center" - android:paddingLeft="5px" + android:paddingLeft="6px" android:paddingTop="3px" - android:paddingRight="5px" + android:paddingRight="6px" android:paddingBottom="3px" android:text="违章停车" android:textColor="#ffffff" diff --git a/skin/mogo-skin-light/src/main/module-v2x-res/drawable-ldpi/v2x_back_image_light.png b/skin/mogo-skin-light/src/main/module-v2x-res/drawable-ldpi/v2x_back_image_light.png new file mode 100644 index 0000000000000000000000000000000000000000..532c21499dc08beb93261b81220bbef66801f4fd GIT binary patch literal 1457 zcmV;i1y1^jP)Px)Ye_^wR9FecSj|slMG)WjnAriAkHP51h#P~(Y&4P(HH1L8f_#M&#CY(c7w>!Y zPw=(}FM9D{44epGLcEa>4oX%r8naPC)-?tf`I-UN*V`hC9v>|~~^tE#Ji z-Cb4PudiKuT4rWuTIS~FZcE!Dv9Pf4mM~b4kB@(6Q&X7z{r&HfrlMUa6gt@`7K=^m z>+4^UX0azHCx0PvaBy%+A!!z83=(=AjzOMNAb6uzt2v6+($Z4f`T6;)B4lj~V`ymT zGZENAb^O~rDmA4IA2g4n7X=c&Ckzw0{Zis zY0{Ez$WJ;zsx?kJ05ux~OgZOGN(WY%nkhq4$KvuVt@Dw{f!y;gfS-gZUrLrfE5K?63gP%GxM^xR*DrqiMRU zyLnom>9j`Kx4pgnxk$rVjM6YX$wwMqTU+}aqu=Z3=(r=7 z`6R~C=OofFjqv)L);JKC=oL@mP^2}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