Merge remote-tracking branch 'origin/dev_MogoAP_eagle-1030_211020_8.0.14' into dev_MogoAP_eagle-1030_211020_8.0.14

# Conflicts:
#	core/function-impl/mogo-core-function-notice/build.gradle
#	core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/NoticeProvider.java
#	core/function-impl/mogo-core-function-notice/src/main/java/com/mogo/eagle/core/function/notice/test/TestNoticeBroadcastReceiver.java
This commit is contained in:
董宏宇
2021-10-29 17:24:41 +08:00
17 changed files with 167 additions and 77 deletions

3
.idea/gradle.xml generated
View File

@@ -4,7 +4,7 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="GRADLE" />
<option name="testRunner" value="PLATFORM" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
@@ -82,6 +82,7 @@
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>

View File

@@ -9,12 +9,13 @@ import android.view.animation.OvershootInterpolator
import com.mogo.commons.mvp.MvpFragment
import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.notice.NoticePushData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
import com.mogo.eagle.core.function.hmi.notification.enums.SidePattern
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeBannerView
import com.mogo.eagle.core.function.hmi.ui.widget.V2XNotificationView
import com.mogo.module.common.enums.EventTypeEnum
import com.mogo.utils.logger.Logger
@@ -209,10 +210,13 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
/**
* 展示云公告顶部弹窗
* @param pushData
* @param trafficStylePushData
*/
override fun showNoticeForTrafficWithData(pushData: NoticePushData) {
override fun showNoticeForTrafficWithData(trafficStylePushData: NoticeTrafficStylePushData) {
activity.let {
val noticeBannerView = this.getContext()?.let { it1 -> NoticeBannerView(it1) }
}
}
}

View File

@@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui
import com.mogo.commons.mvp.IView
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.notice.NoticePushData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
@@ -99,8 +99,8 @@ interface MoGoWarningContract {
/**
* 展示云公告顶部弹窗
* @param pushData
* @param trafficStylePushData
*/
fun showNoticeForTrafficWithData(pushData: NoticePushData)
fun showNoticeForTrafficWithData(trafficStylePushData: NoticeTrafficStylePushData)
}
}

View File

@@ -10,7 +10,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.mogo.eagle.core.data.notice.NoticeTrafficInfo;
import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo;
import com.mogo.eagle.core.function.hmi.R;
/**
@@ -61,7 +61,7 @@ public class NoticeBannerView extends ConstraintLayout {
}
//数据改变刷新UI
public void pushBeanChanged(NoticeTrafficInfo info){
public void pushBeanChanged(NoticeTrafficStyleInfo info){
}
}

View File

@@ -13,6 +13,7 @@ import android.view.View;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeBannerView;
/**

View File

@@ -56,6 +56,7 @@ dependencies {
implementation rootProject.ext.dependencies.mogocommons
implementation rootProject.ext.dependencies.mogoserviceapi
implementation rootProject.ext.dependencies.modulecommon
implementation rootProject.ext.dependencies.moduleHmi
} else {
implementation project(":foudations:mogo-commons")
implementation project(':services:mogo-service-api')
@@ -66,6 +67,7 @@ dependencies {
implementation project(':core:mogo-core-res')
implementation project(':core:mogo-core-data')
implementation project(':core:mogo-core-network')
implementation project(':core:function-impl:mogo-core-function-hmi')
}
}

View File

@@ -2,13 +2,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mogo.eagle.core.function.notice">
<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>
<application></application>
</manifest>

View File

@@ -8,8 +8,10 @@ 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.data.notice.NoticePushData;
import com.mogo.eagle.core.data.notice.NoticeNormalData;
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData;
import com.mogo.eagle.core.function.api.notice.IMoGoNoticeProvider;
import com.mogo.eagle.core.function.hmi.ui.MoGoHmiFragment;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -24,11 +26,13 @@ import org.jetbrains.annotations.Nullable;
public class NoticeProvider implements IMoGoNoticeProvider {
private String TAG = "AINotice";
private Context mContext;
private MoGoHmiFragment mMoGoHmiFragment;
@Nullable
@Override
public Fragment createCoverage(@Nullable Context context, @Nullable Bundle data) {
return null;
mMoGoHmiFragment = new MoGoHmiFragment();
return mMoGoHmiFragment;
}
@NotNull
@@ -50,7 +54,12 @@ public class NoticeProvider implements IMoGoNoticeProvider {
}
@Override
public void showNoticeForTrafficWithData(NoticePushData pushData) {
public void showNoticeForTrafficWithData(NoticeTrafficStylePushData pushData) {
mMoGoHmiFragment.showNoticeForTrafficWithData(pushData);
}
@Override
public void showNoticeNormalData(NoticeNormalData normalData) {
}
}

View File

@@ -1,41 +0,0 @@
package com.mogo.eagle.core.function.notice.test;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.mogo.eagle.core.data.notice.NoticePushData;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
/**
* @author Jing
* @description 描述
* @since: 10/28/21
*/
public class TestNoticeBroadcastReceiver extends BroadcastReceiver {
private String TAG = "notice";
private Context mContext;
@Override
public void onReceive(Context context, Intent intent) {
try {
this.mContext = context;
int sceneType = intent.getIntExtra("sceneType", 0);
Logger.d(TAG, "textPanelOpenType:" + sceneType);
// 分发场景
dispatchSceneTest(sceneType);
} catch (Exception e) {
e.printStackTrace();
}
}
private void dispatchSceneTest(int sceneType) {
if (sceneType == 301001) {
NoticePushData pushData = new NoticePushData();
pushData.setMsg("交警测试公告");
pushData.setContent("交警测试公告内容");
// CallerHmiManager.showTrafficBanner(pushData);
}
}
}

View File

@@ -0,0 +1,39 @@
package com.mogo.eagle.core.function.notice.test
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.utils.logger.Logger
/**
* @author Jing
* @description 测试类
* @since: 10/29/21
*/
class TestNoticeBroadcastReceiver: BroadcastReceiver() {
private val TAG = "notice"
private var mContext: Context? = null
override fun onReceive(context: Context?, intent: Intent) {
try {
mContext = context
val sceneType = intent.getIntExtra("sceneType", 0)
Logger.d(TAG, "textPanelOpenType:$sceneType")
// 分发场景
dispatchSceneTest(sceneType)
} catch (e: Exception) {
e.printStackTrace()
}
}
private fun dispatchSceneTest(sceneType: Int) {
if (sceneType == 301001) {
val pushData = NoticeTrafficStylePushData()
pushData.msg = "交警测试公告"
pushData.content = "交警测试公告内容"
CallerHmiManager.showTrafficBanner(pushData)
}
}
}

View File

@@ -0,0 +1,36 @@
package com.mogo.eagle.core.data.notice
import androidx.annotation.Keep
/**
* @description 普通公告数据类型
*
* @author lixiaopeng
* @since 2021/10/29
*/
@Keep
data class NoticeNormalData(
var appIcon: String = "", //目标app icon图标地址
var title: String = "", //标题
var content: String = "", //内容
var dbId: String = "", //公告id
var imageUrl: String = "", //图片地址
var videoUrl: String = "", //视频地址
var fileType: Int = 0, // 1图片2视频
val tts: String = "", //语音播报词
val speedLimit: Int = 0, //超过速度后延迟显示
var showTimeout: Int = 0, //显示等待时长
var showTimeoutShadow: Int = 0, // 显示等待时长备份
var QRCode: String = "", //二维码地址
var mainSchema: String = "", //schema跳转协议
val mainVoiceCmd: List<String>? = null, //触发主schema 命令词
val cancelVoiceCmd: List<String>? = null, //隐藏当前push命令词
val buttons: List<Button>? = null, //底部buttons列表
var timestamp: Long = System.currentTimeMillis()
)
data class Button(
val text: String = "", // button名称
val action: String = "", //scheme 协议
val voiceCmd: List<String>? = null //注册命令词
)

View File

@@ -0,0 +1,21 @@
package com.mogo.eagle.core.data.notice
import androidx.annotation.Keep
/**
* @description 普通公告详情
*
* @author lixiaopeng
* @since 2021/10/29 TODO 等待服务端定接口
*/
@Keep
data class NoticeNormalDetailData(
var appIcon: String = "", //目标app icon图标地址
var title: String = "", //标题
var content: String = "", //内容
var dbId: String = "", //公告id
var imageUrl: String = "", //图片地址
var videoUrl: String = "", //视频地址
var fileType: Int = 0, // 1图片2视频
val tts: String = "", //语音播报词
)

View File

@@ -7,7 +7,7 @@ import java.io.Serializable;
* @description 交通事故任务详情数据bean
* @since: 10/26/21
*/
public class NoticeTrafficInfo implements Serializable {
public class NoticeTrafficStyleInfo implements Serializable {
private String infoId;//事故id
private String poiType;//事故类型
private long dataCreateTime;//事故发生时间

View File

@@ -5,10 +5,11 @@ package com.mogo.eagle.core.data.notice;
* @description 交警任务公告推送消息体
* @since: 10/28/21
*/
public class NoticePushData {
public class NoticeTrafficStylePushData {
private String msg;
private String infoId;
private String imageUrl;
private String poiImgUrl;
private String title;
private String isVideo;
private String content;
@@ -28,12 +29,20 @@ public class NoticePushData {
this.infoId = infoId;
}
public String getImageUrl() {
return imageUrl;
public String getTitle() {
return title;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
public void setTitle(String title) {
this.title = title;
}
public String getPoiImgUrl() {
return poiImgUrl;
}
public void setPoiImgUrl(String poiImgUrl) {
this.poiImgUrl = poiImgUrl;
}
public String getIsVideo() {
@@ -57,7 +66,7 @@ public class NoticePushData {
return "NoticePushData{" +
"msg='" + msg + '\'' +
", infoId='" + infoId + '\'' +
", imageUrl='" + imageUrl + '\'' +
", imageUrl='" + poiImgUrl + '\'' +
", isVideo='" + isVideo + '\'' +
", content='" + content + '\'' +
'}';

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.api.notice;
import com.mogo.eagle.core.data.notice.NoticePushData;
import com.mogo.eagle.core.data.notice.NoticeNormalData;
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
/**
@@ -15,5 +16,13 @@ public interface IMoGoNoticeProvider extends IMoGoFunctionProvider {
*
* @param pushData 推送消息体
*/
void showNoticeForTrafficWithData(NoticePushData pushData);
void showNoticeForTrafficWithData(NoticeTrafficStylePushData pushData);
/**
* 呈现普通公告顶部弹框
*
* @param normalData 推送消息体
*/
void showNoticeNormalData(NoticeNormalData normalData);
}

View File

@@ -2,7 +2,8 @@ package com.mogo.eagle.core.function.call.hmi
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.notice.NoticePushData
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWaringProvider
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.api.notice.IMoGoNoticeProvider
@@ -131,10 +132,18 @@ object CallerHmiManager : CallerBase() {
/**
* 呈现交通云公告弹窗(hmi)
*
* @param pushData
* @param trafficStylePushData
*/
fun showTrafficBanner(pushData: NoticePushData) {
noticeProviderApi.showNoticeForTrafficWithData(pushData)
fun showTrafficBanner(trafficStylePushData: NoticeTrafficStylePushData?) {
noticeProviderApi.showNoticeForTrafficWithData(trafficStylePushData)
}
/**
* 普通公告弹窗
*
*/
fun showNormalBanner(noticeNormal: NoticeNormalData) {
noticeProviderApi.showNoticeNormalData(noticeNormal)
}
}

View File

@@ -1,6 +1,5 @@
package com.mogo.eagle.core.function.call.notice;
import com.mogo.eagle.core.data.notice.NoticePushData;
import com.mogo.eagle.core.function.api.notice.IMoGoNoticeProvider;
import com.mogo.eagle.core.function.call.base.CallerBase;