增加了事件面板provider
This commit is contained in:
@@ -70,6 +70,7 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
|
||||
MogoModulePaths.addBaseModule( new MogoModule( ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY ) );
|
||||
MogoModulePaths.addBaseModule( new MogoModule( V2XConst.PATH_V2X_UI, V2XConst.MODULE_NAME ) );
|
||||
MogoModulePaths.addModule( new MogoModule( V2XConst.PATH_EVENT_PANEL, V2XConst.MODULE_NAME_EVENT_PANEL ) );
|
||||
MogoModulePaths.addModule( new MogoModule( PushUIConstants.PATH, PushUIConstants.NAME ) );
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_LOG_LIB, "LogLib"));
|
||||
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.mogo.module.v2x;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.module.v2x.fragment.EventPanelFragment;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.module.ModuleType;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020-01-2114:03
|
||||
* desc : V2X的管理
|
||||
* version: 2.0
|
||||
*/
|
||||
@Route(path = V2XConst.PATH_EVENT_PANEL)
|
||||
public class EventPanelModuleProvider implements
|
||||
IMogoModuleProvider {
|
||||
private final String TAG = "EventPanelModuleProvider";
|
||||
|
||||
@Override
|
||||
public Fragment createFragment(Context context, Bundle data) {
|
||||
return EventPanelFragment.Companion.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View createView(Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getModuleName() {
|
||||
return V2XConst.MODULE_NAME_EVENT_PANEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoModuleLifecycle getCardLifecycle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapListener getMapListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return ModuleType.TYPE_CARD_FRAGMENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoNaviListener getNaviListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoLocationListener getLocationListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMarkerClickListener getMarkerClickListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppPackage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
Logger.e(MODULE_NAME, "事件模版 模块初始化。。。。");
|
||||
}
|
||||
}
|
||||
@@ -9,14 +9,22 @@ package com.mogo.module.v2x;
|
||||
*/
|
||||
public class V2XConst {
|
||||
/**
|
||||
* 类型
|
||||
* V2X面板名称
|
||||
*/
|
||||
public static final String MODULE_NAME = "MODULE_EVENT_PANEL";
|
||||
public static final String MODULE_NAME = "V2X_UI";
|
||||
/**
|
||||
* V2X模块地址
|
||||
*/
|
||||
public static final String PATH_V2X_UI = "/event/panel";
|
||||
public static final String SEEK_HELP_TIME = "seek_help_time";
|
||||
public static final String PATH_V2X_UI = "/v2x/ui";
|
||||
|
||||
/**
|
||||
* 事件面板名称
|
||||
*/
|
||||
public static final String MODULE_NAME_EVENT_PANEL = "MODULE_EVENT_PANEL";
|
||||
/**
|
||||
* 事件面板路径
|
||||
*/
|
||||
public static final String PATH_EVENT_PANEL = "/event/panel";
|
||||
|
||||
/**
|
||||
* V2X 场景广播 Action
|
||||
@@ -25,7 +33,7 @@ public class V2XConst {
|
||||
public static final String BROADCAST_SCENE_EXTRA_KEY = "V2XMessageEntity";
|
||||
|
||||
public static final String BROADCAST_SCENE_ACTION = "com.v2x.scene_local_broadcast";
|
||||
|
||||
public static final String SEEK_HELP_TIME = "seek_help_time";
|
||||
public static final String V2X_ACC_ON_TIME_STR = "v2x_acc_on_time_str";
|
||||
public static final String V2X_ACC_OFF_TIME_STR = "v2x_acc_off_time_str";
|
||||
public static final String V2X_STRATEGY_PUSH = "v2x_strategy_push";
|
||||
|
||||
@@ -24,7 +24,6 @@ import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.v2x.entity.net.V2XSeekHelpRes;
|
||||
import com.mogo.module.v2x.entity.net.V2XStrategyPushRes;
|
||||
import com.mogo.module.v2x.fragment.EventPanelFragment;
|
||||
import com.mogo.module.v2x.network.V2XRefreshCallback;
|
||||
import com.mogo.module.v2x.receiver.SceneBroadcastReceiver;
|
||||
import com.mogo.module.v2x.scenario.impl.V2XScenarioManager;
|
||||
@@ -65,7 +64,7 @@ public class V2XModuleProvider implements
|
||||
|
||||
@Override
|
||||
public Fragment createFragment(Context context, Bundle data) {
|
||||
return EventPanelFragment.Companion.getInstance();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -91,7 +90,7 @@ public class V2XModuleProvider implements
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return ModuleType.TYPE_CARD_FRAGMENT;
|
||||
return ModuleType.TYPE_SERVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -121,7 +120,7 @@ public class V2XModuleProvider implements
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
Logger.e(MODULE_NAME, "V2X模块初始化。。。。");
|
||||
Logger.e(MODULE_NAME, "V2X 模块初始化。。。。");
|
||||
mContext = context;
|
||||
|
||||
V2XUtils.init(context);
|
||||
|
||||
@@ -37,24 +37,8 @@ public class ScenarioHistoryAdapter extends RecyclerView.Adapter<RecyclerView.Vi
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING:
|
||||
holder = new ScenarioHistoryRoadEventVH(parent);
|
||||
break;
|
||||
//违章停车
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_ILLEGAL_PARK_WARNING:
|
||||
holder = new ScenarioHistoryIllegalParkVH(parent);
|
||||
break;
|
||||
//推送展示
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_WINDOW_WARNING:
|
||||
holder = new ScenarioHistoryPushEventVH(parent);
|
||||
break;
|
||||
//疲劳驾驶
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_FATIGUE_DRIVING:
|
||||
holder = new ScenarioHistoryFatigueDrivingVH(parent);
|
||||
break;
|
||||
//他人故障求助
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_SEEK_WARNING:
|
||||
holder = new ScenarioHistoryOtherSeekHelpVH(parent);
|
||||
break;
|
||||
default:
|
||||
holder = new ScenarioHistoryIllegalParkVH(parent);
|
||||
holder = new ScenarioHistoryRoadEventVH(parent);
|
||||
}
|
||||
|
||||
return holder;
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.mogo.module.v2x.R;
|
||||
public class ScenarioHistoryRoadEventVH extends V2XBaseViewHolder<V2XHistoryScenarioData> {
|
||||
public ScenarioHistoryRoadEventVH(@NonNull ViewGroup viewGroup) {
|
||||
super(LayoutInflater.from(viewGroup.getContext())
|
||||
.inflate(R.layout.item_v2x_event_detail, viewGroup, false));
|
||||
.inflate(R.layout.module_v2x_event_share_item, viewGroup, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,8 +43,6 @@ public class ScenarioHistoryFragment
|
||||
mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
||||
mScenarioHistoryAdapter = new ScenarioHistoryAdapter(mV2XHistoryScenarioData);
|
||||
mRecyclerView.setAdapter(mScenarioHistoryAdapter);
|
||||
// 设置切换样式
|
||||
new PagerSnapHelper().attachToRecyclerView(mRecyclerView);
|
||||
// 配置列表朝向
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);
|
||||
mRecyclerView.setLayoutManager(layoutManager);
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FFF">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:listitem="@layout/module_v2x_event_share_item" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
android:background="#FFF"
|
||||
tools:listitem="@layout/module_v2x_event_share_item" />
|
||||
|
||||
Reference in New Issue
Block a user