统一命名格式
This commit is contained in:
@@ -12,7 +12,7 @@ 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.module.v2x.fragment.V2XEventPanelFragment;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.module.ModuleType;
|
||||
@@ -28,13 +28,13 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
* version: 2.0
|
||||
*/
|
||||
@Route(path = V2XConst.PATH_EVENT_PANEL)
|
||||
public class EventPanelModuleProvider implements
|
||||
public class V2XEventPanelModuleProvider implements
|
||||
IMogoModuleProvider {
|
||||
private final String TAG = "EventPanelModuleProvider";
|
||||
|
||||
@Override
|
||||
public Fragment createFragment(Context context, Bundle data) {
|
||||
return EventPanelFragment.Companion.getInstance();
|
||||
return V2XEventPanelFragment.Companion.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -8,8 +8,8 @@ import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
class EventPagerAdapter(fragment: Fragment,
|
||||
private val fragments: Array<Fragment>) :
|
||||
class V2XEventPagerAdapter(fragment: Fragment,
|
||||
private val fragments: Array<Fragment>) :
|
||||
FragmentStateAdapter(fragment) {
|
||||
|
||||
/**
|
||||
@@ -7,22 +7,22 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.module.common.entity.V2XHistoryScenarioData;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.v2x.adapter.holder.ScenarioHistoryFatigueDrivingVH;
|
||||
import com.mogo.module.v2x.adapter.holder.ScenarioHistoryIllegalParkVH;
|
||||
import com.mogo.module.v2x.adapter.holder.ScenarioHistoryOtherSeekHelpVH;
|
||||
import com.mogo.module.v2x.adapter.holder.ScenarioHistoryPushEventVH;
|
||||
import com.mogo.module.v2x.adapter.holder.ScenarioHistoryRoadEventVH;
|
||||
import com.mogo.module.v2x.adapter.holder.V2XScenarioHistoryFatigueDrivingVH;
|
||||
import com.mogo.module.v2x.adapter.holder.V2XScenarioHistoryIllegalParkVH;
|
||||
import com.mogo.module.v2x.adapter.holder.V2XScenarioHistoryOtherSeekHelpVH;
|
||||
import com.mogo.module.v2x.adapter.holder.V2XScenarioHistoryPushEventVH;
|
||||
import com.mogo.module.v2x.adapter.holder.V2XScenarioHistoryRoadEventVH;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
*/
|
||||
public class ScenarioHistoryAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
public class V2XScenarioHistoryAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
|
||||
private ArrayList<V2XHistoryScenarioData> mV2XHistoryScenarioData;
|
||||
|
||||
public ScenarioHistoryAdapter(ArrayList<V2XHistoryScenarioData> v2XHistoryScenarioData) {
|
||||
public V2XScenarioHistoryAdapter(ArrayList<V2XHistoryScenarioData> v2XHistoryScenarioData) {
|
||||
if (v2XHistoryScenarioData != null) {
|
||||
this.mV2XHistoryScenarioData = v2XHistoryScenarioData;
|
||||
}
|
||||
@@ -35,26 +35,26 @@ public class ScenarioHistoryAdapter extends RecyclerView.Adapter<RecyclerView.Vi
|
||||
switch (viewType) {
|
||||
//道路事件详情
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING:
|
||||
holder = new ScenarioHistoryRoadEventVH(parent);
|
||||
holder = new V2XScenarioHistoryRoadEventVH(parent);
|
||||
break;
|
||||
//违章停车
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_ILLEGAL_PARK_WARNING:
|
||||
holder = new ScenarioHistoryIllegalParkVH(parent);
|
||||
holder = new V2XScenarioHistoryIllegalParkVH(parent);
|
||||
break;
|
||||
//推送展示
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_WINDOW_WARNING:
|
||||
holder = new ScenarioHistoryPushEventVH(parent);
|
||||
holder = new V2XScenarioHistoryPushEventVH(parent);
|
||||
break;
|
||||
//疲劳驾驶
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_FATIGUE_DRIVING:
|
||||
holder = new ScenarioHistoryFatigueDrivingVH(parent);
|
||||
holder = new V2XScenarioHistoryFatigueDrivingVH(parent);
|
||||
break;
|
||||
//他人故障求助
|
||||
case V2XMessageEntity.V2XTypeEnum.ALERT_SEEK_WARNING:
|
||||
holder = new ScenarioHistoryOtherSeekHelpVH(parent);
|
||||
holder = new V2XScenarioHistoryOtherSeekHelpVH(parent);
|
||||
break;
|
||||
default:
|
||||
holder = new ScenarioHistoryRoadEventVH(parent);
|
||||
holder = new V2XScenarioHistoryRoadEventVH(parent);
|
||||
}
|
||||
|
||||
return holder;
|
||||
@@ -62,20 +62,20 @@ public class ScenarioHistoryAdapter extends RecyclerView.Adapter<RecyclerView.Vi
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
if (holder instanceof ScenarioHistoryRoadEventVH) {
|
||||
((ScenarioHistoryRoadEventVH) holder).initView(mV2XHistoryScenarioData.get(position));
|
||||
if (holder instanceof V2XScenarioHistoryRoadEventVH) {
|
||||
((V2XScenarioHistoryRoadEventVH) holder).initView(mV2XHistoryScenarioData.get(position));
|
||||
}
|
||||
if (holder instanceof ScenarioHistoryIllegalParkVH) {
|
||||
((ScenarioHistoryIllegalParkVH) holder).initView(mV2XHistoryScenarioData.get(position));
|
||||
if (holder instanceof V2XScenarioHistoryIllegalParkVH) {
|
||||
((V2XScenarioHistoryIllegalParkVH) holder).initView(mV2XHistoryScenarioData.get(position));
|
||||
}
|
||||
if (holder instanceof ScenarioHistoryPushEventVH) {
|
||||
((ScenarioHistoryPushEventVH) holder).initView(mV2XHistoryScenarioData.get(position));
|
||||
if (holder instanceof V2XScenarioHistoryPushEventVH) {
|
||||
((V2XScenarioHistoryPushEventVH) holder).initView(mV2XHistoryScenarioData.get(position));
|
||||
}
|
||||
if (holder instanceof ScenarioHistoryFatigueDrivingVH) {
|
||||
((ScenarioHistoryFatigueDrivingVH) holder).initView(mV2XHistoryScenarioData.get(position));
|
||||
if (holder instanceof V2XScenarioHistoryFatigueDrivingVH) {
|
||||
((V2XScenarioHistoryFatigueDrivingVH) holder).initView(mV2XHistoryScenarioData.get(position));
|
||||
}
|
||||
if (holder instanceof ScenarioHistoryOtherSeekHelpVH) {
|
||||
((ScenarioHistoryOtherSeekHelpVH) holder).initView(mV2XHistoryScenarioData.get(position));
|
||||
if (holder instanceof V2XScenarioHistoryOtherSeekHelpVH) {
|
||||
((V2XScenarioHistoryOtherSeekHelpVH) holder).initView(mV2XHistoryScenarioData.get(position));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.mogo.module.v2x.entity.panel.ShareEventDescription;
|
||||
import com.mogo.module.v2x.entity.panel.ShareEventItem;
|
||||
import com.mogo.module.v2x.entity.panel.ShareEventItemEnum;
|
||||
import com.mogo.module.v2x.entity.panel.ShareEventLoadMoreItem;
|
||||
import com.mogo.module.v2x.fragment.EventPanelFragment;
|
||||
import com.mogo.module.v2x.fragment.V2XEventPanelFragment;
|
||||
import com.mogo.module.v2x.listener.AdapterCallback;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
@@ -211,7 +211,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
|
||||
Button shareBtn = itemView.findViewById(R.id.share_event_button);
|
||||
shareBtn.setOnClickListener(view -> {
|
||||
EventPanelFragment.Companion.getInstance().hidePanel();
|
||||
V2XEventPanelFragment.Companion.getInstance().hidePanel();
|
||||
mApis.getShareManager().showShareDialog();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ import com.mogo.module.v2x.R;
|
||||
/**
|
||||
* @author donghongyu
|
||||
*/
|
||||
public class ScenarioHistoryFatigueDrivingVH extends V2XBaseViewHolder<V2XHistoryScenarioData> {
|
||||
public ScenarioHistoryFatigueDrivingVH(@NonNull ViewGroup viewGroup) {
|
||||
public class V2XScenarioHistoryFatigueDrivingVH extends V2XBaseViewHolder<V2XHistoryScenarioData> {
|
||||
public V2XScenarioHistoryFatigueDrivingVH(@NonNull ViewGroup viewGroup) {
|
||||
super(LayoutInflater.from(viewGroup.getContext())
|
||||
.inflate(R.layout.item_v2x_fatigue_driving, viewGroup, false));
|
||||
}
|
||||
@@ -11,8 +11,8 @@ import com.mogo.module.v2x.R;
|
||||
/**
|
||||
* @author donghongyu
|
||||
*/
|
||||
public class ScenarioHistoryIllegalParkVH extends V2XBaseViewHolder<V2XHistoryScenarioData> {
|
||||
public ScenarioHistoryIllegalParkVH(@NonNull ViewGroup viewGroup) {
|
||||
public class V2XScenarioHistoryIllegalParkVH extends V2XBaseViewHolder<V2XHistoryScenarioData> {
|
||||
public V2XScenarioHistoryIllegalParkVH(@NonNull ViewGroup viewGroup) {
|
||||
super(LayoutInflater.from(viewGroup.getContext())
|
||||
.inflate(R.layout.item_v2x_illegal_parking, viewGroup, false));
|
||||
}
|
||||
@@ -11,8 +11,8 @@ import com.mogo.module.v2x.R;
|
||||
/**
|
||||
* @author donghongyu
|
||||
*/
|
||||
public class ScenarioHistoryOtherSeekHelpVH extends V2XBaseViewHolder<V2XHistoryScenarioData> {
|
||||
public ScenarioHistoryOtherSeekHelpVH(@NonNull ViewGroup viewGroup) {
|
||||
public class V2XScenarioHistoryOtherSeekHelpVH extends V2XBaseViewHolder<V2XHistoryScenarioData> {
|
||||
public V2XScenarioHistoryOtherSeekHelpVH(@NonNull ViewGroup viewGroup) {
|
||||
super(LayoutInflater.from(viewGroup.getContext())
|
||||
.inflate(R.layout.item_v2x_fault_help, viewGroup, false));
|
||||
}
|
||||
@@ -11,8 +11,8 @@ import com.mogo.module.v2x.R;
|
||||
/**
|
||||
* @author donghongyu
|
||||
*/
|
||||
public class ScenarioHistoryPushEventVH extends V2XBaseViewHolder<V2XHistoryScenarioData> {
|
||||
public ScenarioHistoryPushEventVH(@NonNull ViewGroup viewGroup) {
|
||||
public class V2XScenarioHistoryPushEventVH extends V2XBaseViewHolder<V2XHistoryScenarioData> {
|
||||
public V2XScenarioHistoryPushEventVH(@NonNull ViewGroup viewGroup) {
|
||||
super(LayoutInflater.from(viewGroup.getContext())
|
||||
.inflate(R.layout.item_v2x_push_event_detail, viewGroup, false));
|
||||
}
|
||||
@@ -11,8 +11,8 @@ import com.mogo.module.v2x.R;
|
||||
/**
|
||||
* @author donghongyu
|
||||
*/
|
||||
public class ScenarioHistoryRoadEventVH extends V2XBaseViewHolder<V2XHistoryScenarioData> {
|
||||
public ScenarioHistoryRoadEventVH(@NonNull ViewGroup viewGroup) {
|
||||
public class V2XScenarioHistoryRoadEventVH extends V2XBaseViewHolder<V2XHistoryScenarioData> {
|
||||
public V2XScenarioHistoryRoadEventVH(@NonNull ViewGroup viewGroup) {
|
||||
super(LayoutInflater.from(viewGroup.getContext())
|
||||
.inflate(R.layout.item_v2x_event_detail, viewGroup, false));
|
||||
}
|
||||
@@ -14,10 +14,10 @@ import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.module.v2x.R
|
||||
import com.mogo.module.v2x.V2XConst.MODULE_NAME
|
||||
import com.mogo.module.v2x.V2XServiceManager
|
||||
import com.mogo.module.v2x.adapter.EventPagerAdapter
|
||||
import com.mogo.module.v2x.adapter.V2XEventPagerAdapter
|
||||
import com.mogo.module.v2x.presenter.EventPanelPresenter
|
||||
import com.mogo.utils.logger.Logger
|
||||
import kotlinx.android.synthetic.main.module_event_panel_fragment_event_panel.*
|
||||
import kotlinx.android.synthetic.main.module_v2x_event_panel_fragment_event_panel.*
|
||||
|
||||
|
||||
/**
|
||||
@@ -25,7 +25,7 @@ import kotlinx.android.synthetic.main.module_event_panel_fragment_event_panel.*
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
class EventPanelFragment : MvpFragment<EventPanelFragment, EventPanelPresenter>() {
|
||||
class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPresenter>() {
|
||||
|
||||
private val TAG = "EventPanelFragment"
|
||||
|
||||
@@ -43,26 +43,26 @@ class EventPanelFragment : MvpFragment<EventPanelFragment, EventPanelPresenter>(
|
||||
private var selectPosition = 0
|
||||
|
||||
companion object {
|
||||
private val fragment = EventPanelFragment()
|
||||
fun getInstance(): EventPanelFragment {
|
||||
private val fragment = V2XEventPanelFragment()
|
||||
fun getInstance(): V2XEventPanelFragment {
|
||||
return fragment
|
||||
}
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_event_panel_fragment_event_panel
|
||||
return R.layout.module_v2x_event_panel_fragment_event_panel
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
Logger.d(MODULE_NAME, "EventPanelFragment init view===")
|
||||
fragments = arrayOf(
|
||||
ScenarioHistoryFragment(),
|
||||
V2XScenarioHistoryFragment(),
|
||||
SurroundingEventFragment(),
|
||||
V2XShareEventsFragment()
|
||||
)
|
||||
//禁用预加载
|
||||
vpEventPanel.offscreenPageLimit = ViewPager2.OFFSCREEN_PAGE_LIMIT_DEFAULT
|
||||
vpEventPanel.adapter = EventPagerAdapter(this, fragments!!)
|
||||
vpEventPanel.adapter = V2XEventPagerAdapter(this, fragments!!)
|
||||
//viewPager 页面切换监听
|
||||
vpEventPanel.registerOnPageChangeCallback(changeCallback)
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.module.common.entity.V2XHistoryScenarioData;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.adapter.ScenarioHistoryAdapter;
|
||||
import com.mogo.module.v2x.adapter.V2XScenarioHistoryAdapter;
|
||||
import com.mogo.module.v2x.manager.IMoGoV2XStatusChangedListener;
|
||||
import com.mogo.module.v2x.manager.V2XStatusDescriptor;
|
||||
import com.mogo.module.v2x.presenter.ScenarioHistoryPresenter;
|
||||
@@ -26,25 +26,25 @@ import java.util.List;
|
||||
*
|
||||
* @author donghongyu
|
||||
*/
|
||||
public class ScenarioHistoryFragment
|
||||
extends MvpFragment<ScenarioHistoryFragment, ScenarioHistoryPresenter> {
|
||||
public class V2XScenarioHistoryFragment
|
||||
extends MvpFragment<V2XScenarioHistoryFragment, ScenarioHistoryPresenter> {
|
||||
private String TAG = "ScenarioHistoryFragment";
|
||||
|
||||
private RecyclerView mRecyclerView;
|
||||
private ScenarioHistoryAdapter mScenarioHistoryAdapter;
|
||||
private V2XScenarioHistoryAdapter mV2XScenarioHistoryAdapter;
|
||||
private ArrayList<V2XHistoryScenarioData> mV2XHistoryScenarioData = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.module_event_panel_fragment_scenario_history;
|
||||
return R.layout.module_v2x_event_panel_fragment_scenario_history;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
Log.d(TAG, "initViews --------> ");
|
||||
mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
||||
mScenarioHistoryAdapter = new ScenarioHistoryAdapter(mV2XHistoryScenarioData);
|
||||
mRecyclerView.setAdapter(mScenarioHistoryAdapter);
|
||||
mV2XScenarioHistoryAdapter = new V2XScenarioHistoryAdapter(mV2XHistoryScenarioData);
|
||||
mRecyclerView.setAdapter(mV2XScenarioHistoryAdapter);
|
||||
// 配置列表朝向
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);
|
||||
mRecyclerView.setLayoutManager(layoutManager);
|
||||
@@ -84,7 +84,7 @@ public class ScenarioHistoryFragment
|
||||
Logger.d(TAG, "查询到历史消息:" + GsonUtil.jsonFromObject(v2XHistoryScenarioData));
|
||||
mV2XHistoryScenarioData.clear();
|
||||
mV2XHistoryScenarioData.addAll(v2XHistoryScenarioData);
|
||||
mScenarioHistoryAdapter.notifyDataSetChanged();
|
||||
mV2XScenarioHistoryAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.mogo.module.v2x.presenter
|
||||
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.mogo.module.v2x.fragment.EventPanelFragment
|
||||
import com.mogo.module.v2x.fragment.V2XEventPanelFragment
|
||||
|
||||
/**
|
||||
* 事件面板presenter
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
class EventPanelPresenter(view: EventPanelFragment) : Presenter<EventPanelFragment>(view)
|
||||
class EventPanelPresenter(view: V2XEventPanelFragment) : Presenter<V2XEventPanelFragment>(view)
|
||||
@@ -3,7 +3,7 @@ package com.mogo.module.v2x.presenter;
|
||||
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.module.common.entity.V2XHistoryScenarioData;
|
||||
import com.mogo.module.v2x.fragment.ScenarioHistoryFragment;
|
||||
import com.mogo.module.v2x.fragment.V2XScenarioHistoryFragment;
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
|
||||
|
||||
import java.util.List;
|
||||
@@ -11,9 +11,9 @@ import java.util.List;
|
||||
/**
|
||||
* @author donghongyu
|
||||
*/
|
||||
public class ScenarioHistoryPresenter extends Presenter<ScenarioHistoryFragment> {
|
||||
public class ScenarioHistoryPresenter extends Presenter<V2XScenarioHistoryFragment> {
|
||||
|
||||
public ScenarioHistoryPresenter(ScenarioHistoryFragment view) {
|
||||
public ScenarioHistoryPresenter(V2XScenarioHistoryFragment view) {
|
||||
super(view);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user