Merge branch 'qa_1.1' into dev
This commit is contained in:
@@ -30,7 +30,7 @@ public class ParamsUtil {
|
||||
public static Map< String, Object > getDynamicParams() {
|
||||
Map< String, Object > params = new ArrayMap();
|
||||
|
||||
final Map<String,Object> location = LocationHelper.getInstance().getLocationProperties();
|
||||
final Map< String, Object > location = LocationHelper.getInstance().getLocationProperties();
|
||||
if ( location != null ) {
|
||||
params.putAll( location );
|
||||
}
|
||||
@@ -71,7 +71,8 @@ public class ParamsUtil {
|
||||
public static Map< String, Object > getAnalyticsCustomParams() {
|
||||
Map< String, Object > map = new ArrayMap<>();
|
||||
map.put( "debug", DebugConfig.isDebug() ? 1 : 0 );
|
||||
map.put( "systemversion", Utils.getFotaVersion() );
|
||||
String fota = Utils.getFotaVersion();
|
||||
map.put( "systemversion", TextUtils.isEmpty( fota ) ? DebugConfig.getProductFlavor() : fota );
|
||||
map.put( "sn", Utils.getSn() );
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -103,5 +103,5 @@ MOGO_MODULE_SPLASH_NOOP_VERSION = 1.0.0-SNAPSHOT
|
||||
## 产品库必备配置
|
||||
applicationId=com.mogo.launcer
|
||||
applicationName=IntelligentPilot
|
||||
versionCode=80006
|
||||
versionName=8.0.6
|
||||
versionCode=80007
|
||||
versionName=8.0.7-qa_1.1
|
||||
@@ -321,6 +321,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void onNaviMapMode( int mode ) {
|
||||
Logger.i( TAG, "mode=" + mode );
|
||||
MogoMapListenerHandler.getInstance().onMapModeChanged( mode == 0 ? EnumMapUI.CarUp_2D : EnumMapUI.NorthUP_2D );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,14 +18,14 @@ public interface V2XPoiTypeEnum extends MarkerPoiTypeEnum {
|
||||
String ALERT_TRAFFIC_LIGHT_WARNING = "99996";
|
||||
// 故障车辆
|
||||
int ALERT_CAR_TROUBLE_WARNING = 20007;
|
||||
// 疲劳驾驶
|
||||
String ALERT_FATIGUE_DRIVING = "99993";
|
||||
// 违章停车
|
||||
String ALERT_ILLEGAL_PARK = "99992";
|
||||
|
||||
// TODO 这里目前是演示DEMO会用到,想着是打算商用,先这么处理的
|
||||
// 取快递
|
||||
String ALERT_TRAFFIC_EXPRESS = "99995";
|
||||
// 顺风车
|
||||
String ALERT_TRAFFIC_TAXI = "99994";
|
||||
// 疲劳驾驶
|
||||
String ALERT_FATIGUE_DRIVING = "99993";
|
||||
// 违章停车
|
||||
String ALERT_ILLEGAL_PARK = "99992";
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.zhidao.mogo.module.event.panel.adapter
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
import com.zhidao.mogo.module.event.panel.fragment.MyShareFragment
|
||||
import com.zhidao.mogo.module.event.panel.fragment.ShareEventsFragment
|
||||
import com.zhidao.mogo.module.event.panel.fragment.SurroundingEventFragment
|
||||
import com.zhidao.mogo.module.event.panel.fragment.TripRecordFragment
|
||||
|
||||
@@ -12,7 +13,7 @@ import com.zhidao.mogo.module.event.panel.fragment.TripRecordFragment
|
||||
* @author tongchenfei
|
||||
*/
|
||||
class EventPagerAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) {
|
||||
private val fragments:Array<Fragment> = arrayOf(TripRecordFragment(), SurroundingEventFragment(), MyShareFragment())
|
||||
private val fragments:Array<Fragment> = arrayOf(TripRecordFragment(), SurroundingEventFragment(), ShareEventsFragment())
|
||||
|
||||
/**
|
||||
* 目前一共就三个fragment
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
package com.zhidao.mogo.module.event.panel.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.zhidao.mogo.module.event.panel.R;
|
||||
import com.zhidao.mogo.module.event.panel.bean.ShareEventDescription;
|
||||
import com.zhidao.mogo.module.event.panel.bean.ShareEventItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ShareEventAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
private Context context;
|
||||
private ArrayList<ShareEventItem> dataArrayList;
|
||||
private Object Tag = "ShareEventAdapter";
|
||||
private final LayoutInflater shareLayoutInflater;
|
||||
|
||||
public static enum ITEM_TYPE {
|
||||
ITEM_TYPE_NUM_DES,
|
||||
ITEM_TYPE_SHARE_LIST_ITEM,
|
||||
ITEM_TYPE_SHARE_EMPTY
|
||||
}
|
||||
|
||||
public ShareEventAdapter(Context context, ArrayList<ShareEventItem> dataArrayList) {
|
||||
this.context = context;
|
||||
this.dataArrayList = dataArrayList;
|
||||
shareLayoutInflater = LayoutInflater.from(context);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
//根据viewType创建自定义布局
|
||||
if (viewType == ITEM_TYPE.ITEM_TYPE_NUM_DES.ordinal()) {
|
||||
View v = shareLayoutInflater.inflate(R.layout.module_event_panel_share_description, parent,
|
||||
false);
|
||||
shareDescriptionViewHolder holder = new shareDescriptionViewHolder(v);
|
||||
return holder;
|
||||
} else if ((viewType == ITEM_TYPE.ITEM_TYPE_SHARE_LIST_ITEM.ordinal())) {
|
||||
View v = shareLayoutInflater.inflate(R.layout.module_event_panel_share_item, parent,
|
||||
false);
|
||||
shareItemViewHolder holder = new shareItemViewHolder(v);
|
||||
return holder;
|
||||
} else {
|
||||
View v = shareLayoutInflater.inflate(R.layout.module_event_panel_share_empty, parent,
|
||||
false);
|
||||
shareEmptyViewHolder holder = new shareEmptyViewHolder(v);
|
||||
return holder;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
|
||||
if (position == 0) {
|
||||
ShareEventDescription data = new ShareEventDescription();
|
||||
data.shareNum = "12";
|
||||
data.approveNum = "10";
|
||||
|
||||
((shareDescriptionViewHolder) holder).shareNumTextView.setText(data.shareNum);
|
||||
((shareDescriptionViewHolder) holder).approveNumTextView.setText(data.approveNum);
|
||||
|
||||
} else {
|
||||
if (dataArrayList.size() > 0) {
|
||||
ShareEventItem data = dataArrayList.get(position - 1);
|
||||
data.usefulNum = "2";
|
||||
data.uselessNum = "3";
|
||||
((shareItemViewHolder) holder).caseStyleTextView.setText(data.caseStyle);
|
||||
((shareItemViewHolder) holder).caseAddressTextView.setText(data.caseAddress);
|
||||
((shareItemViewHolder) holder).caseTimeTextView.setText(data.caseTime);
|
||||
((shareItemViewHolder) holder).caseUsefulTextView.setText(data.usefulNum);
|
||||
((shareItemViewHolder) holder).caseUselessTextView.setText(data.uselessNum);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return dataArrayList.size() + dataArrayList.size() > 0 ? 1 : 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
switch (dataArrayList.size()) {
|
||||
case 0:
|
||||
return position == 0 ? ITEM_TYPE.ITEM_TYPE_NUM_DES.ordinal() : ITEM_TYPE.ITEM_TYPE_SHARE_EMPTY.ordinal();
|
||||
}
|
||||
|
||||
int type = position == 0 ? ITEM_TYPE.ITEM_TYPE_NUM_DES.ordinal() : ITEM_TYPE.ITEM_TYPE_SHARE_LIST_ITEM.ordinal();
|
||||
return type;
|
||||
}
|
||||
|
||||
/*
|
||||
* 分享列表
|
||||
* */
|
||||
class shareItemViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView caseStyleTextView;
|
||||
private TextView caseAddressTextView;
|
||||
private TextView caseTimeTextView;
|
||||
private TextView caseUsefulTextView;
|
||||
private TextView caseUselessTextView;
|
||||
|
||||
public shareItemViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
caseStyleTextView = itemView.findViewById(R.id.road_case_style);
|
||||
caseAddressTextView = itemView.findViewById(R.id.road_case_address);
|
||||
caseTimeTextView = itemView.findViewById(R.id.road_case_share_time);
|
||||
caseUsefulTextView = itemView.findViewById(R.id.road_case_useful_num);
|
||||
caseUselessTextView = itemView.findViewById(R.id.road_case_useless_num);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 分享次数,热心指数...
|
||||
* */
|
||||
class shareDescriptionViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView shareNumTextView;
|
||||
private TextView approveNumTextView;
|
||||
|
||||
public shareDescriptionViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
shareNumTextView = itemView.findViewById(R.id.share_num);
|
||||
approveNumTextView = itemView.findViewById(R.id.share_approve);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 去分享
|
||||
* */
|
||||
class shareEmptyViewHolder extends RecyclerView.ViewHolder {
|
||||
public shareEmptyViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.zhidao.mogo.module.event.panel.bean;
|
||||
|
||||
public class ShareEventDescription {
|
||||
public String shareNum;
|
||||
public String approveNum;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.zhidao.mogo.module.event.panel.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ShareEventItem implements Serializable {
|
||||
public String caseStyle;
|
||||
public String caseAddress;
|
||||
public String caseTime;
|
||||
public String usefulNum;
|
||||
public String uselessNum;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class MyShareFragment : MvpFragment<MyShareFragment, MySharePresenter>() {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
override fun getLayoutId(): Int = R.layout.module_event_panel_fragment_my_share
|
||||
override fun getLayoutId(): Int = R.layout.module_event_panel_share_item
|
||||
|
||||
/**
|
||||
* 初始化控件,必须在初始化完成之后才可以实例化presenter,避免
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.zhidao.mogo.module.event.panel.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.zhidao.mogo.module.event.panel.R;
|
||||
import com.zhidao.mogo.module.event.panel.adapter.ShareEventAdapter;
|
||||
import com.zhidao.mogo.module.event.panel.bean.ShareEventItem;
|
||||
import com.zhidao.mogo.module.event.panel.presenter.ShareEventsPresenter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ShareEventsFragment extends MvpFragment<ShareEventsFragment, ShareEventsPresenter> {
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
private View view;
|
||||
private ShareEventAdapter adapter;
|
||||
private ArrayList<ShareEventItem> dataArrayList = new ArrayList<ShareEventItem>();
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.module_event_panel_share_recylerview;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
view = inflater.inflate(R.layout.module_event_panel_share_recylerview, container, false);
|
||||
initRecyclerView();
|
||||
initData();
|
||||
return view;
|
||||
}
|
||||
|
||||
private void initRecyclerView() {
|
||||
recyclerView = view.findViewById(R.id.road_case_share_list);
|
||||
adapter = new ShareEventAdapter(getActivity(),dataArrayList);
|
||||
recyclerView.setAdapter(adapter);
|
||||
LinearLayoutManager linearLayoutManager =
|
||||
new LinearLayoutManager( getActivity(), LinearLayoutManager.VERTICAL, false );
|
||||
recyclerView.setLayoutManager(linearLayoutManager);
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
// for (int i = 0; i < 12; i++) {
|
||||
// ShareEventItem data = new ShareEventItem();
|
||||
// data.caseStyle = "道路拥堵";
|
||||
// data.caseAddress = "环球贸易中心";
|
||||
// data.caseTime = "2020-07-21 12:00:00";
|
||||
// dataArrayList.add(data);
|
||||
// }
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected ShareEventsPresenter createPresenter() {
|
||||
return new ShareEventsPresenter(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.zhidao.mogo.module.event.panel.presenter;
|
||||
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.zhidao.mogo.module.event.panel.fragment.ShareEventsFragment;
|
||||
|
||||
public class ShareEventsPresenter extends Presenter <ShareEventsFragment>{
|
||||
public ShareEventsPresenter(IView view) {
|
||||
super((ShareEventsFragment) view);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/clPanelContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="My Share"
|
||||
android:textColor="#fff"
|
||||
android:textSize="40sp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_num"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="25sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/shre_num_des"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:text="分享次数"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="80dp"
|
||||
android:background="#FFFFFF" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_approve"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="25sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_approve_des"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:gravity="center"
|
||||
android:text="车友认同次数"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="80dp"
|
||||
android:background="#FFFFFF" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/share_index"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:background="@drawable/amap_ride" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_index_des"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:gravity="center"
|
||||
android:text="热心指数"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_event_guide_des"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center"
|
||||
android:text="小窍门:分享路况、点赞其他车友,有助于提高热心指数"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="16sp">
|
||||
|
||||
</TextView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_event_null_des"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="100dp"
|
||||
android:layout_below="@+id/share_event_guide_des"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center"
|
||||
android:text="你还没有分享过道路事件,快去试试吧" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/shre_event_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/share_event_null_des"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="#FFFFFF"
|
||||
android:text="去分享"
|
||||
android:textSize="25sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,85 @@
|
||||
<?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/road_case_liset_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/road_case_style"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="20dp"
|
||||
android:background="#1E90FF"
|
||||
android:text="道路类型"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/road_case_address"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/road_case_style"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="15dp"
|
||||
android:text="东城区北三环"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/road_case_share_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/road_case_address"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="20dp"
|
||||
android:text="时间:"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/road_case_useless"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:background="@drawable/amap_bus" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/road_case_useless_num"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@id/road_case_useless"
|
||||
android:layout_alignLeft="@id/road_case_useless"
|
||||
android:layout_alignRight="@id/road_case_useless"
|
||||
android:gravity="center"
|
||||
android:text="10"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/road_case_uselful"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignTop="@id/road_case_useless"
|
||||
android:layout_alignBottom="@id/road_case_useless"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_toLeftOf="@id/road_case_useless"
|
||||
android:background="@drawable/amap_ride" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/road_case_useful_num"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@id/road_case_useless"
|
||||
android:layout_alignLeft="@id/road_case_uselful"
|
||||
android:layout_alignRight="@id/road_case_uselful"
|
||||
android:gravity="center"
|
||||
android:text="5"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="15sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/road_case_share_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:overScrollMode="never"
|
||||
android:background="#000000"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
|
||||
|
||||
@@ -43,7 +43,6 @@ dependencies {
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
implementation rootProject.ext.dependencies.rxjava
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
implementation rootProject.ext.dependencies.tanluupload
|
||||
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
api rootProject.ext.dependencies.mogomap
|
||||
|
||||
@@ -3,13 +3,11 @@ package com.mogo.module.extensions.entrance;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.text.TextUtils;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -18,6 +16,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
@@ -58,7 +57,6 @@ import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.glide.GlideApp;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.roadcondition.service.DelayService;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -168,15 +166,18 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
mDisplayOverviewText = findViewById(R.id.module_ext_id_display_overview_text);
|
||||
mDisplayOverviewIcon = findViewById(R.id.module_ext_id_display_overview_icon);
|
||||
mDisplayOverview.setOnClickListener(view -> {
|
||||
if (!mStatusManager.isDisplayOverview()) {
|
||||
mMApUIController.displayOverview(mDisplayOverviewBounds);
|
||||
UiThreadHandler.removeCallbacks(mLockCarRunnable);
|
||||
UiThreadHandler.postDelayed(mLockCarRunnable, 20_000);
|
||||
} else {
|
||||
mMApUIController.recoverLockMode();
|
||||
UiThreadHandler.removeCallbacks(mLockCarRunnable);
|
||||
if (getContext() != null) {
|
||||
// 加此判断是解决下面setDisplayOverview后,本Fragment回调中出现not attached to a context问题
|
||||
if (!mStatusManager.isDisplayOverview()) {
|
||||
mMApUIController.displayOverview(mDisplayOverviewBounds);
|
||||
UiThreadHandler.removeCallbacks(mLockCarRunnable);
|
||||
UiThreadHandler.postDelayed(mLockCarRunnable, 20_000);
|
||||
} else {
|
||||
mMApUIController.recoverLockMode();
|
||||
UiThreadHandler.removeCallbacks(mLockCarRunnable);
|
||||
}
|
||||
mStatusManager.setDisplayOverview(TAG, !mStatusManager.isDisplayOverview());
|
||||
}
|
||||
mStatusManager.setDisplayOverview(TAG, !mStatusManager.isDisplayOverview());
|
||||
});
|
||||
|
||||
mMove2CurrentLocation = findViewById(R.id.module_entrance_id_move2_current_location);
|
||||
@@ -239,9 +240,9 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
} else {
|
||||
mMApUIController.changeMapMode(EnumMapUI.NorthUP_2D);
|
||||
}
|
||||
mCameraMode.setSelected(!mCameraMode.isSelected());
|
||||
mCameraMode.setText(getString(mCameraMode.isSelected() ? R.string.mode_car_up :
|
||||
R.string.mode_north_up));
|
||||
// mCameraMode.setSelected(!mCameraMode.isSelected());
|
||||
// mCameraMode.setText(getString(mCameraMode.isSelected() ? R.string.mode_car_up :
|
||||
// R.string.mode_north_up));
|
||||
});
|
||||
|
||||
|
||||
@@ -463,23 +464,18 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
if (isTrue) {
|
||||
mDisplayOverviewText.setText("退出全览");
|
||||
mDisplayOverviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX,
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_display_overview_textSize));
|
||||
AbsMogoApplication.getApp().getResources().getDimensionPixelSize(R.dimen.module_ext_display_overview_textSize));
|
||||
mCameraMode.setVisibility(View.GONE);
|
||||
} else {
|
||||
mDisplayOverviewText.setText("全览");
|
||||
mDisplayOverviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX,
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_display_overview_textSize_large));
|
||||
AbsMogoApplication.getApp().getResources().getDimensionPixelSize(R.dimen.module_ext_display_overview_textSize_large));
|
||||
if (CustomNaviInterrupter.getInstance().interrupt()) {
|
||||
mCameraMode.setVisibility(View.GONE);
|
||||
} else {
|
||||
mCameraMode.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
} else if (descriptor == StatusDescriptor.ACC_STATUS) {
|
||||
Log.d(TAG, " onStatusChanged isTrue = " + isTrue);
|
||||
if (isTrue) {
|
||||
DelayService.Companion.launchService(getContext());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -515,8 +511,9 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
}
|
||||
}
|
||||
|
||||
private int[] heights = new int[]{100,200,300};
|
||||
private int[] heights = new int[]{100, 200, 300};
|
||||
private int currentHeight;
|
||||
|
||||
private void debugTopView() {
|
||||
findViewById(R.id.btnDebugCtrlNaviView).setOnClickListener(view -> {
|
||||
if (!toggle) {
|
||||
@@ -585,4 +582,13 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapModeChanged( EnumMapUI ui ) {
|
||||
if ( mCameraMode == null ) {
|
||||
return;
|
||||
}
|
||||
mCameraMode.setSelected(ui == EnumMapUI.NorthUP_2D);
|
||||
mCameraMode.setText(getString(ui == EnumMapUI.NorthUP_2D ? R.string.mode_car_up : R.string.mode_north_up));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,8 +63,6 @@ public class MarkerServiceHandler {
|
||||
private static ICarsChattingProvider sCarChatting;
|
||||
private static IMogoGpsSimulatorManager sGpsSimulatorManager;
|
||||
|
||||
private static MapMarkerManager sMapMarkerManager;
|
||||
|
||||
public static synchronized void init( final Context context ) {
|
||||
|
||||
if ( sGpsSimulatorManager != null ) {
|
||||
@@ -92,8 +90,7 @@ public class MarkerServiceHandler {
|
||||
|
||||
sCarChatting = ( ICarsChattingProvider ) ARouter.getInstance().build( CallChattingProviderConstant.CAR_CALL_PROVIDER ).navigation( context );
|
||||
|
||||
sMapMarkerManager = MapMarkerManager.getInstance();
|
||||
sMapMarkerManager.init( context );
|
||||
MapMarkerManager.getInstance().init( context );
|
||||
|
||||
sGpsSimulatorManager = ARouter.getInstance().navigation( IMogoGpsSimulatorManager.class );
|
||||
}
|
||||
@@ -143,7 +140,7 @@ public class MarkerServiceHandler {
|
||||
}
|
||||
|
||||
public static MapMarkerManager getMapMarkerManager() {
|
||||
return sMapMarkerManager;
|
||||
return MapMarkerManager.getInstance();
|
||||
}
|
||||
|
||||
public static IMogoRegisterCenter getRegisterCenter() {
|
||||
|
||||
@@ -77,6 +77,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
private Rect mMarkerDisplayBounds;
|
||||
|
||||
private MapMarkerManager() {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
}
|
||||
|
||||
public static synchronized MapMarkerManager getInstance() {
|
||||
@@ -95,7 +96,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
* @param context
|
||||
*/
|
||||
public void init( Context context ) {
|
||||
mContext = context;
|
||||
mRefreshModel = new RefreshModel( mContext );
|
||||
|
||||
// 长连接
|
||||
|
||||
@@ -34,12 +34,14 @@ class BydSplashFragment :MvpFragment<BydSplashFragment,BydSplashPresenter>(),Han
|
||||
|
||||
override fun handleMessage(msg: Message): Boolean {
|
||||
if (msg.what == MSG_COUNT_DOWN) {
|
||||
countDownTime--
|
||||
if(countDownTime>0) {
|
||||
tvCountDown.text = countDownTime.toString()
|
||||
handler.sendEmptyMessageDelayed(MSG_COUNT_DOWN, DEFAULT_COUNT_DOWN_DELAY)
|
||||
}else{
|
||||
hideSplash()
|
||||
tvCountDown?.also {
|
||||
countDownTime--
|
||||
if(countDownTime>0) {
|
||||
it.text = countDownTime.toString()
|
||||
handler.sendEmptyMessageDelayed(MSG_COUNT_DOWN, DEFAULT_COUNT_DOWN_DELAY)
|
||||
}else{
|
||||
hideSplash()
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -140,12 +140,12 @@ public class V2XModuleProvider implements
|
||||
intentFilter.addAction(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
|
||||
localBroadcastManager.registerReceiver(localReceiver, intentFilter);
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
// TODO 这是测试页面
|
||||
V2XServiceManager
|
||||
.getIMogoWindowManager()
|
||||
.addView(new V2XTestConsoleWindow(context), 0, 0, false);
|
||||
}
|
||||
// if (BuildConfig.DEBUG) {
|
||||
// // TODO 这是测试页面
|
||||
// V2XServiceManager
|
||||
// .getIMogoWindowManager()
|
||||
// .addView(new V2XTestConsoleWindow(context), 0, 0, false);
|
||||
// }
|
||||
}
|
||||
|
||||
private void initVoice(Context context) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.mogo.module.v2x.listener.V2XMessageListener_401007;
|
||||
import com.mogo.module.v2x.listener.V2XMessageListener_401009;
|
||||
import com.mogo.module.v2x.listener.V2XMessageListener_401010;
|
||||
import com.mogo.module.v2x.listener.V2XMessageListener_401011;
|
||||
import com.mogo.module.v2x.listener.V2XMessageListener_401012;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
@@ -22,7 +23,8 @@ public class V2XSocketManager {
|
||||
|
||||
private static V2XSocketManager mV2XSocketManager;
|
||||
|
||||
private V2XMessageListener_401011 v2XMessageListener_401001;
|
||||
private V2XMessageListener_401011 v2XMessageListener_401011;
|
||||
private V2XMessageListener_401012 v2XMessageListener_401012;
|
||||
private V2XMessageListener_401003 v2XMessageListener_401003;
|
||||
private V2XMessageListener_401005 v2XMessageListener_401005;
|
||||
private V2XMessageListener_401006 v2XMessageListener_401006;
|
||||
@@ -52,6 +54,7 @@ public class V2XSocketManager {
|
||||
public void registerSocketMessage() {
|
||||
Logger.d(MODULE_NAME, "开始注册Socket通道....");
|
||||
register401011();
|
||||
register401012();
|
||||
register401005();
|
||||
register401007();
|
||||
register401009();
|
||||
@@ -66,10 +69,15 @@ public class V2XSocketManager {
|
||||
*/
|
||||
public void unregisterSocketMessage() {
|
||||
Logger.w(MODULE_NAME, "反注册Socket通道....");
|
||||
if (v2XMessageListener_401001 != null) {
|
||||
if (v2XMessageListener_401011 != null) {
|
||||
V2XServiceManager
|
||||
.getMoGoSocketManager()
|
||||
.unregisterOnMessageListener(401011, v2XMessageListener_401001);
|
||||
.unregisterOnMessageListener(401011, v2XMessageListener_401011);
|
||||
}
|
||||
if (v2XMessageListener_401012 != null) {
|
||||
V2XServiceManager
|
||||
.getMoGoSocketManager()
|
||||
.unregisterOnMessageListener(401012, v2XMessageListener_401012);
|
||||
}
|
||||
if (v2XMessageListener_401003 != null) {
|
||||
V2XServiceManager
|
||||
@@ -102,13 +110,27 @@ public class V2XSocketManager {
|
||||
* 道路事件,在线车辆绘制
|
||||
*/
|
||||
private void register401011() {
|
||||
v2XMessageListener_401001 = new V2XMessageListener_401011();
|
||||
v2XMessageListener_401011 = new V2XMessageListener_401011();
|
||||
// 道路事件,在线车辆绘制
|
||||
V2XServiceManager
|
||||
.getMoGoSocketManager()
|
||||
.registerOnMessageListener(
|
||||
401011,
|
||||
v2XMessageListener_401001
|
||||
v2XMessageListener_401011
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 道路事件,服务端下发
|
||||
*/
|
||||
private void register401012() {
|
||||
v2XMessageListener_401012 = new V2XMessageListener_401012();
|
||||
// 道路事件,在线车辆绘制
|
||||
V2XServiceManager
|
||||
.getMoGoSocketManager()
|
||||
.registerOnMessageListener(
|
||||
401012,
|
||||
v2XMessageListener_401012
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -201,37 +201,28 @@ public class V2XRoadEventDetailVH extends V2XBaseViewHolder {
|
||||
tvEventTime.setText(eventTime);
|
||||
}
|
||||
|
||||
// 事件距离车辆小于50米的时候可以用户纠错
|
||||
if (mV2XRoadEventEntity.getDistance() < 50) {
|
||||
ivEventReportTrue.setVisibility(VISIBLE);
|
||||
ivEventReportErr.setVisibility(VISIBLE);
|
||||
|
||||
ivEventLive.setVisibility(GONE);
|
||||
ivEventZan.setVisibility(GONE);
|
||||
if (!ArrayUtils.isEmpty(mV2XEventShowEntity.getV2XLiveCarList())) {
|
||||
ivEventLive.setVisibility(VISIBLE);
|
||||
V2XVoiceManager.INSTANCE
|
||||
.registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_LIVE_ROAD,
|
||||
v2XVoiceOpenLiveListener)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_LIVE_UN_WAKEUP,
|
||||
v2XVoiceOpenLiveListener);
|
||||
ivEventLive.setOnClickListener(v -> {
|
||||
showLiveCar(v2XEventShowEntity);
|
||||
});
|
||||
} else {
|
||||
if (!ArrayUtils.isEmpty(mV2XEventShowEntity.getV2XLiveCarList())) {
|
||||
ivEventLive.setVisibility(VISIBLE);
|
||||
V2XVoiceManager.INSTANCE
|
||||
.registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_LIVE_ROAD,
|
||||
v2XVoiceOpenLiveListener)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_LIVE_UN_WAKEUP,
|
||||
v2XVoiceOpenLiveListener);
|
||||
ivEventLive.setOnClickListener(v -> {
|
||||
showLiveCar(v2XEventShowEntity);
|
||||
});
|
||||
} else {
|
||||
ivEventLive.setVisibility(GONE);
|
||||
}
|
||||
ivEventLive.setVisibility(GONE);
|
||||
}
|
||||
|
||||
ivEventReportTrue.setVisibility(GONE);
|
||||
ivEventReportErr.setVisibility(GONE);
|
||||
ivEventZan.setVisibility(VISIBLE);
|
||||
ivEventReportTrue.setVisibility(GONE);
|
||||
ivEventReportErr.setVisibility(GONE);
|
||||
ivEventZan.setVisibility(VISIBLE);
|
||||
|
||||
// 用户上报的才会展示拨打电话
|
||||
if (!TextUtils.isEmpty(mNoveltyInfo.getUploadType())
|
||||
&& mNoveltyInfo.getUploadType().equals("1")) {
|
||||
requestUserInfo(mNoveltyInfo);
|
||||
}
|
||||
// 用户上报的才会展示拨打电话
|
||||
if (!TextUtils.isEmpty(mNoveltyInfo.getUploadType())
|
||||
&& mNoveltyInfo.getUploadType().equals("1")) {
|
||||
requestUserInfo(mNoveltyInfo);
|
||||
}
|
||||
|
||||
ivEventReportTrue.setOnClickListener(v -> {
|
||||
|
||||
@@ -35,6 +35,7 @@ import com.mogo.utils.network.utils.GsonUtil;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
@@ -51,8 +52,7 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
*/
|
||||
public class V2XAlarmServer {
|
||||
// 记录道路播报的事件
|
||||
private static HashMap<V2XRoadEventEntity, String> mAlertRoadEventList = new HashMap<>();
|
||||
private static HashSet<V2XRoadEventEntity> mAlertRoadEventCorrectionList = new HashSet<>();
|
||||
public static ConcurrentHashMap<V2XRoadEventEntity, String> mAlertRoadEventList = new ConcurrentHashMap<>();
|
||||
|
||||
// 记录违章停车播报事件
|
||||
private static HashMap<MarkerExploreWay, String> mAlertIllegalParkEventList = new HashMap<>();
|
||||
@@ -112,13 +112,6 @@ public class V2XAlarmServer {
|
||||
isAlreadyAlert = true;
|
||||
}
|
||||
}
|
||||
// 判断是否是纠错,如果是纠错就忽略掉带有时间段的道路提醒
|
||||
if (v2XRoadEventEntity.getDistance() <= 50) {
|
||||
if (!mAlertRoadEventCorrectionList.contains(v2XRoadEventEntity)) {
|
||||
mAlertRoadEventCorrectionList.add(v2XRoadEventEntity);
|
||||
isAlreadyAlert = false;
|
||||
}
|
||||
}
|
||||
// Logger.w(MODULE_NAME, "V2X预警--车辆与事件信息:" +
|
||||
// "\n距离:" + v2XRoadEventEntity.getDistance() + "米" +
|
||||
// "\n是否已经提醒:" + isAlreadyAlert +
|
||||
|
||||
@@ -69,11 +69,9 @@ public class V2XLocationListener implements IMogoLocationListener, CarStatusList
|
||||
@Override
|
||||
public void onLocationChanged(MogoLocation location) {
|
||||
try {
|
||||
Logger.d(V2XConst.MODULE_NAME, "V2X预警--onLocationChanged: " + GsonUtil.jsonFromObject(location));
|
||||
|
||||
//Logger.d(V2XConst.MODULE_NAME, "V2X预警--onLocationChanged: " + GsonUtil.jsonFromObject(location));
|
||||
// 刷新角度
|
||||
getCurrentCarAngle(location);
|
||||
|
||||
// 只有车速大于 5 的时候进行计算
|
||||
if (location.getSpeed() >= 5) {
|
||||
refreshCurrentCarState(location);
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.mogo.module.v2x.listener;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.module.common.entity.MarkerCardResult;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.service.Utils;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.alarm.V2XAlarmServer;
|
||||
import com.mogo.module.v2x.utils.TimeUtils;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020/4/1 10:23 AM
|
||||
* desc : 道路事件服务端下发触发
|
||||
* version: 1.0
|
||||
*/
|
||||
public class V2XMessageListener_401012 implements IMogoOnMessageListener<MarkerCardResult> {
|
||||
|
||||
@Override
|
||||
public Class<MarkerCardResult> target() {
|
||||
return MarkerCardResult.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(MarkerCardResult response) {
|
||||
Logger.d(MODULE_NAME, "V2XMessageListener_401012==V2X服务端下发:\n"
|
||||
+ GsonUtil.jsonFromObject(response));
|
||||
try {
|
||||
if (response.getExploreWay() != null && response.getExploreWay().size() > 0) {
|
||||
MarkerExploreWay markerExploreWay = response.getExploreWay().get(0);
|
||||
MarkerLocation markerLocation = markerExploreWay.getLocation();
|
||||
// 记录道路事件
|
||||
V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
|
||||
v2XRoadEventEntity.setLocation(markerLocation);
|
||||
// 探路目前只有上报拥堵
|
||||
v2XRoadEventEntity.setPoiType(markerExploreWay.getPoiType());
|
||||
// 当前车辆数据
|
||||
MogoLocation currentLocation = V2XServiceManager.getV2XStatusManager().getLocation();
|
||||
float calculateDistance = Utils.calculateLineDistance(
|
||||
new MogoLatLng(markerLocation.getLat(), markerLocation.getLon()),
|
||||
new MogoLatLng(currentLocation.getLatitude(), currentLocation.getLongitude())
|
||||
);
|
||||
v2XRoadEventEntity.setDistance(calculateDistance);
|
||||
v2XRoadEventEntity.setNoveltyInfo(markerExploreWay);
|
||||
v2XRoadEventEntity.setExpireTime(20000);
|
||||
|
||||
// 记录播报过的道路事件
|
||||
V2XAlarmServer.mAlertRoadEventList.put(v2XRoadEventEntity, TimeUtils.getNowString());
|
||||
|
||||
V2XMessageEntity<V2XRoadEventEntity> v2xMessageEntity = new V2XMessageEntity<>();
|
||||
// 控制类型
|
||||
v2xMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING);
|
||||
// 设置数据
|
||||
v2xMessageEntity.setContent(v2XRoadEventEntity);
|
||||
// 控制展示状态
|
||||
v2xMessageEntity.setShowState(true);
|
||||
|
||||
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
|
||||
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2xMessageEntity);
|
||||
LocalBroadcastManager.getInstance(V2XUtils.getApp()).sendBroadcast(intent);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
|
||||
@Override
|
||||
public void handlerMessage(V2XMessageEntity v2XMessageEntity) {
|
||||
Logger.w(MODULE_NAME, "处理V2X场景:" + GsonUtil.jsonFromObject(v2XMessageEntity));
|
||||
Logger.d(MODULE_NAME, "处理V2X场景:" + GsonUtil.jsonFromObject(v2XMessageEntity));
|
||||
synchronized (V2XScenarioManager.class) {
|
||||
// 展示
|
||||
V2XUtils.runOnUiThread(() -> {
|
||||
|
||||
@@ -157,7 +157,6 @@ public class V2XFatigueDrivingWindow extends RelativeLayout
|
||||
|
||||
@Override
|
||||
public void onCalculateSuccess() {
|
||||
V2XServiceManager.getMogoRegisterCenter().unregisterMogoNaviListener( "test");
|
||||
V2XServiceManager.getNavi().startNavi(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,14 @@ package com.mogo.module.v2x.scenario.scene.park;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XPoiTypeEnum;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.V2XStatusManager;
|
||||
import com.mogo.module.v2x.alarm.V2XAlarmServer;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XPoiTypeEnum;
|
||||
import com.mogo.module.v2x.scenario.impl.AbsV2XScenario;
|
||||
import com.mogo.module.v2x.utils.ADASUtils;
|
||||
import com.mogo.module.v2x.utils.TrackUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -67,14 +69,20 @@ public class V2XIllegalParkScenario extends AbsV2XScenario<List<MarkerExploreWay
|
||||
//弹框
|
||||
// 设置要展开的违章停车事件
|
||||
//((V2XIllegalParkMarker) mV2XMarker).setOpenPoiId(markerExploreWay.getInfoId());
|
||||
// 广播给ADAS
|
||||
V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
|
||||
v2XRoadEventEntity.setAlarmContent("违章停车");
|
||||
v2XRoadEventEntity.setExpireTime(20000);
|
||||
v2XRoadEventEntity.setPoiType(V2XPoiTypeEnum.ALERT_ILLEGAL_PARK);
|
||||
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
|
||||
speakTTSVoice(markerExploreWay.getAddr() + "可能被罚违章停车,您可以说,有用或没用来帮助其它车友。", null);
|
||||
v2XRoadEventEntity.setTts(markerExploreWay.getAddr() + "可能被罚违章停车,您可以说,有用或没用来帮助其它车友。");
|
||||
((V2XIllegalParkWindow) mV2XWindow).show(markerExploreWay, true);
|
||||
TrackUtils.trackV2xRoadShow(markerExploreWay.getInfoId(), V2XPoiTypeEnum.ALERT_ILLEGAL_PARK, "1");
|
||||
} else {
|
||||
speakTTSVoice(markerExploreWay.getAddr() + "可能被罚违章停车", null);
|
||||
v2XRoadEventEntity.setTts(markerExploreWay.getAddr() + "可能被罚违章停车");
|
||||
TrackUtils.trackV2xRoadShow(markerExploreWay.getInfoId(), V2XPoiTypeEnum.ALERT_ILLEGAL_PARK, "2");
|
||||
}
|
||||
ADASUtils.broadcastToADAS(V2XServiceManager.getContext(), v2XRoadEventEntity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
@Override
|
||||
public void init(V2XMessageEntity<V2XRoadEventEntity> v2XMessageEntity) {
|
||||
try {
|
||||
Logger.w(V2XConst.MODULE_NAME, "v2XMessageEntity:" + GsonUtil.jsonFromObject(v2XMessageEntity));
|
||||
Logger.d(V2XConst.MODULE_NAME, "v2XMessageEntity:" + GsonUtil.jsonFromObject(v2XMessageEntity));
|
||||
|
||||
V2XRoadEventEntity v2XRoadEventEntity = v2XMessageEntity.getContent();
|
||||
if (v2XRoadEventEntity != null) {
|
||||
@@ -79,14 +79,8 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
@Override
|
||||
public void show() {
|
||||
if (mV2XMessageEntity != null && mV2XMessageEntity.getContent() != null) {
|
||||
// 如果道路事件小于50米的时候需要用户反馈
|
||||
if (mV2XMessageEntity.getContent().getDistance() < 50) {
|
||||
// 设置TTS
|
||||
mV2XMessageEntity.getContent().getTtsWithFeedback();
|
||||
} else {
|
||||
// 设置TTS
|
||||
mV2XMessageEntity.getContent().getTts(false);
|
||||
}
|
||||
// 设置TTS
|
||||
mV2XMessageEntity.getContent().getTts(false);
|
||||
// 广播给ADAS
|
||||
ADASUtils.broadcastToADAS(
|
||||
V2XServiceManager.getContext(),
|
||||
@@ -109,6 +103,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
properties.put("style", style);
|
||||
V2XServiceManager.getMogoAnalytics().track(V2XConst.V2X_ROAD_SHOW, properties);
|
||||
}
|
||||
String json = "{\"exploreWay\":[{\"addr\":\"东城区小黄庄北街2号靠近中国银行(北京安贞桥支行)\",\"userInfo\":{\"userName\":\"玉涛1\",\"sn\":\"E841CC2018PZD20143\",\"userHead\":\"http://img.zhidaohulian.com/fileServer/api/prod/user_info/726761827601/914019cfda5ab4b618e7f00e093eda82.jpg\",\"safeLabelType\":0,\"userId\":726761827601},\"cityName\":\"北京市\",\"uploadType\":\"0\",\"type\":\"CARD_TYPE_ROAD_CONDITION\",\"poiType\":\"10015\",\"infoId\":\"56280492\",\"items\":[{\"url\":\"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/CarPad/com.zhidao.roadcondition/E841CC2018PZD20143/E841CC2018PZD20143_20200722112917/PhotoFront_20200722_112918.JPG?sign\\u003dq-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595388896%3B1595396096%26q-key-time%3D1595388896%3B1595396096%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D2301fa50ff90f5b34f7f7c05a13a15f39abde9eb\",\"illegalCount\":0.0}],\"location\":{\"address\":\"东城区小黄庄北街2号靠近中国银行(北京安贞桥支行)\",\"angle\":0.0,\"lat\":39.968223,\"lon\":116.410857},\"generateTime\":1595388559153,\"distance\":47.0,\"fileType\":0,\"direction\":0,\"canLive\":false}]}";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -97,7 +97,7 @@ public class V2XRoadEventWindow extends RelativeLayout
|
||||
* 初始化视图
|
||||
*/
|
||||
private void initView(Context context) {
|
||||
Logger.w(MODULE_NAME, "V2X===初始化道路事件小窗口View。。。。。");
|
||||
Logger.d(MODULE_NAME, "V2X===初始化道路事件小窗口View。。。。。");
|
||||
// 填充布局
|
||||
LayoutInflater.from(context).inflate(R.layout.window_road_event_detail, this);
|
||||
// 详情列表
|
||||
|
||||
Reference in New Issue
Block a user