[rm] 删除无用类

This commit is contained in:
liujing
2020-09-29 19:53:25 +08:00
parent 2259342a89
commit c2097659f1
7 changed files with 67 additions and 125 deletions

View File

@@ -1,34 +0,0 @@
package com.mogo.module.v2x.adapter;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.module.common.entity.V2XEventShowEntity;
import com.mogo.module.common.entity.V2XMessageEntity;
public class V2XRoadVideoAdapter extends RecyclerView.Adapter <RecyclerView.ViewHolder> {
private V2XEventShowEntity mV2XEventShowEntity;
public V2XRoadVideoAdapter(){
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return null;
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
}
@Override
public int getItemCount() {
return 0;
}
}

View File

@@ -280,10 +280,16 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
* */
private void showRoadVideoInfo(V2XEventShowEntity v2XEventShowEntity){
if (v2XEventShowEntity != null){
/*
* MarkerExploreWay 具体事件
* V2XRoadEventEntity 包含MarkerExploreWay 事件的二次封装(tts播报内容 事件类型等)
* V2XMessageEntity 三次封装(是否进行事件与本机连线 是否显示通话功能等)
* V2XEventShowEntity 包含V2XRoadEventEntity
* */
Log.d(TAG,"马上展示图片/视频资源");
V2XMessageEntity<List<V2XEventShowEntity>> v2XMessageEntity = new V2XMessageEntity<>();
V2XMessageEntity v2XMessageEntity = new V2XMessageEntity<>();
v2XMessageEntity.setContent(v2XEventShowEntity);
V2XRoadVideoCarScenario.getInstance().init(v2XMessageEntity);
V2XRoadVideoWindow window = (V2XRoadVideoWindow) V2XRoadVideoCarScenario.getInstance().getV2XWindow();
}
}
/**

View File

@@ -144,7 +144,7 @@ public interface IMoGoV2XStatusManager extends IProvider {
/*
* 道路事件图片/视频资源 全屏
* */
void setV2XRoadVideoInfoWindowShow(String tag, boolean show);
void setV2XRoadVideoWindowShow(String tag, boolean show);
/**
* 设置 模拟直播车机 UI 是否在展示

View File

@@ -171,7 +171,7 @@ public class MoGoV2XStatusManager implements IMoGoV2XStatusManager {
}
@Override
public void setV2XRoadVideoInfoWindowShow(String tag, boolean show) {
public void setV2XRoadVideoWindowShow(String tag, boolean show) {
mStatus.put(V2XStatusDescriptor.V2XAnimationWindow_UI, show);
invokeStatusChangedListener(V2XStatusDescriptor.V2XRoadVideo_UI, show);
recordStatusModifier(tag, V2XStatusDescriptor.V2XRoadVideo_UI);

View File

@@ -6,77 +6,61 @@ import android.view.ViewGroup;
import androidx.annotation.Nullable;
import com.mogo.map.IDestroyable;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.V2XEventShowEntity;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.adapter.V2XRoadVideoAdapter;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.scenario.impl.AbsV2XScenario;
import com.mogo.module.v2x.scenario.scene.livecar.V2XRoadLiveCarWindow;
import com.mogo.module.v2x.scenario.view.IV2XWindow;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.service.windowview.IMogoTopViewStatusListener;
import com.mogo.utils.logger.Logger;
import java.util.List;
import javax.security.auth.DestroyFailedException;
import javax.security.auth.Destroyable;
public class V2XRoadVideoCarScenario extends AbsV2XScenario implements IMogoTopViewStatusListener, Destroyable {
public class V2XRoadVideoCarScenario extends AbsV2XScenario<V2XEventShowEntity> implements IMogoTopViewStatusListener, Destroyable {
private static V2XRoadVideoCarScenario sV2XRoadVideoCarScenario;
@Override
public void init(@Nullable V2XMessageEntity v2XMessageEntity) {
Log.d(TAG, "init");
try {
sV2XRoadVideoCarScenario.setV2XWindow(new V2XRoadVideoWindow());
setV2XMessageEntity(v2XMessageEntity);
show();
} catch (Exception e) {
e.printStackTrace();
}
}
private static String TAG = "V2XRoadVideoCarScenario";
public static V2XRoadVideoCarScenario getInstance() {
if (sV2XRoadVideoCarScenario == null) {
synchronized (V2XRoadVideoCarScenario.class) {
sV2XRoadVideoCarScenario = new V2XRoadVideoCarScenario();
if (sV2XRoadVideoCarScenario == null) {
sV2XRoadVideoCarScenario = new V2XRoadVideoCarScenario();
sV2XRoadVideoCarScenario.setV2XWindow(new V2XRoadVideoWindow());
}
}
}
return new V2XRoadVideoCarScenario();
}
@Override
public void init(@Nullable V2XMessageEntity<V2XEventShowEntity> v2XMessageEntity) {
try {
setV2XMessageEntity(v2XMessageEntity);
show();
} catch (Exception e) {
Log.d(TAG, "pppp" + e.getMessage());
e.printStackTrace();
}
}
@Override
public void show() {
if (getV2XMessageEntity() != null) {
showWindow();
}
showWindow();
}
@Override
public void showWindow() {
Log.d(TAG, "showWindow");
MarkerExploreWay markerExploreWay = null;
if (getV2XWindow() != null) {
ViewGroup.LayoutParams layoutParams =
new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
(int) V2XUtils.getApp().getResources().getDimension(R.dimen.module_v2x_event_window_height_ground));
getV2XWindow().show(getV2XMessageEntity().getContent());
V2XServiceManager
.getMogoTopViewManager()
.addSubView(getV2XWindow().getView(), this);
sV2XRoadVideoCarScenario.setV2XWindow(new V2XRoadVideoWindow(V2XServiceManager.getContext()));
((V2XRoadVideoWindow) getV2XWindow()).showWithEntity(markerExploreWay);
V2XServiceManager.getMoGoV2XStatusManager().
setV2XRoadVideoInfoWindowShow(
"https://haokan.baidu.com/v?vid=11239381022041270821&pd=bjh&fr=bjhauthor&type=video",
true);
.getIMogoWindowManager()
.addView(getV2XWindow().getView(), 0, 0, false);
V2XServiceManager.getMoGoV2XStatusManager().setV2XRoadVideoWindowShow(TAG, true);
}
}
@@ -119,7 +103,6 @@ public class V2XRoadVideoCarScenario extends AbsV2XScenario implements IMogoTopV
@Override
public void onViewAdded(View view) {
Log.d(TAG, "onViewAdded");
}

View File

@@ -1,74 +1,56 @@
package com.mogo.module.v2x.scenario.scene.road;
import android.content.Context;
import android.net.Uri;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.V2XEventShowEntity;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XServiceManager;
import com.mogo.module.v2x.adapter.V2XRoadEventAdapter;
import com.mogo.module.v2x.adapter.V2XRoadVideoAdapter;
import com.mogo.module.v2x.listener.V2XWindowStatusListener;
import com.mogo.module.v2x.scenario.view.IV2XWindow;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.module.v2x.view.TextureVideoView;
import java.util.ArrayList;
import java.util.List;
public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow {
public class V2XRoadVideoWindow extends ConstraintLayout implements IV2XWindow {
private static final String TAG = "V2XRoadVideoWindow";
private RecyclerView mRecyclerView;
private V2XRoadVideoAdapter mV2XRoadVideoAdapter;
private List<V2XEventShowEntity> mItemList = new ArrayList<>();
private V2XWindowStatusListener mV2XWindowStatusListener;
private TextureVideoView mVideoView;
private V2XMessageEntity mV2XMessageEntity;
public V2XRoadVideoWindow() {
this(V2XServiceManager.getContext());
this(V2XServiceManager.getContext(), null);
}
public V2XRoadVideoWindow(Context context) {
super(context);
this(context, null);
}
public V2XRoadVideoWindow(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public V2XRoadVideoWindow(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initView(context);
}
private void initView(Context context) {
Log.d(TAG, "初始化视频播放器");
mRecyclerView = findViewById(R.id.rvRoadEventList);
mV2XRoadVideoAdapter = new V2XRoadVideoAdapter();
mRecyclerView.setAdapter(mV2XRoadVideoAdapter);
// 填充布局
LayoutInflater.from(context).inflate(R.layout.window_road_video, this);
LinearLayoutManager layoutManager = new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false);
mRecyclerView.setLayoutManager(layoutManager);
}
public void showWithEntity(MarkerExploreWay markerExploreWay) {
show(markerExploreWay);
mVideoView = findViewById(R.id.roadVideoView);
}
@Override
public void show(Object entity) {
if (entity != null) {
mV2XRoadVideoAdapter.notifyDataSetChanged();
}
ViewGroup.LayoutParams layoutParams =
new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
(int) V2XUtils.getApp()
.getResources()
.getDimension(R.dimen.module_v2x_fatigue_driving_window_height_ground));
// 添加弹窗
V2XServiceManager.getMogoTopViewManager().addView(this, layoutParams);
mV2XMessageEntity = (V2XMessageEntity) entity;
// String path =
mVideoView.setVideoPath("https://haokan.baidu.com/v?vid=11239381022041270821&pd=bjh&fr=bjhauthor&type=video");
}
@Override
@@ -78,11 +60,11 @@ public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow {
@Override
public View getView() {
return null;
return this;
}
@Override
public void setWindowStatusListener(V2XWindowStatusListener listener) {
this.mV2XWindowStatusListener = listener;
}
}

View File

@@ -1,13 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:id="@+id/roadVideoLayout"
android:background="#000000">
<com.mogo.module.v2x.view.TextureVideoView
android:id="@+id/roadVideoView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/design_default_color_error">
android:background="@color/live_video_progress_bar_loading_color"
android:padding="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_30">
</com.mogo.module.v2x.view.TextureVideoView>
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>