This commit is contained in:
lixiaopeng
2020-08-13 14:39:13 +08:00
parent 08122ab033
commit beef3621e1
6 changed files with 127 additions and 54 deletions

View File

@@ -100,6 +100,8 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
public void onFail(String msg) {
// loadingError(true);
}
});
}

View File

@@ -50,6 +50,7 @@ import com.mogo.utils.logger.Logger;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -165,6 +166,7 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
@Override
public void showSurroudingData(List<MarkerExploreWay> exploreWayList) {
mV2XAnimationManager.stop();
mloadingImage.setVisibility(View.GONE);
if (exploreWayList != null && exploreWayList.size() > 0) {
//展示数据
mTopLayout.setVisibility(View.VISIBLE);
@@ -211,10 +213,55 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
private List<SurroundingConstruction> handleMapToList(Map<String, SurroundingConstruction> map) {
Collection<? extends SurroundingConstruction> valueCollection = map.values();
List<SurroundingConstruction> valueList = new ArrayList<>(valueCollection);
List<SurroundingConstruction> list = new ArrayList<>(valueCollection);
List<SurroundingConstruction> resultSurroundingList = new ArrayList<>();
List<SurroundingConstruction> outSurroundingList = new ArrayList<>();
Log.d(TAG, "handleMapToList valueList.size() = " + valueList.size());
return valueList;
if (list != null && list.size() > 0) {
List<String> prioritySorts = prioritySort();
for (String poiType : prioritySorts) {
for (SurroundingConstruction construction : list) {
if (!prioritySorts.contains(construction.getPoiType())) {
outSurroundingList.add(construction);
continue;
} else if (poiType.equals(construction.getPoiType())) {
resultSurroundingList.add(construction);
}
}
}
}
if (outSurroundingList != null && outSurroundingList.size() > 0) {
resultSurroundingList.addAll(outSurroundingList);
}
Log.d(TAG, "handleMapToList resultSurroundingList.size() = " + resultSurroundingList.size());
return resultSurroundingList;
}
public static List<String> prioritySort() {
List<String> poiTypes = new LinkedList<>();
// 封路
poiTypes.add("10003");
// 结冰
poiTypes.add("10011");
// 浓雾
poiTypes.add("10010");
// 交通检查
poiTypes.add("10002");
// 交通事故
poiTypes.add("10013");
// 拥堵
poiTypes.add("10007");
// 道路施工
poiTypes.add("10006");
// 积水
poiTypes.add("10008");
//实时路况
poiTypes.add("10015");
return poiTypes;
}
/**

View File

@@ -62,12 +62,12 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
V2XRoadEventEntity v2XRoadEventEntity = v2XMessageEntity.getContent();
if (v2XRoadEventEntity != null) {
//只上报事故
if (v2XRoadEventEntity.getPoiType() != null && v2XRoadEventEntity.getPoiType().equals(MarkerPoiTypeEnum.FOURS_ACCIDENT)) {
// 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);
}
// if (v2XRoadEventEntity.getPoiType() != null && v2XRoadEventEntity.getPoiType().equals(MarkerPoiTypeEnum.FOURS_ACCIDENT)) {
//// 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);
// }
if (v2XMessageEntity.isShowState()) {
if (!isSameScenario(v2XMessageEntity)) {

View File

@@ -10,30 +10,30 @@
<RelativeLayout
android:id="@+id/layout_top"
android:layout_width="match_parent"
android:layout_height="35px"
android:layout_height="@dimen/module_v2x_surrounding_top_height"
android:visibility="gone">
<TextView
android:id="@+id/tv_brief"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20px"
android:textSize="18px"
android:layout_marginLeft="@dimen/module_v2x_surrounding_margin_left"
android:text="周围5公里共15条交通信息"
android:textColor="@color/white" />
android:textColor="@color/white"
android:textSize="@dimen/module_v2x_surrounding_top_textsize" />
<TextView
android:id="@+id/tv_top_refresh"
android:layout_width="90px"
android:layout_height="36px"
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_centerInParent="true"
android:layout_marginRight="20px"
android:layout_marginRight="@dimen/module_v2x_surrounding_margin_left"
android:background="@drawable/bg_v2x_refresh"
android:gravity="center"
android:text="@string/v2x_surrounding_refresh"
android:textColor="@color/white"
android:textSize="18px"
android:textSize="@dimen/module_v2x_surrounding_top_textsize"
android:textStyle="bold" />
</RelativeLayout>
@@ -42,11 +42,11 @@
android:id="@+id/list_layout_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="15px"
android:layout_marginLeft="10px"
android:layout_marginRight="10px"
android:layout_marginBottom="20px"
android:layout_below="@+id/layout_top">
android:layout_below="@+id/layout_top"
android:layout_marginLeft="@dimen/module_v2x_surrounding_root_margin_left"
android:layout_marginTop="@dimen/module_v2x_surrounding_empty_tv_margin_top"
android:layout_marginRight="@dimen/module_v2x_surrounding_root_margin_left"
android:layout_marginBottom="@dimen/module_v2x_surrounding_margin_left">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/surrounding_recycleview"
@@ -65,10 +65,10 @@
<ImageView
android:id="@+id/iv_empty"
android:layout_width="200px"
android:layout_height="200px"
android:layout_width="@dimen/module_v2x_surrounding_empty_image_height"
android:layout_height="@dimen/module_v2x_surrounding_empty_image_height"
android:layout_centerHorizontal="true"
android:layout_marginTop="59px"
android:layout_marginTop="@dimen/module_v2x_surrounding_empty_iv_margin_top"
android:src="@drawable/mogo_image_blank_nor" />
<TextView
@@ -77,11 +77,11 @@
android:layout_height="wrap_content"
android:layout_below="@+id/iv_empty"
android:layout_centerHorizontal="true"
android:layout_marginTop="15px"
android:layout_marginTop="@dimen/module_v2x_surrounding_empty_tv_margin_top"
android:gravity="center_horizontal"
android:text="周边5公里暂无交通事件"
android:textColor="@color/white"
android:textSize="18px"
android:textSize="@dimen/module_v2x_surrounding_top_textsize"
android:textStyle="bold" />
<TextView
@@ -94,47 +94,46 @@
android:gravity="center_horizontal"
android:text="你可以试着分享一个事件给其他车主"
android:textColor="@color/white"
android:textSize="18px"
android:textSize="@dimen/module_v2x_surrounding_top_textsize"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_main_share"
android:layout_width="150px"
android:layout_height="48px"
android:layout_width="@dimen/module_v2x_surrounding_empty_bt_width"
android:layout_height="@dimen/module_v2x_surrounding_empty_bt_height"
android:layout_below="@+id/tv_main_empty_2"
android:layout_marginLeft="70px"
android:layout_marginTop="32px"
android:layout_marginLeft="@dimen/module_v2x_surrounding_empty_bt_maigin_left"
android:layout_marginTop="@dimen/module_v2x_surrounding_empty_bt_margin_top"
android:background="@drawable/bg_v2x_go_to_share"
android:gravity="center"
android:text="@string/v2x_surrounding_go_to_share"
android:textColor="@color/white"
android:textSize="18px"
android:textSize="@dimen/module_v2x_surrounding_top_textsize"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_main_refresh"
android:layout_width="150px"
android:layout_height="48px"
android:layout_width="@dimen/module_v2x_surrounding_empty_bt_width"
android:layout_height="@dimen/module_v2x_surrounding_empty_bt_height"
android:layout_below="@+id/tv_main_empty_2"
android:layout_alignParentRight="true"
android:layout_marginTop="32px"
android:layout_marginRight="70px"
android:layout_marginTop="@dimen/module_v2x_surrounding_empty_bt_margin_top"
android:layout_marginRight="@dimen/module_v2x_surrounding_empty_bt_maigin_left"
android:background="@drawable/bg_v2x_refresh"
android:gravity="center"
android:text="@string/v2x_surrounding_refresh"
android:textColor="@color/white"
android:textSize="18px"
android:textSize="@dimen/module_v2x_surrounding_top_textsize"
android:textStyle="bold" />
</RelativeLayout>
</RelativeLayout>
<ImageView
android:layout_height="200px"
android:layout_width="200px"
android:visibility="gone"
android:id="@+id/loading_iv"
android:layout_centerInParent="true" >
</ImageView>
android:layout_width="200px"
android:layout_height="200px"
android:layout_centerInParent="true"
android:visibility="gone"/>
</RelativeLayout>

View File

@@ -2,25 +2,25 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:layout_width="wrap_content"
android:layout_height="173px">
android:layout_height="@dimen/module_v2x_surrounding_item_height">
<ImageView
android:id="@+id/iv_event_bg"
android:scaleType="center"
android:scaleType="fitXY"
android:layout_width="match_parent"
android:layout_height="130px" />
android:layout_height="@dimen/module_v2x_surrounding_item_image_height" />
<RelativeLayout
android:layout_below="@+id/iv_event_bg"
android:background="@drawable/bg_v2x_event_surrounding_item_bottom"
android:layout_width="match_parent"
android:layout_height="43px">
android:layout_height="@dimen/module_v2x_surrounding_item_bottom">
<ImageView
android:id="@+id/iv_event_type"
android:layout_width="26px"
android:layout_height="26px"
android:layout_marginLeft="10px"
android:layout_width="@dimen/module_v2x_surrounding_item_bottom_image_height"
android:layout_height="@dimen/module_v2x_surrounding_item_bottom_image_height"
android:layout_marginLeft="@dimen/module_v2x_surrounding_item_marigin_left"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:src="@drawable/icon_default_black_logo" />
@@ -31,8 +31,8 @@
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_toRightOf="@+id/iv_event_type"
android:layout_marginLeft="8px"
android:textSize="20px"
android:layout_marginLeft="@dimen/module_v2x_surrounding_item_marigin_bottom_left"
android:textSize="@dimen/module_v2x_surrounding_item_bottom_left_textsize"
android:textColor="@color/white"
android:text="求助" />
@@ -41,9 +41,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="12px"
android:layout_marginRight="@dimen/module_v2x_surrounding_item_marigin_left"
android:layout_centerVertical="true"
android:textSize="16px"
android:textSize="@dimen/module_v2x_surrounding_item_bottom_right_textsize"
android:textColor="@color/transparent_white_30"
android:text="23条" />
</RelativeLayout>

View File

@@ -30,4 +30,29 @@
<dimen name="module_v2x_map_right">200px</dimen>
<dimen name="module_v2x_map_bottom">100px</dimen>
<dimen name="module_v2x_surrounding_top_height">35px</dimen>
<dimen name="module_v2x_surrounding_top_bt_width">90px</dimen>
<dimen name="module_v2x_surrounding_top_bt_height">36px</dimen>
<dimen name="module_v2x_surrounding_empty_iv_margin_top">58px</dimen>
<dimen name="module_v2x_surrounding_empty_tv_margin_top">15px</dimen>
<dimen name="module_v2x_surrounding_empty_bt_width">150px</dimen>
<dimen name="module_v2x_surrounding_empty_bt_height">48px</dimen>
<dimen name="module_v2x_surrounding_empty_bt_margin_top">32px</dimen>
<dimen name="module_v2x_surrounding_empty_bt_maigin_left">70px</dimen>
<dimen name="module_v2x_surrounding_root_margin_left">10px</dimen>
<dimen name="module_v2x_surrounding_margin_left">20px</dimen>
<dimen name="module_v2x_surrounding_empty_image_height">200px</dimen>
<dimen name="module_v2x_surrounding_item_height">173px</dimen>
<dimen name="module_v2x_surrounding_item_image_height">130px</dimen>
<dimen name="module_v2x_surrounding_item_bottom">43px</dimen>
<dimen name="module_v2x_surrounding_item_bottom_image_height">26px</dimen>
<dimen name="module_v2x_surrounding_item_marigin_left">12px</dimen>
<dimen name="module_v2x_surrounding_item_marigin_bottom_left">8px</dimen>
<dimen name="module_v2x_surrounding_top_textsize">18px</dimen>
<dimen name="module_v2x_surrounding_item_bottom_left_textsize">20px</dimen>
<dimen name="module_v2x_surrounding_item_bottom_right_textsize">16px</dimen>
</resources>