[add] 添加道路视频全屏UI
This commit is contained in:
@@ -23,6 +23,8 @@ import com.mogo.module.v2x.network.V2XRefreshCallback;
|
||||
import com.mogo.module.v2x.scenario.scene.livecar.V2XRoadLiveCarScenario;
|
||||
import com.mogo.module.v2x.scenario.scene.road.V2XRoadEventScenario;
|
||||
import com.mogo.module.v2x.scenario.scene.road.V2XRoadEventWindow;
|
||||
import com.mogo.module.v2x.scenario.scene.road.V2XRoadVideoCarScenario;
|
||||
import com.mogo.module.v2x.scenario.scene.road.V2XRoadVideoWindow;
|
||||
import com.mogo.module.v2x.utils.ChartingUtil;
|
||||
import com.mogo.module.v2x.utils.EventTypeUtils;
|
||||
import com.mogo.module.v2x.utils.SpanUtils;
|
||||
@@ -163,7 +165,7 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
|
||||
@Override
|
||||
public void onViewDetachedFromWindow(View v) {
|
||||
Log.d(TAG,"onViewDetachedFromWindow unRegister");
|
||||
Log.d(TAG, "onViewDetachedFromWindow unRegister");
|
||||
// 反注册语音交互
|
||||
V2XVoiceManager.INSTANCE
|
||||
.unRegisterWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CALL_CHATTING)
|
||||
@@ -200,6 +202,9 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
if (!TextUtils.isEmpty(imgUrl)) {
|
||||
V2XServiceManager.getImageLoader()
|
||||
.displayImage(imgUrl, ivEventImg);
|
||||
ivEventImg.setOnClickListener(v -> {
|
||||
showRoadVideoInfo(v2XEventShowEntity);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (mNoveltyInfo.getUserInfo() != null &&
|
||||
@@ -270,6 +275,17 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 展示事件的图片/视频资源
|
||||
* */
|
||||
private void showRoadVideoInfo(V2XEventShowEntity v2XEventShowEntity){
|
||||
if (v2XEventShowEntity != null){
|
||||
Log.d(TAG,"马上展示图片/视频资源");
|
||||
V2XMessageEntity<List<V2XEventShowEntity>> v2XMessageEntity = new V2XMessageEntity<>();
|
||||
V2XRoadVideoCarScenario.getInstance().init(v2XMessageEntity);
|
||||
V2XRoadVideoWindow window = (V2XRoadVideoWindow) V2XRoadVideoCarScenario.getInstance().getV2XWindow();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 展示直播信息
|
||||
*
|
||||
|
||||
@@ -141,6 +141,11 @@ public interface IMoGoV2XStatusManager extends IProvider {
|
||||
*/
|
||||
void setV2XAnimationWindowShow(String tag, boolean show);
|
||||
|
||||
/*
|
||||
* 道路事件图片/视频资源 全屏
|
||||
* */
|
||||
void setV2XRoadVideoInfoWindowShow(String tag, boolean show);
|
||||
|
||||
/**
|
||||
* 设置 模拟直播车机 UI 是否在展示
|
||||
*
|
||||
|
||||
@@ -53,6 +53,11 @@ public enum V2XStatusDescriptor {
|
||||
*/
|
||||
LiveCarWindow_UI,
|
||||
|
||||
/**
|
||||
* 右侧2/3 左下角 模拟直播车机 UI 是否在展示
|
||||
*/
|
||||
V2XRoadVideo_UI,
|
||||
|
||||
/**
|
||||
* 推送的POI
|
||||
*/
|
||||
|
||||
@@ -170,6 +170,13 @@ public class MoGoV2XStatusManager implements IMoGoV2XStatusManager {
|
||||
recordStatusModifier(tag, V2XStatusDescriptor.V2XAnimationWindow_UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setV2XRoadVideoInfoWindowShow(String tag, boolean show) {
|
||||
mStatus.put(V2XStatusDescriptor.V2XAnimationWindow_UI, show);
|
||||
invokeStatusChangedListener(V2XStatusDescriptor.V2XRoadVideo_UI, show);
|
||||
recordStatusModifier(tag, V2XStatusDescriptor.V2XRoadVideo_UI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLiveCarWindowShow(String tag, boolean show) {
|
||||
mStatus.put(V2XStatusDescriptor.LiveCarWindow_UI, show);
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.mogo.module.v2x.scenario.scene.road;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.map.IDestroyable;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.R;
|
||||
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 javax.security.auth.DestroyFailedException;
|
||||
import javax.security.auth.Destroyable;
|
||||
|
||||
public class V2XRoadVideoCarScenario extends AbsV2XScenario implements IMogoTopViewStatusListener, Destroyable {
|
||||
|
||||
private static V2XRoadVideoCarScenario sV2XRoadVideoCarScenario;
|
||||
|
||||
@Override
|
||||
public void init(@Nullable V2XMessageEntity v2XMessageEntity) {
|
||||
Log.d(TAG, "init");
|
||||
setV2XMessageEntity(v2XMessageEntity);
|
||||
show();
|
||||
}
|
||||
|
||||
public static V2XRoadVideoCarScenario getInstance() {
|
||||
if (sV2XRoadVideoCarScenario == null) {
|
||||
synchronized (V2XRoadVideoCarScenario.class) {
|
||||
sV2XRoadVideoCarScenario = new V2XRoadVideoCarScenario();
|
||||
}
|
||||
}
|
||||
return new V2XRoadVideoCarScenario();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
if (getV2XMessageEntity() != null && getV2XMessageEntity().getContent() != null) {
|
||||
}
|
||||
showWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showWindow() {
|
||||
Log.d(TAG, "showWindow");
|
||||
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));
|
||||
V2XServiceManager
|
||||
.getMogoTopViewManager()
|
||||
.addSubView(getV2XWindow().getView(), this);
|
||||
sV2XRoadVideoCarScenario.setV2XWindow(new V2XRoadVideoWindow(V2XServiceManager.getContext()));
|
||||
getV2XWindow().show(getV2XMessageEntity().getContent());
|
||||
V2XServiceManager.getMoGoV2XStatusManager().
|
||||
setV2XRoadVideoInfoWindowShow(
|
||||
"https://haokan.baidu.com/v?vid=11239381022041270821&pd=bjh&fr=bjhauthor&type=video",
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeWindow() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showButton() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeButton() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawPOI() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearPOI() {
|
||||
Log.d(TAG, "clearPOI");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void destroy() throws DestroyFailedException {
|
||||
Log.d(TAG, "destroy");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDestroyed() {
|
||||
Log.d(TAG, "isDestroyed");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewAdded(View view) {
|
||||
Log.d(TAG, "onViewAdded");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewRemoved(View view) {
|
||||
Log.d(TAG, "onViewRemoved");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeViewAddAnim(View view) {
|
||||
Log.d(TAG, "beforeViewAddAnim");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeViewRemoveAnim(View view) {
|
||||
Log.d(TAG, "beforeViewRemoveAnim");
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,15 @@ package com.mogo.module.v2x.scenario.scene.road;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.listener.V2XWindowStatusListener;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XWindow;
|
||||
|
||||
public class V2XRoadVideoWindow extends RelativeLayout implements IV2XWindow {
|
||||
|
||||
public class V2XRoadVideoWindow extends RelativeLayout {
|
||||
private static final String TAG = "V2XRoadVideoWindow";
|
||||
|
||||
public V2XRoadVideoWindow(Context context) {
|
||||
@@ -21,4 +25,23 @@ public class V2XRoadVideoWindow extends RelativeLayout {
|
||||
LayoutInflater.from(context).inflate(R.layout.window_road_video, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show(Object entity) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWindowStatusListener(V2XWindowStatusListener listener) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user