add click surrounding

This commit is contained in:
lixiaopeng
2020-11-17 16:17:44 +08:00
parent d75ab2742b
commit 012abd52bc
470 changed files with 513 additions and 13495 deletions

View File

@@ -10,11 +10,9 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.glide.SkinAbleBitmapTarget;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.adapter.holder.V2XSurroundingViewHolder;
import com.mogo.module.v2x.entity.panel.SurroundingConstruction;
import com.mogo.module.v2x.listener.SurroundingItemClickListener;
@@ -76,7 +74,7 @@ public class V2XSurroundingAdapter extends RecyclerView.Adapter<V2XSurroundingVi
@Override
public void onClick(View v) {
if (mClickListener != null) {
mClickListener.onItemClickListener(v, position, surroundingConstruction);
mClickListener.onItemClickListener(v, position, surroundingConstruction, getTypeName(surroundingConstruction.getPoiType()));
}
}
});

View File

@@ -0,0 +1,116 @@
package com.mogo.module.v2x.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.adapter.holder.V2XSurroundingDetailVH;
import com.mogo.module.v2x.entity.panel.SurroundingConstruction;
import com.mogo.utils.DateTimeUtils;
import java.util.List;
/**
* @author lixiaopeng
* @description 周边详情
* @since 2020/11/18
*/
public class V2XSurroundingDetailAdapter extends RecyclerView.Adapter<V2XSurroundingDetailVH> {
private List<MarkerExploreWay> markerExploreWays;
private Context mContext;
private ImageView mTypeImageView;
private TextView mTypeTv;
private TextView mAddressTv;
private TextView mTimeTv;
public V2XSurroundingDetailAdapter(Context context, List<MarkerExploreWay> list) {
mContext = context;
markerExploreWays = list;
}
@Override
public int getItemViewType(int position) {
return super.getItemViewType(position);
}
@NonNull
@Override
public V2XSurroundingDetailVH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View inflate = LayoutInflater.from(parent.getContext())
.inflate(R.layout.module_v2x_event_surrounding_detail_item, parent, false);
return new V2XSurroundingDetailVH(inflate);
}
@Override
public void onBindViewHolder(@NonNull V2XSurroundingDetailVH holder, final int position) {
final MarkerExploreWay exploreWay = markerExploreWays.get(position);
if (exploreWay == null) {
return;
}
// mTypeImageView = holder.itemView.findViewById(R.id.iv_event_type);
mTypeTv = holder.itemView.findViewById(R.id.surrounding_road_type);
mAddressTv = holder.itemView.findViewById(R.id.surrounding_road_type_address);
mTimeTv = holder.itemView.findViewById(R.id.surrounding_time);
mTypeTv.setText(getTypeName(exploreWay.getPoiType()));
mAddressTv.setText(exploreWay.getAddr());
mTimeTv.setText(DateTimeUtils.getTimeText(exploreWay.getGenerateTime(), DateTimeUtils.MM_Yue_dd_Ri_HH_mm));
// mTypeImageView.setBackgroundResource(getTypeSmallRes(surroundingConstruction.getPoiType()));
}
@Override
public int getItemCount() {
return markerExploreWays == null ? 0 : markerExploreWays.size();
}
private String getTypeName(String type) {
String typeName = "";
switch (type) {
case MarkerPoiTypeEnum.ROAD_CLOSED:
typeName = "封路";
break;
case MarkerPoiTypeEnum.FOURS_ICE:
typeName = "道路结冰";
break;
case MarkerPoiTypeEnum.FOURS_FOG:
typeName = "浓雾";
break;
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
typeName = "交通检查";
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
typeName = "交通事故";
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
typeName = "拥堵";
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
typeName = "施工";
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
typeName = "道路积水";
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
typeName = "实时路况";
break;
default:
typeName = "实时路况";
break;
}
return typeName;
}
}

View File

@@ -0,0 +1,19 @@
package com.mogo.module.v2x.adapter.holder;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
/**
* @author lixiaopeng
* @description
* @since 2020/11/16
*/
public class V2XSurroundingDetailVH extends RecyclerView.ViewHolder{
public V2XSurroundingDetailVH(@NonNull View itemView) {
super(itemView);
}
}

View File

@@ -1,4 +1,4 @@
package com.mogo.module.v2x.adapter;
package com.mogo.module.v2x.adapter.holder;
import android.view.View;

View File

@@ -15,12 +15,14 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
@@ -34,8 +36,11 @@ import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.SpacesItemDecoration;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.adapter.V2XShareEventAdapter;
import com.mogo.module.v2x.adapter.V2XSurroundingAdapter;
import com.mogo.module.v2x.adapter.V2XSurroundingDetailAdapter;
import com.mogo.module.v2x.entity.panel.SurroundingConstruction;
import com.mogo.module.v2x.listener.SurroundingItemClickListener;
import com.mogo.module.v2x.presenter.SurroundingEventPresenter;
@@ -63,6 +68,7 @@ import static android.view.View.OVER_SCROLL_NEVER;
public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, SurroundingEventPresenter> implements SurroundingEventView,
View.OnClickListener, SurroundingItemClickListener {
private static final String TAG = "SurroundingFragment";
private RelativeLayout mSurroundingLayout;
private RecyclerView mRecyclerView;
private TextView mTotalTv;
private RelativeLayout mTopLayout;
@@ -76,10 +82,17 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
private IMogoServiceApis mApis;
private NetworkLoadingView mloadingImage;
private RelativeLayout mSurroundingDetailLayout;
private RecyclerView mDetailRecyclerView;
private ImageView mBackImage;
private TextView mBriefTv;
private V2XSurroundingDetailAdapter mDetailAdapter;
private List<MarkerExploreWay> markerExploreWays = new ArrayList<>();
@Override
protected int getLayoutId() {
Log.d(TAG, "getLayoutId --------> ");
return R.layout.module_event_panel_fragment_surrounding;
}
@@ -92,7 +105,7 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
@Override
protected void initViews() {
Log.d(TAG, "initViews --------> ");
mSurroundingLayout = findViewById(R.id.layout_surrounding_event);
mRecyclerView = findViewById(R.id.surrounding_recycleview);
mTotalTv = findViewById(R.id.tv_brief);
mTopLayout = findViewById(R.id.layout_top);
@@ -105,6 +118,13 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
mShareTv.setOnClickListener(this);
mFreshTv.setOnClickListener(this);
mSurroundingDetailLayout = findViewById(R.id.layout_surrounding_event_detail);
mDetailRecyclerView = findViewById(R.id.surrounding_detail_recycleview);
mSurroundingDetailLayout.setVisibility(View.GONE);
mBackImage = findViewById(R.id.back_image);
mBriefTv = findViewById(R.id.tv_brief_detail);
mBackImage.setOnClickListener(this);
// mRecyclerView.setHasFixedSize(true);
mRecyclerView.setOverScrollMode(OVER_SCROLL_NEVER);
GridLayoutManager layoutManage = new GridLayoutManager(getContext(), 2);
@@ -120,6 +140,15 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
}
private void initDetail() {
mDetailRecyclerView.addItemDecoration(new SpacesItemDecoration((int) getResources().getDimension(R.dimen.share_item_padding)));
mDetailAdapter = new V2XSurroundingDetailAdapter(getActivity(), markerExploreWays);
mDetailRecyclerView.setAdapter(mDetailAdapter);
LinearLayoutManager linearLayoutManager =
new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);
mDetailRecyclerView.setLayoutManager(linearLayoutManager);
}
@NonNull
@Override
protected SurroundingEventPresenter createPresenter() {
@@ -132,8 +161,6 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
surroundingEventPresenter = new SurroundingEventPresenter(getContext(), this);
mApis = (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(getContext());
Log.d(TAG, "onViewCreated --------->");
}
@Override
@@ -147,6 +174,8 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
}
} else if (id == R.id.tv_main_refresh || id == R.id.tv_top_refresh) { //刷新
initData();
} else if (id == R.id.back_image) {
showDetail(false);
}
}
@@ -278,71 +307,99 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
return poiTypes;
}
private void showDetail(boolean isShow) {
if (isShow) {
mSurroundingLayout.setVisibility(View.GONE);
mSurroundingDetailLayout.setVisibility(View.VISIBLE);
} else {
mSurroundingDetailLayout.setVisibility(View.GONE);
mSurroundingLayout.setVisibility(View.VISIBLE);
}
}
/**
* 处理marker的显示
* 处理marker的显示 TODO
*
* @param v
* @param position
* @param construction
*/
@Override
public void onItemClickListener(View v, int position, SurroundingConstruction construction) {
public void onItemClickListener(View v, int position, SurroundingConstruction construction, String poiType) {
showDetail(true);
initDetail();
if (construction != null) {
//卡片消失
V2XEventPanelFragment.Companion.getInstance().hidePanel();
//清除道路事件
V2XServiceManager.getMarkerManager().removeMarkers(ServiceConst.CARD_TYPE_ROAD_CONDITION);
//处理 marker的显示
markerExploreWays.clear();
markerExploreWays.addAll(construction.getConstrutList());
mDetailAdapter.notifyDataSetChanged();
try {
//处理 marker的显示
List<MarkerExploreWay> 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();
}
String brief = String.format(getContext().getResources().getString(R.string.v2x_surrounding_detail_top_brief), markerExploreWays.size());
mBriefTv.setText(brief + poiType);
Logger.d(TAG, "onItemClickListener markerExploreWays.size() = " + markerExploreWays.size());
}
}
// @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<MarkerExploreWay> 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();
// }
// }
// }
/**
* 自适应显示
*

View File

@@ -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);
void onItemClickListener(View v, int position, SurroundingConstruction construction, String poiType);
}

View File

@@ -5,138 +5,190 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--两层列表-->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--顶部layout-->
<!--周边-->
<RelativeLayout
android:id="@+id/layout_top"
android:id="@+id/layout_surrounding_event"
android:layout_width="match_parent"
android:layout_height="@dimen/module_v2x_surrounding_top_height"
android:visibility="visible">
<TextView
android:id="@+id/tv_brief"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/module_v2x_surrounding_margin_left"
android:text="周围5公里共15条交通信息"
android:textColor="@color/v2x_white"
android:layout_alignParentTop="true"
android:textSize="@dimen/module_v2x_surrounding_top_textsize" />
<!-- android:layout_centerInParent="true"-->
<TextView
android:id="@+id/tv_top_refresh"
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_alignParentBottom="true"
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/v2x_item_white"
android:textSize="@dimen/module_v2x_surrounding_top_textsize"
android:textStyle="bold" />
</RelativeLayout>
<!--列表相关-->
<RelativeLayout
android:id="@+id/list_layout_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/layout_top"
android:layout_marginBottom="@dimen/module_v2x_panel_surrounding_marginbottom">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/surrounding_recycleview"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/module_v2x_surrounding_empty_tv_margin_top"
android:visibility="visible" />
<!-- android:layout_marginLeft="@dimen/module_v2x_surrounding_list_margin_left"-->
<!--空数据显示-->
android:layout_height="match_parent">
<!--顶部layout-->
<RelativeLayout
android:id="@+id/layout_empty_data_show"
android:id="@+id/layout_top"
android:layout_width="match_parent"
android:layout_height="@dimen/module_v2x_surrounding_top_height"
android:visibility="visible">
<TextView
android:id="@+id/tv_brief"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_marginLeft="@dimen/module_v2x_surrounding_margin_left"
android:text="周围5公里共15条交通信息"
android:textColor="@color/v2x_white"
android:textSize="@dimen/module_v2x_surrounding_top_textsize" />
<!-- android:layout_centerInParent="true"-->
<TextView
android:id="@+id/tv_top_refresh"
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_alignParentBottom="true"
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/v2x_item_white"
android:textSize="@dimen/module_v2x_surrounding_top_textsize"
android:textStyle="bold" />
</RelativeLayout>
<!--列表相关-->
<RelativeLayout
android:id="@+id/list_layout_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:visibility="gone">
android:layout_below="@+id/layout_top"
android:layout_marginBottom="@dimen/module_v2x_panel_surrounding_marginbottom">
<ImageView
android:id="@+id/iv_empty"
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="@dimen/module_v2x_surrounding_empty_iv_margin_top"
android:src="@drawable/mogo_image_blank_nor" />
<TextView
android:id="@+id/tv_main_empty_1"
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/surrounding_recycleview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/iv_empty"
android:layout_centerHorizontal="true"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/module_v2x_surrounding_empty_tv_margin_top"
android:gravity="center_horizontal"
android:text="周边5公里暂无交通事件"
android:textColor="@color/v2x_FFF_333"
android:textSize="@dimen/module_v2x_surrounding_top_textsize" />
<TextView
android:id="@+id/tv_main_empty_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_main_empty_1"
android:layout_centerHorizontal="true"
android:layout_marginTop="1px"
android:gravity="center_horizontal"
android:text="你可以试着分享一个事件给其他车主"
android:textColor="@color/v2x_FFF_333"
android:textSize="@dimen/module_v2x_surrounding_top_textsize" />
android:visibility="visible" />
<!--空数据显示-->
<RelativeLayout
android:id="@+id/layout_empty_data_show"
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">
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:visibility="gone">
<ImageView
android:id="@+id/iv_empty"
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="@dimen/module_v2x_surrounding_empty_iv_margin_top"
android:src="@drawable/mogo_image_blank_nor" />
<TextView
android:id="@+id/tv_main_share"
android:layout_width="@dimen/module_v2x_surrounding_empty_bt_width"
android:layout_height="@dimen/module_v2x_surrounding_empty_bt_height"
android:background="@drawable/bg_v2x_go_to_share"
android:layout_toLeftOf="@+id/center_empty"
android:text="@string/v2x_surrounding_go_to_share"
android:gravity="center"
android:textColor="@color/v2x_white"
android:textSize="@dimen/module_v2x_surrounding_top_textsize"
android:textStyle="bold" />
<View
android:id="@+id/center_empty"
android:layout_width="@dimen/module_v2x_panel_surrounding_stance"
android:layout_height="@dimen/module_v2x_panel_surrounding_stance"
android:layout_centerInParent="true" />
android:id="@+id/tv_main_empty_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/iv_empty"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/module_v2x_surrounding_empty_tv_margin_top"
android:gravity="center_horizontal"
android:text="周边5公里暂无交通事件"
android:textColor="@color/v2x_FFF_333"
android:textSize="@dimen/module_v2x_surrounding_top_textsize" />
<TextView
android:id="@+id/tv_main_refresh"
android:layout_width="@dimen/module_v2x_surrounding_empty_bt_width"
android:layout_height="@dimen/module_v2x_surrounding_empty_bt_height"
android:background="@drawable/bg_v2x_refresh"
android:layout_toRightOf="@+id/center_empty"
android:text="@string/v2x_surrounding_refresh"
android:gravity="center"
android:textColor="@color/v2x_white_refresh"
android:textSize="@dimen/module_v2x_surrounding_top_textsize"
android:textStyle="bold" />
android:id="@+id/tv_main_empty_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_main_empty_1"
android:layout_centerHorizontal="true"
android:layout_marginTop="1px"
android:gravity="center_horizontal"
android:text="你可以试着分享一个事件给其他车主"
android:textColor="@color/v2x_FFF_333"
android:textSize="@dimen/module_v2x_surrounding_top_textsize" />
<RelativeLayout
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">
<TextView
android:id="@+id/tv_main_share"
android:layout_width="@dimen/module_v2x_surrounding_empty_bt_width"
android:layout_height="@dimen/module_v2x_surrounding_empty_bt_height"
android:layout_toLeftOf="@+id/center_empty"
android:background="@drawable/bg_v2x_go_to_share"
android:gravity="center"
android:text="@string/v2x_surrounding_go_to_share"
android:textColor="@color/v2x_white"
android:textSize="@dimen/module_v2x_surrounding_top_textsize"
android:textStyle="bold" />
<View
android:id="@+id/center_empty"
android:layout_width="@dimen/module_v2x_panel_surrounding_stance"
android:layout_height="@dimen/module_v2x_panel_surrounding_stance"
android:layout_centerInParent="true" />
<TextView
android:id="@+id/tv_main_refresh"
android:layout_width="@dimen/module_v2x_surrounding_empty_bt_width"
android:layout_height="@dimen/module_v2x_surrounding_empty_bt_height"
android:layout_toRightOf="@+id/center_empty"
android:background="@drawable/bg_v2x_refresh"
android:gravity="center"
android:text="@string/v2x_surrounding_refresh"
android:textColor="@color/v2x_white_refresh"
android:textSize="@dimen/module_v2x_surrounding_top_textsize"
android:textStyle="bold" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
<!--周边详情-->
<RelativeLayout
android:id="@+id/layout_surrounding_event_detail"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--顶部layout-->
<RelativeLayout
android:id="@+id/layout_top_detail"
android:layout_width="match_parent"
android:layout_height="@dimen/module_v2x_surrounding_top_height">
<ImageView
android:id="@+id/back_image"
android:layout_alignParentTop="true"
android:src="@drawable/icon_report_err"
android:layout_marginLeft="@dimen/module_v2x_surrounding_margin_left"
android:layout_centerVertical="true"
android:layout_width="25px"
android:layout_height="25px"/>
<TextView
android:id="@+id/tv_brief_detail"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/back_image"
android:layout_marginLeft="10px"
android:text="周围5公里共15条交通信息"
android:textColor="@color/v2x_white"
android:textSize="@dimen/module_v2x_surrounding_top_textsize" />
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/surrounding_detail_recycleview"
android:layout_marginTop="30dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible" />
</RelativeLayout>
</RelativeLayout>
<com.mogo.module.common.view.NetworkLoadingView
android:id="@+id/loading_iv"
android:layout_width="match_parent"

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/surrounding_road_type_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_50"
android:layout_marginRight="@dimen/dp_50"
android:layout_marginBottom="@dimen/dp_14"
android:background="@drawable/bg_v2x_event_list_item">
<TextView
android:id="@+id/surrounding_road_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20px"
android:layout_marginTop="20px"
android:background="@drawable/bg_v2x_event_type_read"
android:gravity="center"
android:paddingLeft="6px"
android:paddingTop="3px"
android:paddingRight="6px"
android:paddingBottom="3px"
android:text="道路类型"
android:textColor="@color/v2x_white"
android:textSize="@dimen/panel_list_item_title_size" />
<TextView
android:id="@+id/surrounding_road_type_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/surrounding_road_type"
android:ellipsize="end"
android:layout_marginLeft="20px"
android:layout_marginTop="12px"
android:textStyle="bold"
android:lines="1"
android:textColor="@color/v2x_FFF_333"
android:textSize="@dimen/share_item_address" />
<TextView
android:id="@+id/surrounding_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/surrounding_road_type_address"
android:layout_alignLeft="@id/surrounding_road_type"
android:layout_marginTop="@dimen/dp_3"
android:layout_marginBottom="@dimen/dp_24"
android:alpha="0.5"
android:gravity="left"
android:textColor="@color/v2x_FFF_666"
android:textSize="@dimen/share_item_text_size" />
</RelativeLayout>

View File

@@ -6,6 +6,7 @@
<string name="v2x_report_pop_submit_txt">已提交</string>
<string name="v2x_report_pop_thank_txt">感谢已送达</string>
<string name="v2x_surrounding_top_brief">周围5公里共 %d 条交通信息</string>
<string name="v2x_surrounding_detail_top_brief">周围5公里共 %d 条</string>
<string name="v2x_surrounding_go_to_share">去分享</string>
<string name="v2x_surrounding_refresh">刷新</string>