add bindingcar and opt
This commit is contained in:
@@ -46,5 +46,13 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!--绑定车辆-->
|
||||
<receiver android:name="com.mogo.eagle.core.function.hmi.receiver.BindingcarBroadcastReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.hmi.bindingcar" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.mogo.eagle.core.function.hmi.receiver
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBindingcarDialog
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBrakeLight
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showModifyBindingcarDialog
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showTurnLight
|
||||
|
||||
/**
|
||||
* 绑定车辆
|
||||
*
|
||||
* @author lixiaopeng
|
||||
*/
|
||||
class BindingcarBroadcastReceiver : BroadcastReceiver() {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "BindingcarBroadcastReceiver"
|
||||
}
|
||||
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
try {
|
||||
val type = intent.getIntExtra("type", 0)
|
||||
showTurnLight(type)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun showTurnLight( //type 1获取车辆信息,2修改绑定信息
|
||||
type: Int
|
||||
) {
|
||||
if (type == 1) {
|
||||
showBindingcarDialog()
|
||||
} else if (type == 2) {
|
||||
showModifyBindingcarDialog()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,10 +36,13 @@ import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.WaringConst
|
||||
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.ui.bindingcar.ModifyBindingCarDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.bindingcar.ToBindingCarDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.camera.CameraListView
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeBannerView
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeNormalBannerView
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.DebugSettingView
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.AutoPilotAndCheckView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.V2XNotificationView
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
@@ -823,6 +826,24 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
}
|
||||
}
|
||||
|
||||
private var modifyBindingCarDialog: ModifyBindingCarDialog? = null
|
||||
private var toBindingCarDialog: ToBindingCarDialog? = null
|
||||
|
||||
override fun showToBindingcarDialog() {
|
||||
if (toBindingCarDialog == null) {
|
||||
toBindingCarDialog = ToBindingCarDialog(requireContext())
|
||||
}
|
||||
toBindingCarDialog!!.showToBindingcarDialog()
|
||||
}
|
||||
|
||||
override fun showModifyBindingcarDialog() {
|
||||
if (modifyBindingCarDialog == null) {
|
||||
modifyBindingCarDialog = ModifyBindingCarDialog(requireContext())
|
||||
}
|
||||
modifyBindingCarDialog!!.showModifyBindingcarDialog()
|
||||
|
||||
}
|
||||
|
||||
override fun setTurnLightFunction(isOpen: Boolean) {
|
||||
HmiBuildConfig.isShowTurnLightView = isOpen
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@ package com.mogo.eagle.core.function.hmi.ui.bindingcar
|
||||
import android.content.Context
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener
|
||||
@@ -11,10 +13,10 @@ import com.mogo.service.statusmanager.StatusDescriptor
|
||||
|
||||
|
||||
/**
|
||||
* @brief 绑定车辆对话框
|
||||
* @brief 修改车辆对话框
|
||||
* @author lixiaopeng
|
||||
*/
|
||||
class BindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver{
|
||||
class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver{
|
||||
|
||||
private val TAG = "BindingCarDialog"
|
||||
private var confirmTv: TextView? = null
|
||||
@@ -47,7 +49,14 @@ class BindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
||||
* 修改绑定车机 TODO
|
||||
*/
|
||||
fun modifyBindingcar() {
|
||||
|
||||
CallerBindingcarManager.getBindingcarProvider().modifyCarInfo {
|
||||
if (it.code == 200) {
|
||||
TipToast.shortTip("修改绑定成功")
|
||||
} else {
|
||||
TipToast.shortTip("修改绑定失败")
|
||||
}
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
|
||||
override fun dismiss() {
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.bindingcar
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener
|
||||
import com.mogo.service.statusmanager.StatusDescriptor
|
||||
|
||||
|
||||
/**
|
||||
* @brief 绑定车辆对话框
|
||||
* @author lixiaopeng
|
||||
*/
|
||||
class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver{
|
||||
|
||||
private val TAG = "ToBindingCarDialog"
|
||||
private var confirmTv: TextView? = null
|
||||
private var cancleTv: TextView? = null
|
||||
|
||||
private var mServiceApis: IMogoServiceApis? = null
|
||||
private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
setContentView(R.layout.dialog_to_bindingcar)
|
||||
setCanceledOnTouchOutside(true)
|
||||
|
||||
confirmTv = findViewById(R.id.tv_to_bindingcar_confirm)
|
||||
cancleTv = findViewById(R.id.tv_to_bindingcar_cancel)
|
||||
|
||||
confirmTv?.setOnClickListener {
|
||||
toBindingcar()
|
||||
}
|
||||
|
||||
cancleTv?.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改绑定车机 TODO
|
||||
*/
|
||||
fun toBindingcar() {
|
||||
CallerBindingcarManager.getBindingcarProvider().modifyCarInfo {
|
||||
if (it.code == 200) {
|
||||
TipToast.shortTip("绑定成功")
|
||||
} else {
|
||||
TipToast.shortTip("绑定失败")
|
||||
}
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
}
|
||||
|
||||
fun showToBindingcarDialog() {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
|
||||
show()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="840px"
|
||||
android:layout_height="470px"
|
||||
android:background="@color/dialog_bg_color"
|
||||
app:roundLayoutRadius="32px">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bindingcar_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="50px"
|
||||
android:text="@string/bindingcar_title"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="56px"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bindingcar_tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="50px"
|
||||
android:text="@string/to_binding_car"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="43px"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bindingcar_title" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_horizontal_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2px"
|
||||
android:layout_marginTop="80px"
|
||||
android:background="#66B8BFE8"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bindingcar_tips" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_vertical_line"
|
||||
android:layout_width="3px"
|
||||
android:layout_height="0dp"
|
||||
android:background="#66B8BFE8"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_horizontal_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_to_bindingcar_confirm"
|
||||
android:layout_width="400px"
|
||||
android:layout_height="100px"
|
||||
android:gravity="center"
|
||||
android:text="@string/confirm"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="46px"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/view_vertical_line"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_horizontal_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_to_bindingcar_cancel"
|
||||
android:layout_width="400px"
|
||||
android:layout_height="100px"
|
||||
android:gravity="center"
|
||||
android:text="@string/cancel"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="46px"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/view_vertical_line"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_horizontal_line" />
|
||||
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
Reference in New Issue
Block a user