修复
java.lang.IllegalStateException: Can't change container ID of fragment MoGoHmiFragment{7b4bb01} (2699d081-5223-4a47-abf0-45ce5f1ac300 id=0x7f090338 tag=MODULE_LEFT_PANEL): was 2131297080 now 2131297072
Signed-off-by: 董宏宇 <martindhy@gmail.com>
This commit is contained in:
@@ -5,7 +5,7 @@ package com.mogo.eagle.core.function.hmi;
|
||||
* @date 2021/8/3 4:26 下午
|
||||
*/
|
||||
public class WaringConst {
|
||||
public static String MODULE_NAME = "MODULE_LEFT_PANEL";
|
||||
public static String MODULE_NAME = "MODULE_HMI_WARING";
|
||||
|
||||
// V2X 弹窗预警
|
||||
// 是否展示:true-展示,false-关闭
|
||||
|
||||
@@ -1,21 +1,17 @@
|
||||
package com.mogo.eagle.core.function.hmi.warning;
|
||||
package com.mogo.eagle.core.function.hmi.warning
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum;
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWaringProvider;
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.WarningStatusListener;
|
||||
import com.mogo.eagle.core.function.hmi.WaringConst;
|
||||
import com.mogo.eagle.core.function.hmi.ui.MoGoHmiFragment;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWaringProvider
|
||||
import com.mogo.eagle.core.function.hmi.ui.MoGoHmiFragment
|
||||
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.function.hmi.WaringConst
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.WarningStatusListener
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.service.MogoServicePaths
|
||||
import com.mogo.utils.logger.Logger
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -23,95 +19,77 @@ import com.mogo.utils.logger.Logger;
|
||||
* 预警模块
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_V2X_WARNING)
|
||||
public class MoGoWarningProvider implements IMoGoWaringProvider {
|
||||
private String TAG = "MoGoWarningProvider";
|
||||
|
||||
private MoGoHmiFragment mMoGoHmiFragment;
|
||||
private Context mContext;
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
Logger.d(TAG, "初始化蘑菇预警模块 ……");
|
||||
mContext = context;
|
||||
class MoGoWarningProvider : IMoGoWaringProvider {
|
||||
private val TAG = "MoGoWarningProvider"
|
||||
private var mMoGoHmiFragment: MoGoHmiFragment? = null
|
||||
private var mContext: Context? = null
|
||||
override fun init(context: Context) {
|
||||
Logger.d(TAG, "初始化蘑菇预警模块 ……")
|
||||
mContext = context
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment createCoverage(Context context, Bundle data) {
|
||||
Logger.d(TAG, "初始化蘑菇预警模块 Fragment……");
|
||||
mMoGoHmiFragment = new MoGoHmiFragment();
|
||||
return mMoGoHmiFragment;
|
||||
override fun createCoverage(context: Context?, data: Bundle?): Fragment? {
|
||||
Logger.d(TAG, "初始化蘑菇预警模块 Fragment……")
|
||||
mMoGoHmiFragment = MoGoHmiFragment()
|
||||
return mMoGoHmiFragment
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getFunctionName() {
|
||||
return WaringConst.MODULE_NAME;
|
||||
override val functionName: String
|
||||
get() = WaringConst.MODULE_NAME
|
||||
|
||||
override fun showWarningTrafficLight(checkLightId: Int) {
|
||||
mMoGoHmiFragment?.showWarningTrafficLight(checkLightId)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showWarningTrafficLight(int checkLightId) {
|
||||
mMoGoHmiFragment.showWarningTrafficLight(checkLightId);
|
||||
override fun disableWarningTrafficLight() {
|
||||
mMoGoHmiFragment?.disableWarningTrafficLight()
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableWarningTrafficLight() {
|
||||
mMoGoHmiFragment.disableWarningTrafficLight();
|
||||
override fun showLimitingVelocity(limitingSpeed: Int) {
|
||||
mMoGoHmiFragment?.showLimitingVelocity(limitingSpeed)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showLimitingVelocity(int limitingSpeed) {
|
||||
mMoGoHmiFragment.showLimitingVelocity(limitingSpeed);
|
||||
override fun disableLimitingVelocity() {
|
||||
mMoGoHmiFragment?.disableLimitingVelocity()
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableLimitingVelocity() {
|
||||
mMoGoHmiFragment.disableLimitingVelocity();
|
||||
override fun changeCountdownRed(redNum: Int) {
|
||||
mMoGoHmiFragment?.changeCountdownRed(redNum)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeCountdownRed(int redNum) {
|
||||
mMoGoHmiFragment.changeCountdownRed(redNum);
|
||||
override fun changeCountdownYellow(yellowNum: Int) {
|
||||
mMoGoHmiFragment?.changeCountdownYellow(yellowNum)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeCountdownYellow(int yellowNum) {
|
||||
mMoGoHmiFragment.changeCountdownYellow(yellowNum);
|
||||
override fun changeCountdownGreen(greenNum: Int) {
|
||||
mMoGoHmiFragment?.changeCountdownGreen(greenNum)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeCountdownGreen(int greenNum) {
|
||||
mMoGoHmiFragment.changeCountdownGreen(greenNum);
|
||||
override fun changeCountdownTrafficLightNum(readNum: Int, yellowNum: Int, greenNum: Int) {
|
||||
mMoGoHmiFragment?.changeCountdownTrafficLightNum(readNum, yellowNum, greenNum)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeCountdownTrafficLightNum(int readNum, int yellowNum, int greenNum) {
|
||||
mMoGoHmiFragment.changeCountdownTrafficLightNum(readNum, yellowNum, greenNum);
|
||||
override fun showWarningV2X(
|
||||
v2xType: Int, alertContent: String?,
|
||||
ttsContent: String?, tag: String?,
|
||||
listener: WarningStatusListener?
|
||||
) {
|
||||
mMoGoHmiFragment?.showWarningV2X(v2xType, alertContent, ttsContent, tag, listener)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showWarningV2X(int v2xType, @Nullable String alertContent,
|
||||
@Nullable String ttsContent, @Nullable String tag,
|
||||
@Nullable WarningStatusListener listener) {
|
||||
mMoGoHmiFragment.showWarningV2X(v2xType, alertContent, ttsContent, tag, listener);
|
||||
override fun disableWarningV2X(tag: String?) {
|
||||
mMoGoHmiFragment?.disableWarningV2X(tag!!)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableWarningV2X(String tag) {
|
||||
mMoGoHmiFragment.disableWarningV2X(tag);
|
||||
override fun showWarning(direction: WarningDirectionEnum) {
|
||||
mMoGoHmiFragment?.showWarning(direction)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showWarning(@NonNull WarningDirectionEnum direction) {
|
||||
mMoGoHmiFragment.showWarning(direction);
|
||||
override fun showWarning(direction: WarningDirectionEnum, closeTime: Long) {
|
||||
mMoGoHmiFragment?.showWarning(direction, closeTime)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showWarning(@NonNull WarningDirectionEnum direction, long closeTime) {
|
||||
mMoGoHmiFragment.showWarning(direction, closeTime);
|
||||
override fun onDestroy() {
|
||||
Log.d(TAG, "onDestroy")
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
Log.d(TAG, "onDestroy");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user