fix ui bug and add log
This commit is contained in:
@@ -55,7 +55,14 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
}
|
||||
|
||||
override fun vipIdentification(visible: Boolean) {
|
||||
flVipIdentificationView.visibility = if (visible) View.VISIBLE else View.GONE
|
||||
ThreadUtils.runOnUiThread {
|
||||
Logger.d(TAG, "vipIdentification")
|
||||
if (visible) {
|
||||
flVipIdentificationView.visibility = View.VISIBLE
|
||||
} else {
|
||||
flVipIdentificationView.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun createCoverage(activity: FragmentActivity?, containerId: Int?): Fragment? {
|
||||
|
||||
@@ -29,8 +29,9 @@
|
||||
android:layout_width="@dimen/module_vip_width"
|
||||
android:layout_height="@dimen/module_vip_height"
|
||||
android:layout_marginLeft="@dimen/module_vip_margin_left"
|
||||
app:layout_constraintLeft_toRightOf="@+id/flSpeedChartView"
|
||||
app:layout_constraintTop_toTopOf="@+id/flSpeedChartView" />
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toRightOf="@+id/viewSpeedChart"
|
||||
app:layout_constraintTop_toTopOf="@+id/viewSpeedChart" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.AutoPilotStatusView
|
||||
android:id="@+id/viewAutopilotStatus"
|
||||
@@ -97,11 +98,10 @@
|
||||
android:id="@+id/ivCameraIcon"
|
||||
android:layout_width="130px"
|
||||
android:layout_height="130px"
|
||||
app:layout_constraintEnd_toStartOf="@id/viewTrafficLightVr"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="38px"
|
||||
android:layout_marginEnd="30px"
|
||||
android:background="@drawable/icon_camera_nor"
|
||||
tools:visibility="visible"
|
||||
/>
|
||||
app:layout_constraintEnd_toStartOf="@id/viewTrafficLightVr"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -11,7 +11,6 @@
|
||||
android:layout_height="@dimen/dp_104"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/v2x_vip_identification_vr"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
import com.mogo.eagle.core.utilcode.util.SPUtils
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.enums.EventTypeEnum
|
||||
@@ -37,9 +38,23 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
|
||||
fun initServer(context: Context) {
|
||||
mContext = context
|
||||
MogoApisHandler.getInstance().apis.registerCenterApi.registerCarLocationChangedListener(TAG, this)
|
||||
MogoApisHandler.getInstance().apis.getSocketManagerApi(context)
|
||||
MogoApisHandler.getInstance()
|
||||
.apis.registerCenterApi.registerCarLocationChangedListener(TAG, this)
|
||||
MogoApisHandler.getInstance()
|
||||
.apis.getSocketManagerApi(context)
|
||||
.registerOnMessageListener(401025, this)
|
||||
|
||||
val vipSetTime = SPUtils.getInstance().getLong("vip")
|
||||
if (vipSetTime == -1L) {
|
||||
return
|
||||
}
|
||||
//todo 后续改成接口调用查询,防止清除缓存造成状态不统一
|
||||
if (vipSetTime > 0 && System.currentTimeMillis() - vipSetTime < 0) { //未超时,需要设置VIP
|
||||
CallerHmiManager.vipIdentification(true)
|
||||
CallTrafficLightListenerManager.registerTrafficLightListener(TAG, this)
|
||||
} else {
|
||||
SPUtils.getInstance().remove("vip") //超时
|
||||
}
|
||||
}
|
||||
|
||||
override fun target(): Class<VipMessage> {
|
||||
@@ -47,13 +62,16 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
}
|
||||
|
||||
override fun onMsgReceived(vipMessage: VipMessage?) {
|
||||
Logger.d(TAG, "onMsgReceived vipMessage : ${vipMessage.toString()}")
|
||||
vipMessage?.let {
|
||||
when (it.vipType) {
|
||||
0 -> {
|
||||
0 -> { //取消VIP
|
||||
SPUtils.getInstance().remove("vip")
|
||||
CallerHmiManager.vipIdentification(false)
|
||||
CallTrafficLightListenerManager.unRegisterTrafficLightListener(TAG)
|
||||
}
|
||||
1 -> {
|
||||
1 -> { //设置VIP
|
||||
SPUtils.getInstance().put("vip", vipMessage.timeOut)
|
||||
CallerHmiManager.vipIdentification(true)
|
||||
CallTrafficLightListenerManager.registerTrafficLightListener(TAG, this)
|
||||
}
|
||||
@@ -67,7 +85,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
//如果上次结果和本次灯态结果变化比较大,则已变灯,控制HMI展示弹窗
|
||||
if ((result!!.laneList.mid.remain - trafficLightResult.laneList.mid.remain) > 3) {
|
||||
CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType.toInt(),
|
||||
"",
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION.content,
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION.tts,
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType,
|
||||
object : IMoGoWarningStatusListener {
|
||||
|
||||
Reference in New Issue
Block a user