Merge remote-tracking branch 'origin/dev_1.1.2' into dev_1.1.2

This commit is contained in:
wangcongtao
2020-08-12 10:41:39 +08:00
87 changed files with 808 additions and 227 deletions

View File

@@ -0,0 +1,46 @@
package com.mogo.module.extensions.bean;
import android.view.View;
/**
* 底层view封装
*
* @author tongchenfei
*/
public class BottomLayerViewWrapper {
private View view;
private int x;
private int y;
public BottomLayerViewWrapper(){}
public BottomLayerViewWrapper(View view, int x, int y) {
this.view = view;
this.x = x;
this.y = y;
}
public View getView() {
return view;
}
public void setView(View view) {
this.view = view;
}
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
}

View File

@@ -1,5 +1,6 @@
package com.mogo.module.extensions.entrance;
import android.content.Context;
import android.content.Intent;
import android.graphics.Rect;
import android.os.Bundle;
@@ -8,6 +9,7 @@ import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
@@ -38,6 +40,7 @@ import com.mogo.module.extensions.ExtensionsModuleConst;
import com.mogo.module.extensions.R;
import com.mogo.module.extensions.navi.NaviInfoView;
import com.mogo.module.extensions.userinfo.UserInfo;
import com.mogo.module.extensions.utils.EntranceViewHolder;
import com.mogo.module.extensions.utils.TopViewAnimHelper;
import com.mogo.module.share.manager.ServiceApisManager;
import com.mogo.service.IMogoServiceApis;
@@ -153,6 +156,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
mEntrancePresenter = new EntrancePresenter(getContext(), this);
mMogoFragmentManager = mApis.getFragmentManagerApi();
EntranceViewHolder.getInstance().initRootViewGroup(mRootView);
mStatusManager = mApis.getStatusManagerApi();
@@ -581,6 +585,12 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
}
});
});
findViewById(R.id.btnDebugAddBottomLayerView).setOnClickListener(v->{
TextView tv = new TextView(getContext());
tv.setText("entrance add");
mApis.getEntranceButtonController().addBottomLayerView(tv, 50, 50);
});
}
@Override

View File

@@ -1,9 +1,11 @@
package com.mogo.module.extensions.entrance;
import android.content.Context;
import android.view.View;
import android.widget.TextView;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.module.extensions.utils.EntranceViewHolder;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.entrance.ButtonIndex;
import com.mogo.service.entrance.IMogoEntranceButtonController;
@@ -22,6 +24,21 @@ public class MogoEntranceButtonControllerImpl implements IMogoEntranceButtonCont
return MogoEntranceButtons.getButton( index );
}
@Override
public void addBottomLayerView(View view) {
EntranceViewHolder.getInstance().addBottomLayerView(view);
}
@Override
public void addBottomLayerView(View view, int x, int y) {
EntranceViewHolder.getInstance().addBottomLayerView(view, x, y);
}
@Override
public void removeBottomLayerView(View view) {
EntranceViewHolder.getInstance().removeBottomLayerView(view);
}
@Override
public void init( Context context ) {

View File

@@ -0,0 +1,94 @@
package com.mogo.module.extensions.utils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.mogo.module.extensions.bean.BottomLayerViewWrapper;
import com.mogo.utils.logger.Logger;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* 入口页view管理
* @author tongchenfei
*/
public class EntranceViewHolder {
private static final String TAG = "EntranceViewHolder";
private List<BottomLayerViewWrapper> preAddView = new ArrayList<>();
private EntranceViewHolder(){}
private volatile static EntranceViewHolder instance = null;
public static EntranceViewHolder getInstance(){
if (instance == null) {
synchronized (EntranceViewHolder.class) {
if (instance == null) {
instance = new EntranceViewHolder();
}
}
}
return instance;
}
private ViewGroup rootViewGroup = null;
public void initRootViewGroup(View rootView) {
Logger.i(TAG, "initRootViewGroup==");
if(rootView instanceof ViewGroup) {
Logger.d(TAG, "initRootViewGroup 赋值");
rootViewGroup = (ViewGroup) rootView.getParent();
if (!preAddView.isEmpty()) {
Logger.d(TAG, "initRootViewGroup 增加底层view: " + preAddView.size());
Iterator<BottomLayerViewWrapper> iterator = preAddView.iterator();
while (iterator.hasNext()) {
BottomLayerViewWrapper wrapper = iterator.next();
realAddView(wrapper);
iterator.remove();
}
}
}
}
public void addBottomLayerView(View view) {
Logger.d(TAG, "addBottomLayerView, rootViewGroup is null: " + (rootViewGroup == null));
addBottomLayerView(view, 0, 0);
}
public void addBottomLayerView(View view, int x, int y) {
Logger.d(TAG, "addBottomLayerView, rootViewGroup is null: " + (rootViewGroup == null) +
"\n x: " + x + ", y: " + y);
BottomLayerViewWrapper wrapper = new BottomLayerViewWrapper(view, x, y);
if(rootViewGroup == null) {
preAddView.add(wrapper);
}else{
realAddView(wrapper);
}
}
/**
* 使用的时候需要预先判断rootViewGroup是否为空本方法默认rootViewGroup不为空
*/
private void realAddView(BottomLayerViewWrapper wrapper){
FrameLayout.LayoutParams params =
new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT);
params.topMargin = wrapper.getY();
params.leftMargin = wrapper.getX();
View v = wrapper.getView();
v.setLayoutParams(params);
rootViewGroup.addView(v, 0);
}
public void removeBottomLayerView(View view) {
if (rootViewGroup != null) {
rootViewGroup.removeView(view);
}
Iterator<BottomLayerViewWrapper> iterator = preAddView.iterator();
while (iterator.hasNext()) {
BottomLayerViewWrapper wrapper = iterator.next();
if (wrapper.getView().equals(view)) {
iterator.remove();
}
}
}
}

View File

@@ -14,7 +14,7 @@
<include
layout="@layout/include_navi_info_panle"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content" />
<TextView
android:id="@+id/module_ext_id_north"
@@ -30,17 +30,17 @@
android:textSize="@dimen/module_ext_north_textSize"
android:textStyle="bold"
android:visibility="gone"
tools:visibility="visible"
app:layout_constraintRight_toRightOf="@+id/module_entrance_id_upload_road_condition"
app:layout_constraintTop_toBottomOf="@+id/module_map_id_navi_bg"
app:layout_goneMarginTop="@dimen/module_ext_north_goneMarginTop" />
app:layout_goneMarginTop="@dimen/module_ext_north_goneMarginTop"
tools:visibility="visible" />
<com.mogo.module.extensions.navi.TopView
android:id="@+id/module_entrance_id_top_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:clickable="true"
android:focusable="true"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
@@ -51,12 +51,12 @@
android:layout_height="@dimen/module_ext_button_height"
android:layout_marginTop="@dimen/module_ext_camera_button_marginTop"
android:background="@drawable/module_ext_dw_common_corner_bkg"
android:orientation="vertical"
android:gravity="center_horizontal"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="gone"
app:layout_constraintLeft_toLeftOf="@+id/module_map_id_navi_bg"
app:layout_constraintTop_toBottomOf="@+id/module_map_id_navi_bg">
app:layout_constraintTop_toBottomOf="@+id/module_map_id_navi_bg"
tools:visibility="gone">
<ImageView
android:id="@+id/module_ext_id_display_overview_icon"
@@ -175,35 +175,46 @@
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnDebugCtrlTopView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="显示隐藏TopView"
app:layout_constraintLeft_toLeftOf="parent"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
android:textSize="20sp" />
app:layout_constraintLeft_toLeftOf="parent" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnDebugCtrlSubView"
android:text="显示隐藏SubView"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toTopOf="@id/btnDebugCtrlTopView"
android:textSize="20sp" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="显示隐藏SubView"
android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@id/btnDebugCtrlTopView"
app:layout_constraintLeft_toLeftOf="parent" />
<Button
android:id="@+id/btnDebugCtrlNaviView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="显示隐藏导航view"
app:layout_constraintLeft_toLeftOf="parent"
android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@id/btnDebugCtrlSubView"
android:textSize="20sp" />
app:layout_constraintLeft_toLeftOf="parent" />
<Button
android:id="@+id/btnDebugAddBottomLayerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="增加底层view"
android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@id/btnDebugCtrlNaviView"
app:layout_constraintLeft_toLeftOf="parent" />
<androidx.constraintlayout.widget.Group
android:id="@+id/groupTopViewDebug"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="btnDebugCtrlNaviView,btnDebugCtrlSubView,btnDebugCtrlTopView"
android:id="@+id/groupTopViewDebug" />
app:constraint_referenced_ids="btnDebugCtrlNaviView,btnDebugCtrlSubView,btnDebugCtrlTopView,btnDebugAddBottomLayerView" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -67,6 +67,7 @@ import com.mogo.module.tanlu.model.NaviResult;
import com.mogo.module.tanlu.model.PathLineResult;
import com.mogo.module.tanlu.model.TanluModelData;
import com.mogo.module.tanlu.model.VoiceCmdData;
import com.mogo.module.tanlu.model.event.CloseWindowInfo;
import com.mogo.module.tanlu.model.event.ControlClickUpInfo;
import com.mogo.module.tanlu.model.event.DataErrorInfo;
import com.mogo.module.tanlu.model.event.GetInfoError;
@@ -448,6 +449,16 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onCloseWindow(final CloseWindowInfo event) {
if (event == null) {
return;
}
releaseTimer();
TanluServiceManager.getIMogoTopViewManager().removeView(TanluListWindow.this);
}
/**
* poi 搜索
*

View File

@@ -23,7 +23,9 @@ import com.mogo.module.tanlu.R;
import com.mogo.module.tanlu.callback.IThumbsUpCallback;
import com.mogo.module.tanlu.constant.TanluConstants;
import com.mogo.module.tanlu.model.TanluModelData;
import com.mogo.module.tanlu.model.event.CloseWindowInfo;
import com.mogo.module.tanlu.model.event.ControlClickUpInfo;
import com.mogo.module.tanlu.model.event.DataErrorInfo;
import com.mogo.module.tanlu.model.event.StartPlayInfo;
import com.mogo.module.tanlu.model.event.VoiceControlUpInfo;
import com.mogo.module.tanlu.util.ChartUtil;
@@ -71,6 +73,7 @@ public class TanluSlideAdapterNew extends RecyclerView.Adapter<TanluSlideViewHol
private LinearLayout mLikeLayout;
private TextView mTypeTv;
private IMogoImageloader mogoImageloader;
private ImageView mCloseImage;
//media
private GSYVideoOptionBuilder gsyVideoOptionBuilder = new GSYVideoOptionBuilder();
@@ -117,6 +120,14 @@ public class TanluSlideAdapterNew extends RecyclerView.Adapter<TanluSlideViewHol
mLikeImage = holder.itemView.findViewById(R.id.tanlu_like_imageView);
mLikeLayout = holder.itemView.findViewById(R.id.tanlu_like_layout);
mTypeTv = holder.itemView.findViewById(R.id.tv_information_type);
mCloseImage = holder.itemView.findViewById(R.id.tanlu_close_imageView);
mCloseImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
EventBus.getDefault().post(new CloseWindowInfo());
}
});
//有可能不是一个对象
simpleCoverVideoPlayer.setVisibility(View.VISIBLE);

View File

@@ -0,0 +1,15 @@
package com.mogo.module.tanlu.model.event;
import java.io.Serializable;
/**
* @author lixiaopeng
* @description push区分类别
* @since 2020-01-08
*/
public class CloseWindowInfo implements Serializable {
public CloseWindowInfo() {
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/icon_window_close_press" android:state_pressed="true" />
<item android:drawable="@drawable/icon_window_close_normal" android:state_pressed="false" />
<item android:drawable="@drawable/icon_window_close_normal" />
</selector>

View File

@@ -159,6 +159,15 @@
android:src="@drawable/icon_heart_like" />
</LinearLayout>
<ImageView
android:id="@+id/tanlu_close_imageView"
android:layout_width="@dimen/tanlu_module_close_height"
android:layout_height="@dimen/tanlu_module_close_height"
android:layout_centerInParent="true"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/tanlu_module_margin_right"
android:src="@drawable/selector_btn_close" />
</RelativeLayout>
</RelativeLayout>

View File

@@ -80,6 +80,7 @@
<dimen name="tanlu_module_card_height">350px</dimen>
<dimen name="tanlu_module_card_video_width">480px</dimen>
<dimen name="tanlu_module_card_video_height">320px</dimen>
<dimen name="tanlu_module_close_height">45px</dimen>
<dimen name="tanlu_module_card_margin_top">23px</dimen>
<dimen name="tanlu_module_card_margin_left">15px</dimen>

View File

@@ -80,6 +80,7 @@
<dimen name="tanlu_module_card_height">194px</dimen>
<dimen name="tanlu_module_card_video_width">266px</dimen>
<dimen name="tanlu_module_card_video_height">194px</dimen>
<dimen name="tanlu_module_close_height">45px</dimen>
<dimen name="tanlu_module_card_margin_top">16px</dimen>
<dimen name="tanlu_module_card_margin_left">8px</dimen>

View File

@@ -79,11 +79,14 @@ public class SurroundingEventAdapter extends RecyclerView.Adapter<SurroundingEve
}
});
//数据绑定 TODO
// Glide.with(mContext)
// .load(R.drawable.icon_car_red)
// .into(mBgImageView);
//数据绑定
Glide.with(mContext)
.load(getTypeRes(surroundingConstruction.getPoiType()))
.into(mBgImageView);
Glide.with(mContext)
.load(getTypeSmallRes(surroundingConstruction.getPoiType()))
.into(mTypeImageView);
}
@Override
@@ -91,34 +94,107 @@ public class SurroundingEventAdapter extends RecyclerView.Adapter<SurroundingEve
return mPoiInfosList == null ? 0 : mPoiInfosList.size();
}
private int getTypeSmallRes(String type) {
int resId = 0;
switch (type) {
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
resId = R.drawable.mogo_image_jiaotongjiancha_small;
break;
case MarkerPoiTypeEnum.ROAD_CLOSED:
resId = R.drawable.mogo_image_fenglu_small;
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
resId = R.drawable.mogo_image_daolushigong_small;
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
resId = R.drawable.mogo_image_yongdu_small;
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
resId = R.drawable.mogo_image_jishui_small;
break;
case MarkerPoiTypeEnum.FOURS_ICE:
resId = R.drawable.mogo_image_jiebing_small;
break;
case MarkerPoiTypeEnum.FOURS_FOG:
resId = R.drawable.mogo_image_nongwu_small;
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
resId = R.drawable.mogo_image_accident_small;
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
resId = R.drawable.mogo_image_shishilukuang_small;
break;
default:
resId = R.drawable.mogo_image_shishilukuang_small;
break;
}
return resId;
}
private int getTypeRes(String type) {
int resId = 0;
switch (type) {
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
resId = R.drawable.mogo_image_jiaotongjiancha_nor;
break;
case MarkerPoiTypeEnum.ROAD_CLOSED:
resId = R.drawable.mogo_image_fenglu_nor;
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
resId = R.drawable.mogo_image_daolushigong_nor;
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
resId = R.drawable.mogo_image_yongdu_nor;
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
resId = R.drawable.mogo_image_jishui_nor;
break;
case MarkerPoiTypeEnum.FOURS_ICE:
resId = R.drawable.mogo_image_jiebing_nor;
break;
case MarkerPoiTypeEnum.FOURS_FOG:
resId = R.drawable.mogo_image_nongwu_nor;
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
resId = R.drawable.mogo_image_jiaotongshigu_nor;
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
resId = R.drawable.mogo_image_shishlukuang_nor;
break;
default:
resId = R.drawable.mogo_image_shishlukuang_nor;
break;
}
return resId;
}
private String getTypeName(String type) {
String typeName = "";
switch (type) {
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
typeName = "交通检查";
break;
case MarkerPoiTypeEnum.ROAD_CLOSED:
typeName = "封路";
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
typeName = "道路施工";
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
typeName = "道路拥堵";
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
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;
@@ -130,5 +206,4 @@ public class SurroundingEventAdapter extends RecyclerView.Adapter<SurroundingEve
}
}

View File

@@ -125,7 +125,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
if (data != null) {
String poitype = data.getPoiType();
String address = data.getUploadAddress();
String time = DateTimeUtils.getTimeText(data.getUploadTimestamp(),DateTimeUtils.M_Yue_d_Ri);
String time = DateTimeUtils.getTimeText(data.getUploadTimestamp(),DateTimeUtils.MM_Yue_dd_Ri_HH_mm);
String likeNum = String.valueOf(data.getLikeNum());
String notLikeNum = String.valueOf(data.getNotLikeNum());

View File

@@ -83,6 +83,7 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
ivNavi = itemView.findViewById(R.id.ivFaultHelpEventNavi);
ivNavi.setOnClickListener(v -> {
triggerStartNavi(mNoveltyInfo);
V2XServiceManager.getV2XRefreshModel().respondingToHelp(mUserInfo.getSn());
});
// 设置视图状态监听
@@ -118,6 +119,16 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
@Override
public void initView(V2XEventShowEntity v2XEventShowEntity) {
mV2XPushMessageEntity = v2XEventShowEntity.getV2XPushMessageEntity();
try {
MarkerLocation markerLocation = new MarkerLocation();
markerLocation.setLon(mV2XPushMessageEntity.getLon());
markerLocation.setLat(mV2XPushMessageEntity.getLat());
mNoveltyInfo = new MarkerExploreWay();
mNoveltyInfo.setLocation(markerLocation);
} catch (Exception e) {
e.printStackTrace();
}
// 只有自研车机才会 有车聊聊通话
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
// 判断是否可以打电话
@@ -137,13 +148,14 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
});
ivCall.setOnClickListener(v -> {
V2XServiceManager.getV2XRefreshModel().respondingToHelp(mUserInfo.getSn());
if (!V2XUtils.isFastClick()) {
try {
mUserInfo.setSn(mV2XPushMessageEntity.getSn());
mUserInfo.setUserHead(mV2XPushMessageEntity.getHeadImgUrl());
mUserInfo.setUserName(mV2XPushMessageEntity.getDisplayName());
mUserInfo.setGender(mV2XPushMessageEntity.getSex());
mUserInfo.setAge(30);
mUserInfo.setAge(mV2XPushMessageEntity.getAge());
mNoveltyInfo.setUserInfo(mUserInfo);
triggerCallChart(mNoveltyInfo);
} catch (Exception e) {
@@ -152,16 +164,6 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
}
});
}
try {
MarkerLocation markerLocation = new MarkerLocation();
markerLocation.setLon(mV2XPushMessageEntity.getLon());
markerLocation.setLat(mV2XPushMessageEntity.getLat());
mNoveltyInfo = new MarkerExploreWay();
mNoveltyInfo.setLocation(markerLocation);
} catch (Exception e) {
e.printStackTrace();
}
try {
if (!TextUtils.isEmpty(mV2XPushMessageEntity.getHeadImgUrl())) {
V2XServiceManager.getImageLoader()

View File

@@ -40,43 +40,47 @@ public class V2XScenarioHistoryIllegalParkVH extends V2XBaseViewHolder<V2XHistor
public V2XScenarioHistoryIllegalParkVH(@NonNull ViewGroup viewGroup) {
super(LayoutInflater.from(viewGroup.getContext())
.inflate(R.layout.item_v2x_scennario_history, viewGroup, false));
mTvAddress = (TextView) itemView.findViewById(R.id.tvAddress);
mTvIllegalNum = (TextView) itemView.findViewById(R.id.tvIllegalNum);
mTvAddress = itemView.findViewById(R.id.tvAddress);
mTvIllegalNum = itemView.findViewById(R.id.tvIllegalNum);
mTagEventType = (TextView) itemView.findViewById(R.id.tagEventType);
mTagEventEvaluate = (TextView) itemView.findViewById(R.id.tagEventEvaluate);
mTagEventType = itemView.findViewById(R.id.tagEventType);
mTagEventEvaluate = itemView.findViewById(R.id.tagEventEvaluate);
mLlIllegalParkingLike = (HeartLikeView) itemView.findViewById(R.id.llIllegalParkingLike);
mLlIllegalParkingUnLike = (HeartUnLikeView) itemView.findViewById(R.id.llIllegalParkingUnLike);
mLlIllegalParkingLike = itemView.findViewById(R.id.llIllegalParkingLike);
mLlIllegalParkingUnLike = itemView.findViewById(R.id.llIllegalParkingUnLike);
}
@Override
public void initView(V2XHistoryScenarioData viewData) {
mOldScenarioData = viewData;
mExploreWay = GsonUtil.objectFromJson(viewData.getEventJsonData(), MarkerExploreWay.class);
mTvAddress.setText(mExploreWay.getAddr());
try {
mTvIllegalNum.setText("违章人数:" + (int) mExploreWay.getItems().get(0).getIllegalCount());
mOldScenarioData = viewData;
mExploreWay = GsonUtil.objectFromJson(viewData.getEventJsonData(), MarkerExploreWay.class);
mTvAddress.setText(mExploreWay.getAddr());
try {
mTvIllegalNum.setText("违章人数:" + (int) mExploreWay.getItems().get(0).getIllegalCount());
} catch (Exception e) {
e.printStackTrace();
}
if (!viewData.isDispose()) {
hideControlButton(View.VISIBLE);
} else {
hideControlButton(View.GONE);
}
mLlIllegalParkingLike.setOnClickCallListener(v -> {
Logger.d(V2XConst.MODULE_NAME, "反馈有用");
roadReportTrue();
});
mLlIllegalParkingUnLike.setOnClickCallListener(v -> {
Logger.d(V2XConst.MODULE_NAME, "反馈无用");
roadReportErr();
});
} catch (Exception e) {
e.printStackTrace();
}
if (!viewData.isDispose()) {
hideControlButton(View.VISIBLE);
} else {
hideControlButton(View.GONE);
}
mLlIllegalParkingLike.setOnClickCallListener(v -> {
Logger.d(V2XConst.MODULE_NAME, "反馈有用");
roadReportTrue();
});
mLlIllegalParkingUnLike.setOnClickCallListener(v -> {
Logger.d(V2XConst.MODULE_NAME, "反馈无用");
roadReportErr();
});
}
void hideControlButton(int gone) {
@@ -87,14 +91,18 @@ public class V2XScenarioHistoryIllegalParkVH extends V2XBaseViewHolder<V2XHistor
@Override
public void delayedCloseWindow() {
hideControlButton(View.GONE);
// 进行数据库存储
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
v2XHistoryScenarioData.setScenarioType(mOldScenarioData.getScenarioType());
v2XHistoryScenarioData.setTriggerTime(mOldScenarioData.getTriggerTime());
v2XHistoryScenarioData.setEventJsonData(mOldScenarioData.getEventJsonData());
v2XHistoryScenarioData.setDispose(true);
V2XSQLiteUtils.updateScenarioHistoryData(mOldScenarioData, v2XHistoryScenarioData);
try {
hideControlButton(View.GONE);
// 进行数据库存储
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
v2XHistoryScenarioData.setScenarioType(mOldScenarioData.getScenarioType());
v2XHistoryScenarioData.setTriggerTime(mOldScenarioData.getTriggerTime());
v2XHistoryScenarioData.setEventJsonData(mOldScenarioData.getEventJsonData());
v2XHistoryScenarioData.setDispose(true);
V2XSQLiteUtils.updateScenarioHistoryData(mOldScenarioData, v2XHistoryScenarioData);
} catch (Exception e) {
e.printStackTrace();
}
}
/**

View File

@@ -1,30 +1,176 @@
package com.mogo.module.v2x.adapter.holder;
import android.text.TextUtils;
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 com.mogo.commons.debug.DebugConfig;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerUserInfo;
import com.mogo.module.common.entity.V2XHistoryScenarioData;
import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.fragment.V2XEventPanelFragment;
import com.mogo.module.v2x.utils.ChartingUtil;
import com.mogo.module.v2x.utils.SpanUtils;
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.service.imageloader.MogoImageView;
import com.mogo.utils.network.utils.GsonUtil;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import static android.view.View.GONE;
import static android.view.View.VISIBLE;
/**
* 出行动态中的他人故障求助
*
* @author donghongyu
*/
public class V2XScenarioHistoryOtherSeekHelpVH extends V2XBaseViewHolder<V2XHistoryScenarioData> {
private TextView mTagEventType;
private TextView mTagEventEvaluate;
private MogoImageView mIvFaultHelpHead;
private TextView mTvFaultHelpName;
private TextView mTvFaultHelpEventTime;
private TextView mTvFaultHelpDistance;
private ImageView mIvFaultHelpEventCall;
private ImageView mIvFaultHelpEventNavi;
private MarkerExploreWay mNoveltyInfo;
// 上传事件的用户信息
private MarkerUserInfo mUserInfo = new MarkerUserInfo();
private V2XHistoryScenarioData mOldScenarioData;
public V2XScenarioHistoryOtherSeekHelpVH(@NonNull ViewGroup viewGroup) {
super(LayoutInflater.from(viewGroup.getContext())
.inflate(R.layout.item_v2x_scennario_history_other_help, viewGroup, false));
mTagEventType = itemView.findViewById(R.id.tagEventType);
mTagEventEvaluate = itemView.findViewById(R.id.tagEventEvaluate);
mIvFaultHelpHead = itemView.findViewById(R.id.ivFaultHelpHead);
mTvFaultHelpName = itemView.findViewById(R.id.tvFaultHelpName);
mTvFaultHelpEventTime = itemView.findViewById(R.id.tvFaultHelpEventTime);
mTvFaultHelpDistance = itemView.findViewById(R.id.tvFaultHelpDistance);
mIvFaultHelpEventCall = itemView.findViewById(R.id.ivFaultHelpEventCall);
mIvFaultHelpEventNavi = itemView.findViewById(R.id.ivFaultHelpEventNavi);
}
@Override
public void initView(V2XHistoryScenarioData viewData) {
try {
mOldScenarioData = viewData;
V2XPushMessageEntity xPushMessageEntity = GsonUtil.objectFromJson(viewData.getEventJsonData(), V2XPushMessageEntity.class);
if (!viewData.isDispose()) {
hideControlButton(View.VISIBLE);
} else {
hideControlButton(View.GONE);
}
mTvFaultHelpName.setText(xPushMessageEntity.getDisplayName());
if (!TextUtils.isEmpty(xPushMessageEntity.getHeadImgUrl())) {
V2XServiceManager.getImageLoader()
.displayImage(xPushMessageEntity.getHeadImgUrl(), mIvFaultHelpHead);
}
SpanUtils.with(mTvFaultHelpDistance)
.append("" + (int) xPushMessageEntity.getDistance())
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_text))
.append("m")
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_title))
.create();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm", Locale.CHINA);
String eventTime = String.format("%s发布求助信息",
sdf.format(new Date(xPushMessageEntity.getCreateTime())));
mTvFaultHelpEventTime.setText(eventTime);
try {
MarkerLocation markerLocation = new MarkerLocation();
markerLocation.setLon(xPushMessageEntity.getLon());
markerLocation.setLat(xPushMessageEntity.getLat());
mNoveltyInfo = new MarkerExploreWay();
mNoveltyInfo.setLocation(markerLocation);
} catch (Exception e) {
e.printStackTrace();
}
mIvFaultHelpEventNavi.setOnClickListener(v -> {
triggerStartNavi(mNoveltyInfo);
});
// 只有自研车机才会 有车聊聊通话
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
// 判断是否可以打电话
ChartingUtil.isCanCall(b -> {
if (b) {
// 判断是否可以打电话
ChartingUtil.isOnLine(xPushMessageEntity.getSn(), b1 -> {
if (b1) {
mIvFaultHelpEventCall.setVisibility(VISIBLE);
} else {
mIvFaultHelpEventCall.setVisibility(GONE);
}
});
} else {
mIvFaultHelpEventCall.setVisibility(GONE);
}
});
mIvFaultHelpEventCall.setOnClickListener(v -> {
if (!V2XUtils.isFastClick()) {
try {
mUserInfo.setSn(xPushMessageEntity.getSn());
mUserInfo.setUserHead(xPushMessageEntity.getHeadImgUrl());
mUserInfo.setUserName(xPushMessageEntity.getDisplayName());
mUserInfo.setGender(xPushMessageEntity.getSex());
mUserInfo.setAge(xPushMessageEntity.getAge());
mNoveltyInfo.setUserInfo(mUserInfo);
triggerCallChart(mNoveltyInfo);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void delayedCloseWindow() {
try {
V2XServiceManager.getV2XRefreshModel().respondingToHelp(mUserInfo.getSn());
hideControlButton(View.GONE);
// 进行数据库存储
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
v2XHistoryScenarioData.setScenarioType(mOldScenarioData.getScenarioType());
v2XHistoryScenarioData.setTriggerTime(mOldScenarioData.getTriggerTime());
v2XHistoryScenarioData.setEventJsonData(mOldScenarioData.getEventJsonData());
v2XHistoryScenarioData.setDispose(true);
V2XSQLiteUtils.updateScenarioHistoryData(mOldScenarioData, v2XHistoryScenarioData);
V2XEventPanelFragment.Companion.getInstance().hidePanel();
} catch (Exception e) {
e.printStackTrace();
}
}
void hideControlButton(int gone) {
mTagEventEvaluate.setVisibility(gone);
}
}

View File

@@ -42,47 +42,51 @@ public class V2XScenarioHistoryRoadEventVH extends V2XBaseViewHolder<V2XHistoryS
public V2XScenarioHistoryRoadEventVH(@NonNull ViewGroup viewGroup) {
super(LayoutInflater.from(viewGroup.getContext())
.inflate(R.layout.item_v2x_scennario_history, viewGroup, false));
mTvAddress = (TextView) itemView.findViewById(R.id.tvAddress);
mTvIllegalNum = (TextView) itemView.findViewById(R.id.tvIllegalNum);
mIvIconP = (ImageView) itemView.findViewById(R.id.ivIconP);
mTagEventType = (TextView) itemView.findViewById(R.id.tagEventType);
mTagEventEvaluate = (TextView) itemView.findViewById(R.id.tagEventEvaluate);
mTvAddress = itemView.findViewById(R.id.tvAddress);
mTvIllegalNum = itemView.findViewById(R.id.tvIllegalNum);
mIvIconP = itemView.findViewById(R.id.ivIconP);
mTagEventType = itemView.findViewById(R.id.tagEventType);
mTagEventEvaluate = itemView.findViewById(R.id.tagEventEvaluate);
mLlIllegalParkingLike = (HeartLikeView) itemView.findViewById(R.id.llIllegalParkingLike);
mLlIllegalParkingUnLike = (HeartUnLikeView) itemView.findViewById(R.id.llIllegalParkingUnLike);
mLlIllegalParkingLike = itemView.findViewById(R.id.llIllegalParkingLike);
mLlIllegalParkingUnLike = itemView.findViewById(R.id.llIllegalParkingUnLike);
}
@Override
public void initView(V2XHistoryScenarioData viewData) {
mOldScenarioData = viewData;
mExploreWay = GsonUtil.objectFromJson(viewData.getEventJsonData(), MarkerExploreWay.class);
mIvIconP.setVisibility(View.GONE);
mTvAddress.setText(mExploreWay.getAddr());
mTagEventType.setText(EventTypeUtils.getPoiTypeStr(mExploreWay.getPoiType()));
try {
mTvIllegalNum.setText(mExploreWay.getUserInfo().getUserName() + " 的分享 时间:" +
TimeUtils.millis2String(mExploreWay.getGenerateTime(), "MM月dd日 HH:mm"));
mOldScenarioData = viewData;
mExploreWay = GsonUtil.objectFromJson(viewData.getEventJsonData(), MarkerExploreWay.class);
mIvIconP.setVisibility(View.GONE);
mTvAddress.setText(mExploreWay.getAddr());
mTagEventType.setText(EventTypeUtils.getPoiTypeStr(mExploreWay.getPoiType()));
try {
mTvIllegalNum.setText(mExploreWay.getUserInfo().getUserName() + " 的分享 时间:" +
TimeUtils.millis2String(mExploreWay.getGenerateTime(), "MM月dd日 HH:mm"));
} catch (Exception e) {
e.printStackTrace();
}
if (!viewData.isDispose()) {
hideControlButton(View.VISIBLE);
} else {
hideControlButton(View.GONE);
}
mLlIllegalParkingLike.setOnClickCallListener(v -> {
Logger.d(V2XConst.MODULE_NAME, "反馈有用");
roadReportTrue();
});
mLlIllegalParkingUnLike.setOnClickCallListener(v -> {
Logger.d(V2XConst.MODULE_NAME, "反馈无用");
roadReportErr();
});
} catch (Exception e) {
e.printStackTrace();
}
if (!viewData.isDispose()) {
hideControlButton(View.VISIBLE);
} else {
hideControlButton(View.GONE);
}
mLlIllegalParkingLike.setOnClickCallListener(v -> {
Logger.d(V2XConst.MODULE_NAME, "反馈有用");
roadReportTrue();
});
mLlIllegalParkingUnLike.setOnClickCallListener(v -> {
Logger.d(V2XConst.MODULE_NAME, "反馈无用");
roadReportErr();
});
}
void hideControlButton(int gone) {
@@ -93,14 +97,18 @@ public class V2XScenarioHistoryRoadEventVH extends V2XBaseViewHolder<V2XHistoryS
@Override
public void delayedCloseWindow() {
hideControlButton(View.GONE);
// 进行数据库存储
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
v2XHistoryScenarioData.setScenarioType(mOldScenarioData.getScenarioType());
v2XHistoryScenarioData.setTriggerTime(mOldScenarioData.getTriggerTime());
v2XHistoryScenarioData.setEventJsonData(mOldScenarioData.getEventJsonData());
v2XHistoryScenarioData.setDispose(true);
V2XSQLiteUtils.updateScenarioHistoryData(mOldScenarioData,v2XHistoryScenarioData);
try {
hideControlButton(View.GONE);
// 进行数据库存储
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
v2XHistoryScenarioData.setScenarioType(mOldScenarioData.getScenarioType());
v2XHistoryScenarioData.setTriggerTime(mOldScenarioData.getTriggerTime());
v2XHistoryScenarioData.setEventJsonData(mOldScenarioData.getEventJsonData());
v2XHistoryScenarioData.setDispose(true);
V2XSQLiteUtils.updateScenarioHistoryData(mOldScenarioData,v2XHistoryScenarioData);
} catch (Exception e) {
e.printStackTrace();
}
}
/**

View File

@@ -25,6 +25,7 @@ import com.mogo.commons.voice.AIAssist;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.v2x.R;
@@ -34,6 +35,7 @@ import com.mogo.module.v2x.entity.panel.SurroundingConstruction;
import com.mogo.module.v2x.listener.SurroundingItemClickListener;
import com.mogo.module.v2x.presenter.SurroundingEventPresenter;
import com.mogo.module.v2x.view.SurroundingEventView;
import com.mogo.module.v2x.view.SurroundingMarginDecoration;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.utils.TipToast;
@@ -88,6 +90,8 @@ public class SurroundingEventFragment extends MvpFragment<SurroundingEventView,
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setOverScrollMode(OVER_SCROLL_NEVER);
GridLayoutManager layoutManage = new GridLayoutManager(getContext(), 2);
int spacingInPixels = getResources().getDimensionPixelSize(R.dimen.module_v2x_surrounding_item_size);
mRecyclerView.addItemDecoration(new SurroundingMarginDecoration(spacingInPixels));
mRecyclerView.setLayoutManager(layoutManage);
mAdapter = new SurroundingEventAdapter(getActivity(), poiInfosList, this);
@@ -149,7 +153,7 @@ public class SurroundingEventFragment extends MvpFragment<SurroundingEventView,
poiInfosList.addAll(handleMapToList(getPoiTypeMap(exploreWayList)));
mAdapter.notifyDataSetChanged();
//总条数 TODO
//总条数
String originStr = String.format(getContext().getResources().getString(R.string.v2x_surrounding_top_brief), exploreWayList.size());
SpannableString spannableString = new SpannableString(originStr);
spannableString.setSpan(new ForegroundColorSpan(Color.parseColor("#256BFF")), 7, originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
@@ -166,7 +170,6 @@ public class SurroundingEventFragment extends MvpFragment<SurroundingEventView,
private Map<String, SurroundingConstruction> getPoiTypeMap(List<MarkerExploreWay> list) {
Map<String, SurroundingConstruction> mPoiTypeMarkers = new HashMap<>();
Log.d(TAG, "getPoiTypeMap list.size() = " + list.size());
for (int i = 0; i < list.size(); i++) {
MarkerExploreWay exploreWay = list.get(i);
if (!mPoiTypeMarkers.containsKey(exploreWay.getPoiType())) {
@@ -187,10 +190,11 @@ public class SurroundingEventFragment extends MvpFragment<SurroundingEventView,
List<SurroundingConstruction> valueList = new ArrayList<>(valueCollection);
Log.d(TAG, "handleMapToList valueList.size() = " + valueList.size());
return valueList;
}
// TODO 排序
/**
* 处理marker的显示
@@ -208,7 +212,7 @@ public class SurroundingEventFragment extends MvpFragment<SurroundingEventView,
V2XServiceManager.getMarkerManager().removeMarkers(ServiceConst.CARD_TYPE_ROAD_CONDITION);
try {
//处理 marker的显示
//处理 marker的显示 TODO 是否需要showbound
List<MarkerExploreWay> exploreWayList = construction.getConstrutList();
Logger.d(TAG, "onItemClickListener exploreWayList.size() = " + exploreWayList.size());
if (exploreWayList != null && exploreWayList.size() > 0) {

View File

@@ -79,13 +79,7 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
}
}
val historyMessage = V2XSQLiteUtils.getScenarioHistoryUnDisposeData()
if (historyMessage != null && historyMessage.size > 0) {
tvEventCount.visibility = View.VISIBLE
tvEventCount.text = "${historyMessage.size}"
} else {
tvEventCount.visibility = View.GONE
}
changeEventCount()
}
override fun onDestroyView() {
@@ -112,4 +106,15 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
fun isPanelShow(): Boolean {
return clPanelContainer.visibility == View.VISIBLE
}
// 修改未处理消息
fun changeEventCount() {
val historyMessage = V2XSQLiteUtils.getScenarioHistoryUnDisposeData()
if (historyMessage != null && historyMessage.size > 0) {
tvEventCount.visibility = View.VISIBLE
tvEventCount.text = "${historyMessage.size}"
} else {
tvEventCount.visibility = View.GONE
}
}
}

View File

@@ -8,9 +8,9 @@ import com.mogo.module.v2x.entity.net.V2XLivePushVoRes;
import com.mogo.module.v2x.entity.net.V2XSeekHelpRes;
import com.mogo.module.v2x.entity.net.V2XStrategyPushRes;
import com.mogo.module.v2x.entity.net.V2XUserInfoRes;
import com.mogo.module.v2x.entity.panel.SurroundingResponse;
import com.mogo.module.v2x.entity.panel.V2XShareEventDescription;
import com.mogo.module.v2x.entity.panel.V2XShareEventItem;
import com.mogo.module.v2x.entity.panel.SurroundingResponse;
import java.util.Map;
@@ -140,4 +140,11 @@ public interface V2XApiService {
@FormUrlEncoded
@POST("/deva/poiInfoFabulous/car/poi/no/addPoiInfoFabulous/v1")
Observable<BaseData> addPoiInfoFabulous(@FieldMap Map<String, Object> params);
/**
* 响应求助
*/
@FormUrlEncoded
@POST("/deva/poiInfoFabulous/car/poi/no/RespondingToHelp/v1")
Observable<BaseData> respondingToHelp(@FieldMap Map<String, Object> params);
}

View File

@@ -26,7 +26,6 @@ import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.RequestOptions;
import com.mogo.utils.network.utils.GsonUtil;
import java.util.HashMap;
import java.util.Map;
import io.reactivex.android.schedulers.AndroidSchedulers;
@@ -518,4 +517,35 @@ public class V2XRefreshModel {
});
}
}
/**
* 响应求助
* "seekHelpSn":"testSn01",求助SN
* "enthusiasticSn":"testSn02",响应求助SN
*/
public void respondingToHelp(String seekHelpSn) {
if (mV2XApiService != null) {
final Map<String, Object> map = new ParamsProvider.Builder(mContext).build();
String json = new StringBuilder()
.append("{")
.append("\"seekHelpSn\":").append(seekHelpSn)
.append(",")
.append("\"enthusiasticSn\":").append(Utils.getSn())
.append("}").toString();
map.put("data", json);
mV2XApiService.respondingToHelp(map).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new SubscribeImpl<BaseData>(RequestOptions.create(mContext)) {
@Override
public void onSuccess(BaseData o) {
super.onSuccess(o);
}
@Override
public void onError(String message, int code) {
super.onError(message, code);
}
});
}
}
}

View File

@@ -78,7 +78,7 @@ public class SurroundingEventPresenter extends Presenter<SurroundingEventView> {
@Override
public void onSuccess(SurroundingResponse data) {
super.onSuccess(data);
Log.e("SurroundingFragment", "onSuccess ------ ");
Logger.d("SurroundingFragment", "onSuccess ------> ");
if (data != null && data.getResult() != null) {
mView.showSurroudingData(data.getResult().getExploreWay());
}
@@ -87,7 +87,7 @@ public class SurroundingEventPresenter extends Presenter<SurroundingEventView> {
@Override
public void onError(String message, int code) {
super.onError(message, code);
Log.e("SurroundingFragment", "onError message = " + message + " >>> code = " + code);
Logger.e("SurroundingFragment", "onError message = " + message + " >>> code = " + code);
}
});

View File

@@ -7,7 +7,6 @@ import androidx.annotation.Nullable;
import com.mogo.commons.voice.AIAssist;
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
import com.mogo.commons.voice.VoicePreemptType;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.V2XHistoryScenarioData;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.v2x.V2XConst;
@@ -34,7 +33,7 @@ public abstract class AbsV2XScenario<T> implements IV2XScenario {
protected String TAG = "AbsV2XScenario";
private IV2XWindow mV2XWindow;
private IV2XButton mV2XButton;
private IV2XMarker<T> mV2XMarker;
private IV2XMarker mV2XMarker;
private IMoGoV2XStatusManager mV2XStatusManager;
private V2XMessageEntity<T> mV2XMessageEntity;
@@ -67,7 +66,7 @@ public abstract class AbsV2XScenario<T> implements IV2XScenario {
this.mV2XWindow = mV2XWindow;
}
public IV2XMarker<T> getV2XMarker() {
public IV2XMarker getV2XMarker() {
return mV2XMarker;
}
@@ -105,15 +104,9 @@ public abstract class AbsV2XScenario<T> implements IV2XScenario {
*
* @param markerExploreWay 要存储的场景
*/
public void saveLocalStory(int scenarioType ,MarkerExploreWay markerExploreWay) {
public void saveLocalStory(int scenarioType, Object markerExploreWay) {
try {
// 进行数据库存储
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
v2XHistoryScenarioData.setScenarioType(scenarioType);
v2XHistoryScenarioData.setTriggerTime(TimeUtils.getNowMills());
v2XHistoryScenarioData.setEventJsonData(GsonUtil.jsonFromObject(markerExploreWay));
v2XHistoryScenarioData.setDispose(false);
V2XSQLiteUtils.getScenarioHistoryDao().insert(v2XHistoryScenarioData);
V2XSQLiteUtils.saveLocalStory(scenarioType,markerExploreWay);
} catch (Exception e) {
e.printStackTrace();
}

View File

@@ -4,7 +4,6 @@ import android.content.Intent;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.mogo.module.common.entity.V2XHistoryScenarioData;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.scenario.IV2XScenarioManager;
@@ -16,8 +15,6 @@ import com.mogo.module.v2x.scenario.scene.park.V2XIllegalParkScenario;
import com.mogo.module.v2x.scenario.scene.push.V2XPushEventScenario;
import com.mogo.module.v2x.scenario.scene.road.V2XRoadEventScenario;
import com.mogo.module.v2x.scenario.scene.seek.V2XSeekHelpScenario;
import com.mogo.module.v2x.utils.TimeUtils;
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.utils.TipToast;
import com.mogo.utils.logger.Logger;
@@ -78,7 +75,6 @@ public class V2XScenarioManager implements IV2XScenarioManager {
break;
case V2XMessageEntity.V2XTypeEnum.ALERT_SEEK_WARNING:
mV2XScenario = V2XSeekHelpScenario.getInstance();
saveLocalStory(v2XMessageEntity);
break;
case V2XMessageEntity.V2XTypeEnum.ALERT_FATIGUE_DRIVING:
mV2XScenario = V2XFatigueDrivingScenario.getInstance();
@@ -114,23 +110,4 @@ public class V2XScenarioManager implements IV2XScenarioManager {
});
}
}
/**
* 存储本地数据
*
* @param v2XMessageEntity 要存储的场景
*/
void saveLocalStory(V2XMessageEntity v2XMessageEntity) {
try {
// 进行数据库存储
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
v2XHistoryScenarioData.setScenarioType(v2XMessageEntity.getType());
v2XHistoryScenarioData.setTriggerTime(TimeUtils.getNowMills());
v2XHistoryScenarioData.setDispose(false);
v2XHistoryScenarioData.setEventJsonData(GsonUtil.jsonFromObject(v2XMessageEntity.getContent()));
V2XSQLiteUtils.getScenarioHistoryDao().insert(v2XHistoryScenarioData);
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -5,9 +5,9 @@ import android.view.ViewGroup;
import androidx.annotation.Nullable;
import com.mogo.commons.voice.AIAssist;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XPoiTypeEnum;
import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
@@ -50,25 +50,45 @@ public class V2XSeekHelpScenario extends AbsV2XScenario<List<V2XMarkerEntity>> i
}
private List<V2XMarkerEntity> mMarkerEntity;
private V2XPushMessageEntity mV2XPushMessageEntity;
@Override
public void init(@Nullable V2XMessageEntity<List<V2XMarkerEntity>> v2XMessageEntity) {
setV2XMessageEntity(v2XMessageEntity);
try {
setV2XMessageEntity(v2XMessageEntity);
// 广播给ADAS和Launcher卡片
V2XRoadEventEntity eventEntity = new V2XRoadEventEntity();
eventEntity.setPoiType(V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING + "");
eventEntity.setExpireTime(30000);
eventEntity.setTts("发现其他车主的求助信息");
eventEntity.setAlarmContent("其他车主求助");
ADASUtils.broadcastToADAS(V2XServiceManager.getContext(), eventEntity);
// 广播给ADAS和Launcher卡片
V2XRoadEventEntity eventEntity = new V2XRoadEventEntity();
eventEntity.setPoiType(V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING + "");
eventEntity.setExpireTime(30000);
eventEntity.setTts("发现其他车主的求助信息");
eventEntity.setAlarmContent("其他车主求助");
ADASUtils.broadcastToADAS(V2XServiceManager.getContext(), eventEntity);
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
if (getV2XMessageEntity() != null &&
!V2XServiceManager.getMoGoV2XStatusManager().isOtherSeekHelpWindowShow()) {
mMarkerEntity = getV2XMessageEntity().getContent();
show();
mMarkerEntity = getV2XMessageEntity().getContent();
V2XMarkerEntity markerEntity = mMarkerEntity.get(0);
mV2XPushMessageEntity = new V2XPushMessageEntity();
mV2XPushMessageEntity.setLon(markerEntity.getLon());
mV2XPushMessageEntity.setLat(markerEntity.getLat());
mV2XPushMessageEntity.setDisplayName(markerEntity.getUserInfo().getDisplayName());
mV2XPushMessageEntity.setHeadImgUrl(markerEntity.getUserInfo().getHeadImgUrl());
mV2XPushMessageEntity.setSex(markerEntity.getUserInfo().getSex());
mV2XPushMessageEntity.setSn(markerEntity.getUserInfo().getSn());
mV2XPushMessageEntity.setCreateTime(markerEntity.getCreateTime());
mV2XPushMessageEntity.setDistance(markerEntity.getDistance());
mV2XPushMessageEntity.setExpireTime(20000);
saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_SEEK_WARNING, mV2XPushMessageEntity);
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
if (getV2XMessageEntity() != null &&
!V2XServiceManager.getMoGoV2XStatusManager().isOtherSeekHelpWindowShow()) {
show();
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
@@ -89,7 +109,7 @@ public class V2XSeekHelpScenario extends AbsV2XScenario<List<V2XMarkerEntity>> i
V2XServiceManager
.getMogoTopViewManager()
.addView(getV2XWindow().getView(), layoutParams, this);
getV2XWindow().show(mMarkerEntity);
getV2XWindow().show(mV2XPushMessageEntity);
}
}

View File

@@ -18,7 +18,6 @@ import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.adapter.V2XRoadEventAdapter;
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes.V2XMarkerEntity;
import com.mogo.module.v2x.listener.V2XWindowStatusListener;
import com.mogo.module.v2x.scenario.view.IV2XWindow;
import com.mogo.utils.logger.Logger;
@@ -35,7 +34,7 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
* desc : 他人发起的故障求助
* version: 1.0
*/
public class V2XSeekHelpWindow extends ConstraintLayout implements IV2XWindow<List<V2XMarkerEntity>> {
public class V2XSeekHelpWindow extends ConstraintLayout implements IV2XWindow<V2XPushMessageEntity> {
private static final String TAG = "V2XSeekHelpWindow";
// 展示列表
@@ -96,32 +95,18 @@ public class V2XSeekHelpWindow extends ConstraintLayout implements IV2XWindow<Li
}
@Override
public void show(List<V2XMarkerEntity> entityList) {
if (entityList != null && !entityList.isEmpty()) {
V2XMarkerEntity markerEntity = entityList.get(0);
mV2XPushMessageEntity = new V2XPushMessageEntity();
mV2XPushMessageEntity.setLon(markerEntity.getLon());
mV2XPushMessageEntity.setLat(markerEntity.getLat());
mV2XPushMessageEntity.setDisplayName(markerEntity.getUserInfo().getDisplayName());
mV2XPushMessageEntity.setHeadImgUrl(markerEntity.getUserInfo().getHeadImgUrl());
mV2XPushMessageEntity.setSex(markerEntity.getUserInfo().getSex());
mV2XPushMessageEntity.setSn(markerEntity.getUserInfo().getSn());
mV2XPushMessageEntity.setCreateTime(markerEntity.getCreateTime());
mV2XPushMessageEntity.setDistance(markerEntity.getDistance());
mV2XPushMessageEntity.setExpireTime(20000);
public void show(V2XPushMessageEntity xPushMessageEntity) {
if (xPushMessageEntity != null) {
mV2XPushMessageEntity = xPushMessageEntity;
// 清空数据
mItemList.clear();
//Logger.d(MODULE_NAME, "V2X===推送消息:" + v2XRoadEventEntity);
V2XEventShowEntity v2XEventShowEntity = new V2XEventShowEntity();
v2XEventShowEntity.setV2XPushMessageEntity(mV2XPushMessageEntity);
v2XEventShowEntity.setV2XPushMessageEntity(xPushMessageEntity);
v2XEventShowEntity.setViewType(V2XMessageEntity.V2XTypeEnum.ALERT_SEEK_WARNING);
mItemList.add(v2XEventShowEntity);
// 刷新列表
mV2XRoadEventAdapter.notifyDataSetChanged();
countDownV2XEvent();
}
}

View File

@@ -16,6 +16,7 @@ import com.mogo.module.common.entity.V2XPushMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.alarm.V2XAlarmServer;
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes;
import com.mogo.module.v2x.utils.TestOnLineCarUtils;
@@ -83,7 +84,11 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
mBtnTriggerSeekHelpEvent = findViewById(R.id.btnTriggerSeekHelpEvent);
mBtnTriggerParkEvent = findViewById(R.id.btnTriggerParkEvent);
mBtnTriggerOpen.setOnClickListener(v -> mFlTestPanel.setVisibility(GONE));
mBtnTriggerOpen.setOnClickListener(v ->
V2XServiceManager
.getIMogoWindowManager()
.removeView(V2XTestConsoleWindow.getInstance(context))
);
mBtnClearRoadEvent.setOnClickListener(v -> {
V2XAlarmServer.mAlertRoadEventList.clear();

View File

@@ -2,7 +2,9 @@ package com.mogo.module.v2x.utils;
import com.mogo.module.common.entity.V2XHistoryScenarioData;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.fragment.V2XEventPanelFragment;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
import com.mogo.utils.sqlite.SQLDaoFactory;
import com.mogo.utils.sqlite.SQLIDao;
@@ -61,6 +63,7 @@ public class V2XSQLiteUtils {
try {
int result = getScenarioHistoryDao().delete(new V2XHistoryScenarioData());
Logger.d(V2XConst.MODULE_NAME, "删除数据成功:" + result);
V2XEventPanelFragment.Companion.getInstance().changeEventCount();
} catch (Exception e) {
e.printStackTrace();
}
@@ -89,6 +92,27 @@ public class V2XSQLiteUtils {
try {
int result = getScenarioHistoryDao().update(oldScenarioData, newScenarioData);
Logger.d(V2XConst.MODULE_NAME, "修改数据成功:" + result);
V2XEventPanelFragment.Companion.getInstance().changeEventCount();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 存储本地数据
*
* @param markerExploreWay 要存储的场景
*/
public static void saveLocalStory(int scenarioType, Object markerExploreWay) {
try {
// 进行数据库存储
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
v2XHistoryScenarioData.setScenarioType(scenarioType);
v2XHistoryScenarioData.setTriggerTime(TimeUtils.getNowMills());
v2XHistoryScenarioData.setEventJsonData(GsonUtil.jsonFromObject(markerExploreWay));
v2XHistoryScenarioData.setDispose(false);
V2XSQLiteUtils.getScenarioHistoryDao().insert(v2XHistoryScenarioData);
V2XEventPanelFragment.Companion.getInstance().changeEventCount();
} catch (Exception e) {
e.printStackTrace();
}

View File

@@ -0,0 +1,33 @@
package com.mogo.module.v2x.view;
import android.graphics.Rect;
import android.view.View;
import androidx.recyclerview.widget.RecyclerView;
/**
* @author lixiaopeng
* @description
* @since 2020/8/11
*/
public class SurroundingMarginDecoration extends RecyclerView.ItemDecoration {
private int margin ;
public SurroundingMarginDecoration(int space) {
margin = space;
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
outRect.bottom = margin;
//由于每行都只有2个所以第一个都是2的倍数把左边距设为0
if (parent.getChildLayoutPosition(view) % 2 == 0) {
outRect.left = 0;
outRect.right = margin;
} else {
outRect.left = margin;
outRect.right = 0;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 749 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 749 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/surrounding_item_bottom_color"/>
<corners android:bottomLeftRadius="@dimen/module_v2x_surrounding_item_bottom_size"
android:bottomRightRadius="@dimen/module_v2x_surrounding_item_bottom_size"/>
</shape>

View File

@@ -20,7 +20,6 @@
android:layout_centerVertical="true"
android:layout_marginLeft="20px"
android:textSize="18px"
android:text="周边5公里共有23条数据 "
android:textColor="@color/white" />
<TextView
@@ -43,8 +42,8 @@
android:id="@+id/list_layout_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="15px"
android:layout_marginBottom="30px"
android:layout_marginTop="10px"
android:layout_marginBottom="20px"
android:layout_below="@+id/layout_top">
<androidx.recyclerview.widget.RecyclerView
@@ -68,7 +67,7 @@
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="59px"
android:src="@drawable/icon_default_black_logo" />
android:src="@drawable/mogo_image_blank_nor" />
<TextView
android:id="@+id/tv_main_empty_1"

View File

@@ -2,21 +2,18 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:layout_width="291px"
android:layout_height="173px"
android:padding="8px"
android:background="#FF1B1B">
android:layout_height="173px">
<ImageView
android:id="@+id/iv_event_bg"
android:layout_width="291px"
android:layout_height="130px"
android:scaleType="center"
android:src="@drawable/icon_default_black_logo" />
android:layout_width="280px"
android:layout_height="130px" />
<RelativeLayout
android:layout_below="@+id/iv_event_bg"
android:background="@color/surrounding_item_bottom_color"
android:layout_width="match_parent"
android:background="@drawable/bg_v2x_event_surrounding_item_bottom"
android:layout_width="280px"
android:layout_height="43px">
<ImageView
@@ -43,7 +40,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="22px"
android:layout_marginRight="30px"
android:layout_centerVertical="true"
android:textSize="16px"
android:textColor="@color/transparent_white_30"

View File

@@ -23,5 +23,6 @@
<dimen name="module_v2x_event_distance_title">40px</dimen>
<dimen name="module_v2x_history_event_icon_size">80px</dimen>
<dimen name="module_v2x_surrounding_item_bottom_size">6px</dimen>
</resources>

View File

@@ -24,6 +24,7 @@
<dimen name="module_v2x_event_distance_title">22px</dimen>
<dimen name="module_v2x_history_event_icon_size">40px</dimen>
<dimen name="module_v2x_surrounding_item_bottom_size">6px</dimen>
<dimen name="module_v2x_surrounding_item_size">16px</dimen>
</resources>

View File

@@ -6,7 +6,7 @@
<style name="customRatingBarStyle" parent="@style/Widget.AppCompat.RatingBar">
<item name="android:minHeight">18px</item>
<item name="android:maxHeight">18px</item>
<item name="android:maxHeight">20px</item>
<item name="android:maxWidth">16px</item>
<item name="android:minWidth">16px</item>
<item name="android:spacing">3.7px</item>

View File

@@ -1,5 +1,6 @@
package com.mogo.service.entrance;
import android.view.View;
import android.widget.TextView;
import com.alibaba.android.arouter.facade.template.IProvider;
@@ -19,4 +20,25 @@ public interface IMogoEntranceButtonController extends IProvider {
* @return
*/
TextView getButton( ButtonIndex index );
/**
* 添加低层级view使用ViewGroup.addView(v,0)实现
* @param view 将要添加的view
*/
void addBottomLayerView(View view);
/**
* 添加低层级view使用ViewGroup.addView(v,0)实现
* 可指定x,y位置
* @param view 将要添加的view
* @param x leftMargin
* @param y topMargin
*/
void addBottomLayerView(View view, int x, int y);
/**
* 移除对应的底层view
* @param view 待移除view
*/
void removeBottomLayerView(View view);
}