Merge remote-tracking branch 'origin/dev_MogoAP_eagle-1030_211020_8.0.14' into dev_MogoAP_eagle-1030_211020_8.0.14
This commit is contained in:
@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.hmi.ui.notice;
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -28,6 +29,7 @@ public class NoticeBannerView extends ConstraintLayout {
|
||||
private TextView noticeBannerCheck;
|
||||
private NoticeTrafficDialog mNoticeTrafficDialog;
|
||||
private Context mContext;
|
||||
private NoticeTrafficStylePushData mPushData;
|
||||
|
||||
public NoticeBannerView(@NonNull Context context) {
|
||||
super(context);
|
||||
@@ -48,10 +50,17 @@ public class NoticeBannerView extends ConstraintLayout {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
|
||||
public void refreshWithData(NoticeTrafficStylePushData pushData){
|
||||
public void refreshWithData(NoticeTrafficStylePushData pushData) {
|
||||
mPushData = pushData;
|
||||
noticePushTitle.setText(pushData.getMsg());
|
||||
noticePushContent.setText(pushData.getContent());
|
||||
if (pushData.getIsVideo()) {
|
||||
iconImageView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
iconImageView.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
public void initView() {
|
||||
styleImageView = findViewById(R.id.notice_push_style_image);
|
||||
iconImageView = findViewById(R.id.notice_push_icon_video);
|
||||
@@ -60,13 +69,13 @@ public class NoticeBannerView extends ConstraintLayout {
|
||||
noticeBannerCheck = findViewById(R.id.notice_push_banner_check);
|
||||
|
||||
noticeBannerCheck.setOnClickListener(v -> {
|
||||
mNoticeTrafficDialog = new NoticeTrafficDialog(mContext);
|
||||
mNoticeTrafficDialog = new NoticeTrafficDialog(mContext, mPushData);
|
||||
mNoticeTrafficDialog.show();
|
||||
});
|
||||
}
|
||||
|
||||
//数据改变刷新UI
|
||||
public void pushBeanChanged(NoticeTrafficStyleInfo info){
|
||||
public void pushBeanChanged(NoticeTrafficStyleInfo info) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer;
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog;
|
||||
import com.mogo.module.common.view.SpacesItemDecoration;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
@@ -21,10 +24,14 @@ import java.util.List;
|
||||
public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
private Context mContext;
|
||||
private RecyclerView mRecyclerView;
|
||||
private SimpleVideoPlayer mVideoPlayer;
|
||||
private NoticeTrafficStylePushData mPushData;
|
||||
private ImageView close;
|
||||
|
||||
public NoticeTrafficDialog(@NonNull Context context) {
|
||||
public NoticeTrafficDialog(@NonNull Context context, NoticeTrafficStylePushData pushData) {
|
||||
super(context);
|
||||
mContext = context;
|
||||
mPushData = pushData;
|
||||
initView();
|
||||
}
|
||||
|
||||
@@ -34,6 +41,11 @@ public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
|
||||
public void initView() {
|
||||
setContentView(R.layout.notice_dialog_traffic_police);
|
||||
mVideoPlayer = findViewById(R.id.video_player);
|
||||
close = findViewById(R.id.notice_traffic_dialog_close);
|
||||
close.setOnClickListener(v -> {
|
||||
dismiss();
|
||||
});
|
||||
//网格绘制
|
||||
try {
|
||||
mRecyclerView = findViewById(R.id.traffic_info_recyclerView);
|
||||
@@ -49,5 +61,24 @@ public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
}
|
||||
NoticeTrafficAdapter adapter = new NoticeTrafficAdapter(mContext);
|
||||
mRecyclerView.setAdapter(adapter);
|
||||
startLive();
|
||||
}
|
||||
|
||||
/**
|
||||
* 视频播放
|
||||
*/
|
||||
private void startLive() {
|
||||
if (mPushData != null && mPushData.getIsVideo() == true) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void cancel() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
super.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<!--图/视频-->
|
||||
<ImageView
|
||||
android:id="@+id/back_image"
|
||||
<com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer
|
||||
android:id="@+id/video_player"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/notice_traffic_acc_image_height"
|
||||
android:layout_marginLeft="@dimen/dp_200"
|
||||
|
||||
@@ -4,8 +4,8 @@ import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData;
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.notice.receiver.NoticeMessageListener;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.cloud.socket.IMogoOnMessageListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -19,7 +19,6 @@ import com.mogo.utils.network.utils.GsonUtil;
|
||||
class NoticeSocketManager {
|
||||
private String TAG = "AINotice";
|
||||
private static NoticeSocketManager mNoticeSocketManager;
|
||||
private NoticeMessageListener mNoticeMessageListener;
|
||||
private Context mContext;
|
||||
|
||||
public static synchronized NoticeSocketManager getInstance() {
|
||||
@@ -34,7 +33,6 @@ class NoticeSocketManager {
|
||||
public void registerSocketMessageListener(Context context) {
|
||||
Log.d(TAG, "registerSocketMessage");
|
||||
mContext = context;
|
||||
mNoticeMessageListener = new NoticeMessageListener();
|
||||
MogoApisHandler.getInstance().getApis().getSocketManagerApi(context).
|
||||
registerOnMessageListener(301001, mNoticeMessageListener);
|
||||
MogoApisHandler.getInstance().getApis().getSocketManagerApi(context).
|
||||
@@ -53,7 +51,7 @@ class NoticeSocketManager {
|
||||
/**
|
||||
* 普通云公告
|
||||
*/
|
||||
private IMogoOnMessageListener<NoticeNormalData> mNormalNoticeListener = new IMogoOnMessageListener< NoticeNormalData >() {
|
||||
private IMogoOnMessageListener<NoticeNormalData> mNormalNoticeListener = new IMogoOnMessageListener<NoticeNormalData>() {
|
||||
@Override
|
||||
public Class<NoticeNormalData> target() {
|
||||
return NoticeNormalData.class;
|
||||
@@ -77,5 +75,22 @@ class NoticeSocketManager {
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* 交警类型公告弹窗
|
||||
*/
|
||||
private IMogoOnMessageListener<NoticeTrafficStylePushData> mNoticeMessageListener = new IMogoOnMessageListener<NoticeTrafficStylePushData>() {
|
||||
|
||||
@Override
|
||||
public Class<NoticeTrafficStylePushData> target() {
|
||||
return NoticeTrafficStylePushData.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(NoticeTrafficStylePushData obj) {
|
||||
Logger.i(TAG, "301001-- 交警类型公告数据:" + GsonUtil.jsonFromObject(obj));
|
||||
CallerHmiManager.INSTANCE.showTrafficBanner(obj);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.mogo.eagle.core.function.notice.receiver;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.service.cloud.socket.IMogoOnMessageListener;
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
* @description push云公告消息接收
|
||||
* @since: 10/27/21
|
||||
*/
|
||||
public class NoticeMessageListener implements IMogoOnMessageListener {
|
||||
private String TAG = "AINotice";
|
||||
private Context mContext;
|
||||
|
||||
@Override
|
||||
public Class target() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(Object obj) {
|
||||
Log.d(TAG, obj.toString());
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ class TestNoticeBroadcastReceiver : BroadcastReceiver() {
|
||||
}
|
||||
|
||||
private fun dispatchSceneTest(sceneType: Int) {
|
||||
Log.d(TAG, "dispatchSceneTest::"+sceneType.toString());
|
||||
Log.d(TAG, "dispatchSceneTest::" + sceneType.toString());
|
||||
if (sceneType == 301001) {
|
||||
val pushData = NoticeTrafficStylePushData()
|
||||
pushData.msg = "交警测试公告"
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.eagle.core.data.notice;
|
||||
/**
|
||||
* @author Jing
|
||||
* @description 交警任务公告推送消息体
|
||||
* 接口 http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=66917469
|
||||
* @since: 10/28/21
|
||||
*/
|
||||
public class NoticeTrafficStylePushData {
|
||||
@@ -10,7 +11,7 @@ public class NoticeTrafficStylePushData {
|
||||
private String infoId;
|
||||
private String poiImgUrl;
|
||||
private String title;
|
||||
private String isVideo;
|
||||
private boolean isVideo;
|
||||
private String content;
|
||||
|
||||
public String getMsg() {
|
||||
@@ -45,11 +46,11 @@ public class NoticeTrafficStylePushData {
|
||||
this.poiImgUrl = poiImgUrl;
|
||||
}
|
||||
|
||||
public String getIsVideo() {
|
||||
public boolean getIsVideo() {
|
||||
return isVideo;
|
||||
}
|
||||
|
||||
public void setIsVideo(String isVideo) {
|
||||
public void setIsVideo(boolean isVideo) {
|
||||
this.isVideo = isVideo;
|
||||
}
|
||||
|
||||
@@ -63,11 +64,12 @@ public class NoticeTrafficStylePushData {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NoticePushData{" +
|
||||
return "NoticeTrafficStylePushData{" +
|
||||
"msg='" + msg + '\'' +
|
||||
", infoId='" + infoId + '\'' +
|
||||
", imageUrl='" + poiImgUrl + '\'' +
|
||||
", isVideo='" + isVideo + '\'' +
|
||||
", poiImgUrl='" + poiImgUrl + '\'' +
|
||||
", title='" + title + '\'' +
|
||||
", isVideo=" + isVideo +
|
||||
", content='" + content + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@@ -67,10 +67,10 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.androidxrecyclerview
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
|
||||
implementation rootProject.ext.dependencies.videoarmv7
|
||||
implementation rootProject.ext.dependencies.videoarm64
|
||||
implementation rootProject.ext.dependencies.videojava
|
||||
implementation rootProject.ext.dependencies.livesdk
|
||||
api rootProject.ext.dependencies.videoarmv7
|
||||
api rootProject.ext.dependencies.videoarm64
|
||||
api rootProject.ext.dependencies.videojava
|
||||
api rootProject.ext.dependencies.livesdk
|
||||
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 836 B |
Reference in New Issue
Block a user