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:
@@ -2,5 +2,14 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.eagle.core.function.notice">
|
||||
|
||||
<application></application>
|
||||
<application>
|
||||
<receiver android:name=".test.TestNoticeBroadcastReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.notice.test_panel_control" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1,22 +1,18 @@
|
||||
package com.mogo.eagle.core.function.notice;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.notice.IMoGoNoticeProvider;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
* @description 云公告
|
||||
* @description 云公告公告
|
||||
* @since: 10/27/21
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_AI_NOTICE)
|
||||
@@ -24,12 +20,6 @@ public class NoticeProvider implements IMoGoNoticeProvider {
|
||||
private String TAG = "AINotice";
|
||||
private Context mContext;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Fragment createCoverage(@Nullable Context context, @Nullable Bundle data) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFunctionName() {
|
||||
@@ -47,5 +37,4 @@ public class NoticeProvider implements IMoGoNoticeProvider {
|
||||
mContext = context;
|
||||
NoticeSocketManager.getInstance().registerSocketMessageListener(context);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,8 +3,13 @@ package com.mogo.eagle.core.function.notice;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData;
|
||||
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;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
@@ -32,13 +37,45 @@ class NoticeSocketManager {
|
||||
mNoticeMessageListener = new NoticeMessageListener();
|
||||
MogoApisHandler.getInstance().getApis().getSocketManagerApi(context).
|
||||
registerOnMessageListener(301001, mNoticeMessageListener);
|
||||
MogoApisHandler.getInstance().getApis().getSocketManagerApi(context).
|
||||
registerOnMessageListener(100, mNormalNoticeListener);
|
||||
}
|
||||
|
||||
public void unRegisterSocketMessageListener() {
|
||||
if (mNoticeMessageListener != null) {
|
||||
MogoApisHandler.getInstance().getApis().getSocketManagerApi(mContext).
|
||||
unregisterOnMessageListener(301001, mNoticeMessageListener);
|
||||
MogoApisHandler.getInstance().getApis().getSocketManagerApi(mContext).
|
||||
unregisterOnMessageListener(100, mNormalNoticeListener);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通云公告
|
||||
*/
|
||||
private IMogoOnMessageListener<NoticeNormalData> mNormalNoticeListener = new IMogoOnMessageListener< NoticeNormalData >() {
|
||||
@Override
|
||||
public Class<NoticeNormalData> target() {
|
||||
return NoticeNormalData.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(NoticeNormalData obj) {
|
||||
Logger.i("liyz", "100-- 普通公告数据:" + GsonUtil.jsonFromObject(obj));
|
||||
if (obj == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
//TODO 展示弹框
|
||||
CallerHmiManager.INSTANCE.showNormalBanner(obj);
|
||||
|
||||
// NoticePushData data = new NoticePushData();
|
||||
// data.setImageUrl(obj.getImageUrl());
|
||||
// data.setContent(obj.getContent());
|
||||
// data.setInfoId(obj.getDbId());
|
||||
// CallerHmiManager.INSTANCE.showTrafficBanner(data);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.notice.test
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.utils.logger.Logger
|
||||
@@ -12,8 +13,8 @@ import com.mogo.utils.logger.Logger
|
||||
* @description 测试类
|
||||
* @since: 10/29/21
|
||||
*/
|
||||
class TestNoticeBroadcastReceiver: BroadcastReceiver() {
|
||||
private val TAG = "notice"
|
||||
class TestNoticeBroadcastReceiver : BroadcastReceiver() {
|
||||
private val TAG = "AINotice"
|
||||
private var mContext: Context? = null
|
||||
|
||||
override fun onReceive(context: Context?, intent: Intent) {
|
||||
@@ -29,6 +30,7 @@ class TestNoticeBroadcastReceiver: BroadcastReceiver() {
|
||||
}
|
||||
|
||||
private fun dispatchSceneTest(sceneType: Int) {
|
||||
Log.d(TAG, "dispatchSceneTest::"+sceneType.toString());
|
||||
if (sceneType == 301001) {
|
||||
val pushData = NoticeTrafficStylePushData()
|
||||
pushData.msg = "交警测试公告"
|
||||
|
||||
Reference in New Issue
Block a user