caller调用notice ui

This commit is contained in:
liujing
2021-10-29 17:40:03 +08:00
parent e966c92f19
commit eec497158d
6 changed files with 35 additions and 39 deletions

View File

@@ -11,6 +11,8 @@ import com.mogo.eagle.core.function.hmi.WaringConst
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.utils.logger.Logger
/**
@@ -89,6 +91,14 @@ class MoGoWarningProvider : IMoGoWaringProvider {
mMoGoHmiFragment?.showWarning(direction, closeTime)
}
override fun showNoticeForTrafficWithData(pushData: NoticeTrafficStylePushData?) {
TODO("Not yet implemented")
}
override fun showNoticeNormalData(normalData: NoticeNormalData?) {
TODO("Not yet implemented")
}
override fun onDestroy() {
Log.d(TAG, "onDestroy")
}

View File

@@ -56,7 +56,6 @@ 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')
@@ -67,7 +66,6 @@ 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

@@ -8,10 +8,7 @@ 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.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;
@@ -26,13 +23,11 @@ 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) {
mMoGoHmiFragment = new MoGoHmiFragment();
return mMoGoHmiFragment;
return null;
}
@NotNull
@@ -53,13 +48,4 @@ public class NoticeProvider implements IMoGoNoticeProvider {
NoticeSocketManager.getInstance().registerSocketMessageListener(context);
}
@Override
public void showNoticeForTrafficWithData(NoticeTrafficStylePushData pushData) {
mMoGoHmiFragment.showNoticeForTrafficWithData(pushData);
}
@Override
public void showNoticeNormalData(NoticeNormalData normalData) {
}
}

View File

@@ -1,6 +1,8 @@
package com.mogo.eagle.core.function.api.hmi.warning
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
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
/**
@@ -17,11 +19,11 @@ interface IMoGoWaringProvider : IMoGoFunctionProvider {
* @param tag tag绑定弹窗的标志
*/
fun showWarningV2X(
v2xType: Int,
alertContent: String?,
ttsContent: String?,
tag: String?,
listenerIMoGo: IMoGoWarningStatusListener?
v2xType: Int,
alertContent: String?,
ttsContent: String?,
tag: String?,
listenerIMoGo: IMoGoWarningStatusListener?
)
/**
@@ -90,4 +92,18 @@ interface IMoGoWaringProvider : IMoGoFunctionProvider {
* @param closeTime 倒计时
*/
fun showWarning(direction: WarningDirectionEnum, closeTime: Long)
/**
* 呈现交警推送消息顶部弹框
*
* @param pushData 推送消息体
*/
fun showNoticeForTrafficWithData(pushData: NoticeTrafficStylePushData?)
/**
* 呈现普通公告顶部弹框
*
* @param normalData 推送消息体
*/
fun showNoticeNormalData(normalData: NoticeNormalData?)
}

View File

@@ -11,18 +11,6 @@ import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
*/
public interface IMoGoNoticeProvider extends IMoGoFunctionProvider {
/**
* 呈现交警推送消息顶部弹框
*
* @param pushData 推送消息体
*/
void showNoticeForTrafficWithData(NoticeTrafficStylePushData pushData);
/**
* 呈现普通公告顶部弹框
*
* @param normalData 推送消息体
*/
void showNoticeNormalData(NoticeNormalData normalData);
}

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.call.hmi
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_V2X_WARNING
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
@@ -19,9 +20,6 @@ object CallerHmiManager : CallerBase() {
private val waringProviderApi: IMoGoWaringProvider
get() = getApiInstance(IMoGoWaringProvider::class.java, MogoServicePaths.PATH_V2X_WARNING)
private val noticeProviderApi: IMoGoNoticeProvider
get() = getApiInstance(IMoGoNoticeProvider::class.java, MogoServicePaths.PATH_AI_NOTICE)
/**
* 展示VR下V2X预警
*
@@ -135,7 +133,7 @@ object CallerHmiManager : CallerBase() {
* @param trafficStylePushData
*/
fun showTrafficBanner(trafficStylePushData: NoticeTrafficStylePushData?) {
noticeProviderApi.showNoticeForTrafficWithData(trafficStylePushData)
waringProviderApi.showNoticeForTrafficWithData(trafficStylePushData)
}
/**
@@ -143,7 +141,7 @@ object CallerHmiManager : CallerBase() {
*
*/
fun showNormalBanner(noticeNormal: NoticeNormalData) {
noticeProviderApi.showNoticeNormalData(noticeNormal)
waringProviderApi.showNoticeNormalData(noticeNormal)
}
}