Merge remote-tracking branch 'origin/dev_minibus-d_230425_3.2.0' into dev_minibus-d_230425_3.2.0
This commit is contained in:
@@ -5,8 +5,6 @@ import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.amap.api.maps.model.LatLng
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
@@ -17,10 +15,7 @@ import com.mogo.eagle.core.function.hmi.ui.msgbox.MMsgBoxButtonView
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
|
||||
import com.mogo.eagle.core.function.view.SiteMarkerBean
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
|
||||
import com.mogo.eagle.core.utilcode.util.AppStateManager
|
||||
import com.mogo.eagle.core.utilcode.util.ClickUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
@@ -29,17 +24,16 @@ import com.mogo.och.bus.passenger.bean.event.DebugView
|
||||
import com.mogo.och.bus.passenger.bean.event.EventLineSites
|
||||
import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerPresenter
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.DebugViewWatchDogFragment
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.M1CarUserNoOrderFragment
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.M1ContainFragment
|
||||
import com.mogo.och.bus.passenger.view.statusbar.StatusBarView
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager
|
||||
import com.mogo.och.common.module.voice.VoiceManager
|
||||
import kotlinx.android.synthetic.main.m1_main_fragment.*
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
import java.lang.ref.WeakReference
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
@@ -49,6 +43,7 @@ class MainFragment :
|
||||
MvpFragment<MainFragment?, BusPassengerPresenter?>() {
|
||||
|
||||
private var bpFunctionGroupDialogFragment: WeakReference<M1ContainFragment>? = null
|
||||
private var debugViewWatchDogFragment: WeakReference<DebugViewWatchDogFragment>? = null
|
||||
private var m1CarUserNoOrderFragment: WeakReference<M1CarUserNoOrderFragment>? = null
|
||||
|
||||
private val endStation =
|
||||
@@ -134,42 +129,19 @@ class MainFragment :
|
||||
}
|
||||
|
||||
private fun openSettingPage(tab: String) {
|
||||
val fragmentByTag: Fragment? = childFragmentManager.findFragmentByTag(M1ContainFragment.TAG)
|
||||
if (fragmentByTag is DialogFragment) {
|
||||
if (fragmentByTag.dialog != null && fragmentByTag.dialog!!.isShowing) {
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "正在展示")
|
||||
return
|
||||
}
|
||||
if (fragmentByTag.dialog != null && fragmentByTag.isAdded) {
|
||||
if (AppStateManager.currentActivity() == null) { // 没有在当前应用内 在启动页面关闭应用
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "权限验证")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bpFunctionGroupDialogFragment?.get() == null) {
|
||||
bpFunctionGroupDialogFragment = WeakReference(M1ContainFragment.newInstance())
|
||||
}
|
||||
val bpFunctionGroup = bpFunctionGroupDialogFragment?.get()
|
||||
bpFunctionGroup?.arguments?.putString(M1ContainFragment.SELECTTAB, tab)
|
||||
if (bpFunctionGroup != null) {
|
||||
if (bpFunctionGroup.dialog != null && bpFunctionGroup.dialog!!.isShowing) {
|
||||
return
|
||||
}
|
||||
if (bpFunctionGroup.isAdded) { //解决方法就是添加这行代码,如果已经添加了,就移除掉然后再show,就不会出现Fragment already added的错误了。
|
||||
parentFragmentManager.beginTransaction().remove(bpFunctionGroup)
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
if (ClickUtils.isFastClick()) {
|
||||
bpFunctionGroup.show(parentFragmentManager, TAG)
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "展示$tab")
|
||||
} else {
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_BUS_P + TAG, "dialog 1s内执行一次"
|
||||
)
|
||||
}
|
||||
M1ContainFragment.openSettingPage(childFragmentManager,parentFragmentManager,bpFunctionGroup,tab)
|
||||
}
|
||||
|
||||
private fun showDebugView() {
|
||||
if (debugViewWatchDogFragment?.get() == null) {
|
||||
debugViewWatchDogFragment = WeakReference(DebugViewWatchDogFragment.newInstance())
|
||||
}
|
||||
val debugViewFragment = debugViewWatchDogFragment?.get()
|
||||
DebugViewWatchDogFragment.showDebugView(childFragmentManager,parentFragmentManager,debugViewFragment)
|
||||
}
|
||||
|
||||
|
||||
@@ -245,42 +217,11 @@ class MainFragment :
|
||||
fun showOpenAndCloseDoor() {
|
||||
val bpFunctionGroup = bpFunctionGroupDialogFragment?.get()
|
||||
bpFunctionGroup?.dismissAllowingStateLoss()
|
||||
val fragmentByTag: Fragment? = childFragmentManager.findFragmentByTag(M1ContainFragment.TAG)
|
||||
if (fragmentByTag is DialogFragment) {
|
||||
if (fragmentByTag.dialog != null && fragmentByTag.dialog!!.isShowing) {
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "正在展示")
|
||||
return
|
||||
}
|
||||
if (fragmentByTag.dialog != null && fragmentByTag.isAdded) {
|
||||
if (AppStateManager.currentActivity() == null) { // 没有在当前应用内 在启动页面关闭应用
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "权限验证")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m1CarUserNoOrderFragment?.get() == null) {
|
||||
m1CarUserNoOrderFragment = WeakReference(M1CarUserNoOrderFragment.newInstance())
|
||||
}
|
||||
val m1CarUserNoOrderFragment = m1CarUserNoOrderFragment?.get()
|
||||
if (m1CarUserNoOrderFragment != null) {
|
||||
if (m1CarUserNoOrderFragment.dialog != null && m1CarUserNoOrderFragment.dialog!!.isShowing) {
|
||||
return
|
||||
}
|
||||
if (m1CarUserNoOrderFragment.isAdded) { //解决方法就是添加这行代码,如果已经添加了,就移除掉然后再show,就不会出现Fragment already added的错误了。
|
||||
parentFragmentManager.beginTransaction().remove(m1CarUserNoOrderFragment)
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
if (ClickUtils.isFastClick()) {
|
||||
m1CarUserNoOrderFragment.show(parentFragmentManager, TAG)
|
||||
VoiceManager.endOrder()
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + TAG, "展示开关门")
|
||||
} else {
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_BUS_P + TAG, "dialog 1s内执行一次"
|
||||
)
|
||||
}
|
||||
}
|
||||
M1CarUserNoOrderFragment.showOpenAndCloseDoor(childFragmentManager,parentFragmentManager,m1CarUserNoOrderFragment)
|
||||
}
|
||||
fun closeOpenAndCloseDoor(){
|
||||
val bpFunctionGroup = m1CarUserNoOrderFragment?.get()
|
||||
@@ -324,7 +265,11 @@ class MainFragment :
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
ToggleDebugView.toggleDebugView.toggle(requireContext())
|
||||
if (ToggleDebugView.toggleDebugView.isShowIng()) {
|
||||
ToggleDebugView.toggleDebugView.dismiss()
|
||||
}else {
|
||||
showDebugView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
package com.mogo.och.bus.passenger.ui.dialogfragment
|
||||
|
||||
import android.content.DialogInterface
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.fragment.app.FragmentTransaction
|
||||
import com.mogo.commons.mvp.MvpDialogFragment
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
|
||||
import com.mogo.eagle.core.utilcode.util.AppStateManager
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ClickUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerCarUseAndNoOrderPresenter
|
||||
import com.mogo.och.bus.passenger.presenter.DebugWatchDogPresenter
|
||||
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorManager
|
||||
import kotlinx.android.synthetic.main.m1_order_end.*
|
||||
import com.mogo.och.bus.passenger.ui.MainFragment
|
||||
import kotlinx.android.synthetic.main.m1_debugview_pass.*
|
||||
|
||||
/**
|
||||
* @author: yangyakun
|
||||
@@ -31,19 +35,34 @@ class DebugViewWatchDogFragment :
|
||||
setStyle(STYLE_NO_TITLE, R.style.DialogFullScreen) //dialog全屏
|
||||
}
|
||||
|
||||
private fun initFragment() {
|
||||
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.m1_debugview_pass
|
||||
|
||||
override fun getTagName(): String = TAG
|
||||
|
||||
override fun initViews() {
|
||||
dialog?.setCancelable(false)
|
||||
|
||||
actv_password_submit.setOnClickListener {
|
||||
val text = acet_close.text
|
||||
if(text==null||text.isEmpty()){
|
||||
ToastUtils.showShort("请输入密码")
|
||||
}else{
|
||||
if(text.toString() == "123987"){
|
||||
dismissAllowingStateLoss()
|
||||
ToggleDebugView.toggleDebugView.toggle(requireContext())
|
||||
}else{
|
||||
ToastUtils.showShort("请输入正确密码")
|
||||
}
|
||||
}
|
||||
}
|
||||
actv_cancle.setOnClickListener {
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDismiss(dialog: DialogInterface) {
|
||||
super.onDismiss(dialog)
|
||||
acet_close.text?.clear()
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
@@ -111,6 +130,41 @@ class DebugViewWatchDogFragment :
|
||||
fragment.arguments = args
|
||||
return fragment
|
||||
}
|
||||
fun showDebugView(
|
||||
childFragmentManager: FragmentManager,
|
||||
parentFragmentManager: FragmentManager,
|
||||
debugViewWatchDogFragment: DebugViewWatchDogFragment?
|
||||
) {
|
||||
|
||||
val fragmentByTag: Fragment? = childFragmentManager.findFragmentByTag(M1ContainFragment.TAG)
|
||||
if (fragmentByTag is DialogFragment) {
|
||||
if (fragmentByTag.dialog != null && fragmentByTag.dialog!!.isShowing) {
|
||||
CallerLogger.d(M_BUS_P + MainFragment.TAG, "正在展示")
|
||||
return
|
||||
}
|
||||
if (fragmentByTag.dialog != null && fragmentByTag.isAdded) {
|
||||
if (AppStateManager.currentActivity() == null) { // 没有在当前应用内 在启动页面关闭应用
|
||||
CallerLogger.d(M_BUS_P + MainFragment.TAG, "权限验证")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
if (debugViewWatchDogFragment != null) {
|
||||
if (debugViewWatchDogFragment.dialog != null && debugViewWatchDogFragment.dialog!!.isShowing) {
|
||||
return
|
||||
}
|
||||
if (debugViewWatchDogFragment.isAdded) { //解决方法就是添加这行代码,如果已经添加了,就移除掉然后再show,就不会出现Fragment already added的错误了。
|
||||
parentFragmentManager.beginTransaction().remove(debugViewWatchDogFragment)
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
if (ClickUtils.isFastClick()) {
|
||||
debugViewWatchDogFragment.show(parentFragmentManager, MainFragment.TAG)
|
||||
CallerLogger.d(M_BUS_P + MainFragment.TAG, "展示开关门")
|
||||
} else {
|
||||
CallerLogger.d(M_BUS_P + MainFragment.TAG, "dialog 1s内执行一次")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,16 +5,22 @@ import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.fragment.app.FragmentTransaction
|
||||
import com.mogo.commons.mvp.MvpDialogFragment
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
|
||||
import com.mogo.eagle.core.utilcode.util.AppStateManager
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ClickUtils
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerCarUseAndNoOrderPresenter
|
||||
import com.mogo.och.bus.passenger.ui.MainFragment
|
||||
import com.mogo.och.common.module.manager.devicemanage.LightAirconditionDoorManager
|
||||
import com.mogo.och.common.module.voice.VoiceManager
|
||||
import kotlinx.android.synthetic.main.m1_order_end.*
|
||||
|
||||
/**
|
||||
@@ -115,6 +121,44 @@ class M1CarUserNoOrderFragment :
|
||||
fragment.arguments = args
|
||||
return fragment
|
||||
}
|
||||
|
||||
|
||||
fun showOpenAndCloseDoor(
|
||||
childFragmentManager: FragmentManager,
|
||||
parentFragmentManager: FragmentManager,
|
||||
m1CarUserNoOrderFragment: M1CarUserNoOrderFragment?
|
||||
) {
|
||||
|
||||
val fragmentByTag: Fragment? = childFragmentManager.findFragmentByTag(M1ContainFragment.TAG)
|
||||
if (fragmentByTag is DialogFragment) {
|
||||
if (fragmentByTag.dialog != null && fragmentByTag.dialog!!.isShowing) {
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + MainFragment.TAG, "正在展示")
|
||||
return
|
||||
}
|
||||
if (fragmentByTag.dialog != null && fragmentByTag.isAdded) {
|
||||
if (AppStateManager.currentActivity() == null) { // 没有在当前应用内 在启动页面关闭应用
|
||||
CallerLogger.d(SceneConstant.M_BUS_P + MainFragment.TAG, "权限验证")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
if (m1CarUserNoOrderFragment != null) {
|
||||
if (m1CarUserNoOrderFragment.dialog != null && m1CarUserNoOrderFragment.dialog!!.isShowing) {
|
||||
return
|
||||
}
|
||||
if (m1CarUserNoOrderFragment.isAdded) { //解决方法就是添加这行代码,如果已经添加了,就移除掉然后再show,就不会出现Fragment already added的错误了。
|
||||
parentFragmentManager.beginTransaction().remove(m1CarUserNoOrderFragment)
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
if (ClickUtils.isFastClick()) {
|
||||
m1CarUserNoOrderFragment.show(parentFragmentManager, MainFragment.TAG)
|
||||
VoiceManager.endOrder()
|
||||
CallerLogger.d(M_BUS_P + MainFragment.TAG, "展示开关门")
|
||||
} else {
|
||||
CallerLogger.d(M_BUS_P + MainFragment.TAG, "dialog 1s内执行一次")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,12 +12,11 @@ import androidx.fragment.app.FragmentTransaction
|
||||
import com.mogo.commons.mvp.MvpDialogFragment
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS_P
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.utilcode.util.SharedPrefs
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.bean.event.EventLineSites
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerFunctionPresenter
|
||||
import com.mogo.och.bus.passenger.ui.MainFragment
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.fragment.M1OrderLineFragment
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.fragment.M1SoftFragment
|
||||
import com.mogo.och.bus.passenger.ui.dialogfragment.fragment.M1VideoFragment
|
||||
@@ -257,6 +256,45 @@ class M1ContainFragment :
|
||||
fragment.arguments = args
|
||||
return fragment
|
||||
}
|
||||
|
||||
|
||||
fun openSettingPage(
|
||||
childFragmentManager: FragmentManager,
|
||||
parentFragmentManager: FragmentManager,
|
||||
bpFunctionGroup: M1ContainFragment?,
|
||||
tab: String
|
||||
) {
|
||||
val fragmentByTag: Fragment? = childFragmentManager.findFragmentByTag(M1ContainFragment.TAG)
|
||||
if (fragmentByTag is DialogFragment) {
|
||||
if (fragmentByTag.dialog != null && fragmentByTag.dialog!!.isShowing) {
|
||||
CallerLogger.d(M_BUS_P + MainFragment.TAG, "正在展示")
|
||||
return
|
||||
}
|
||||
if (fragmentByTag.dialog != null && fragmentByTag.isAdded) {
|
||||
if (AppStateManager.currentActivity() == null) { // 没有在当前应用内 在启动页面关闭应用
|
||||
CallerLogger.d(M_BUS_P + MainFragment.TAG, "权限验证")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
bpFunctionGroup?.arguments?.putString(SELECTTAB, tab)
|
||||
if (bpFunctionGroup != null) {
|
||||
if (bpFunctionGroup.dialog != null && bpFunctionGroup.dialog!!.isShowing) {
|
||||
return
|
||||
}
|
||||
if (bpFunctionGroup.isAdded) {
|
||||
//解决方法就是添加这行代码,如果已经添加了,就移除掉然后再show,就不会出现Fragment already added的错误了。
|
||||
parentFragmentManager.beginTransaction().remove(bpFunctionGroup)
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
if (ClickUtils.isFastClick()) {
|
||||
bpFunctionGroup.show(parentFragmentManager, MainFragment.TAG)
|
||||
CallerLogger.d(M_BUS_P + MainFragment.TAG, "展示$tab")
|
||||
} else {
|
||||
CallerLogger.d(M_BUS_P + MainFragment.TAG, "dialog 1s内执行一次")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface ContainDismiss{
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_16"/>
|
||||
<solid android:color="@color/bus_p_m1_b8c2d7"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_22"/>
|
||||
<solid android:color="@color/bus_p_m1_b8c2d8"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_16"/>
|
||||
<solid android:color="@color/bus_p_m1_1466FB"/>
|
||||
</shape>
|
||||
@@ -27,5 +27,46 @@
|
||||
android:clickable="true">
|
||||
<!-- 结束包车 后展示的界面 根据车辆状态来显示 -->
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/acet_close"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:inputType="numberPassword"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textColor="@android:color/white"
|
||||
android:background="@drawable/charter_p_debugview_edit_bg"
|
||||
android:layout_marginTop="@dimen/dp_54"
|
||||
android:layout_width="@dimen/dp_424"
|
||||
android:layout_height="@dimen/dp_84"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_cancle"
|
||||
android:text="关闭"
|
||||
app:layout_constraintTop_toBottomOf="@+id/acet_close"
|
||||
app:layout_constraintStart_toStartOf="@+id/acet_close"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_marginTop="@dimen/dp_51"
|
||||
android:background="@drawable/charter_p_debugview_cancle"
|
||||
android:layout_width="@dimen/dp_180"
|
||||
android:layout_height="@dimen/dp_68"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_password_submit"
|
||||
android:text="确认"
|
||||
app:layout_constraintTop_toBottomOf="@+id/acet_close"
|
||||
app:layout_constraintEnd_toEndOf="@+id/acet_close"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_51"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textColor="@android:color/white"
|
||||
android:background="@drawable/charter_p_debugview_submit"
|
||||
android:layout_width="@dimen/dp_180"
|
||||
android:layout_height="@dimen/dp_68"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -31,6 +31,8 @@
|
||||
<color name="bus_p_m1_090f28">#090F28</color>
|
||||
<color name="bus_p_m1_5F7096">#5F7096</color>
|
||||
<color name="bus_p_m1_9aabd2">#9AABD2</color>
|
||||
<color name="bus_p_m1_b8c2d7">#B8C2D7</color>
|
||||
<color name="bus_p_m1_b8c2d8">#B8C2D8</color>
|
||||
<color name="bus_p_m1_d7e5f5">#D7E5F5</color>
|
||||
<color name="bus_p_m1_e0efff">#E0EFFF</color>
|
||||
<color name="bus_p_m1_662C2D31">#662C2D31</color>
|
||||
|
||||
@@ -185,6 +185,50 @@ class DispatchAutoPilotManager private constructor() :
|
||||
)
|
||||
}
|
||||
}
|
||||
if(it.trajUrl == null){
|
||||
ToastUtils.showShort("trajUrl数据为空")
|
||||
return
|
||||
}
|
||||
if(it.trajMd5 == null){
|
||||
ToastUtils.showShort("trajMd5数据为空")
|
||||
return
|
||||
}
|
||||
if(it.stopUrl == null){
|
||||
ToastUtils.showShort("stopUrl数据为空")
|
||||
return
|
||||
}
|
||||
if(it.stopMd5 == null){
|
||||
ToastUtils.showShort("stopMd5数据为空")
|
||||
return
|
||||
}
|
||||
if(it.vehicleModel == null){
|
||||
ToastUtils.showShort("vehicleModel数据为空")
|
||||
return
|
||||
}
|
||||
if(it.trajUrl_dpqp == null){
|
||||
ToastUtils.showShort("trajUrl_dpqp数据为空")
|
||||
return
|
||||
}
|
||||
if(it.trajMd5_dpqp == null){
|
||||
ToastUtils.showShort("trajMd5_dpqp数据为空")
|
||||
return
|
||||
}
|
||||
if(it.stopUrl_dpqp == null){
|
||||
ToastUtils.showShort("stopUrl_dpqp数据为空")
|
||||
return
|
||||
}
|
||||
if(it.lineName == null){
|
||||
ToastUtils.showShort("lineName数据为空")
|
||||
return
|
||||
}
|
||||
if(it.startLocAddress == null){
|
||||
ToastUtils.showShort("startLocAddress数据为空")
|
||||
return
|
||||
}
|
||||
if(it.endLocAddress == null){
|
||||
ToastUtils.showShort("endLocAddress数据为空")
|
||||
return
|
||||
}
|
||||
val currentAutoPilotLine = AutopilotControlParameters.AutoPilotLine(it.lineId.toLong(),it.trajUrl,it.trajMd5,
|
||||
it.stopUrl,it.stopMd5,it.timestamp,it.vehicleModel,it.trajUrl_dpqp,it.trajMd5_dpqp,it.stopUrl_dpqp,
|
||||
it.stopMd5_dpqp,it.timestamp_dpqp)
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
|
||||
<application>
|
||||
|
||||
@@ -69,8 +70,6 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
<category android:name="android.intent.category.LAUNCHER_APP" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<!--调试用,暂时开启LAUNCHER这个属性-->
|
||||
<category android:name="android.intent.category.HOME" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<data
|
||||
@@ -180,5 +179,14 @@
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name="com.mogo.eagle.core.function.hmi.receiver.BootCompleteReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="true">
|
||||
<intent-filter android:priority="1000">
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.mogo.eagle.core.function.hmi.receiver
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
|
||||
/**
|
||||
* 开机启动广播
|
||||
*/
|
||||
class BootCompleteReceiver : BroadcastReceiver() {
|
||||
val TAG = "BootCompleteReceiver"
|
||||
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
if (Intent.ACTION_BOOT_COMPLETED == intent.action) {
|
||||
Log.d(TAG, "ACTION_BOOT_COMPLETED")
|
||||
val packageName = AppUtils.getAppPackageName()
|
||||
AppUtils.launchApp(packageName)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,9 @@ import com.mogo.eagle.core.function.msgbox.MsgBoxConfig
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import kotlinx.android.synthetic.main.layout_m_msg_box_bubble.view.*
|
||||
|
||||
/**
|
||||
* M1消息盒子气泡态
|
||||
*/
|
||||
class MMsgBoxBubbleView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
|
||||
@@ -11,6 +11,9 @@ import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import kotlinx.android.synthetic.main.view_m1_msg_box_button.view.*
|
||||
|
||||
/**
|
||||
* M1消息盒子切换按钮
|
||||
*/
|
||||
class MMsgBoxButtonView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
|
||||
@@ -13,20 +13,26 @@ import com.mogo.eagle.core.data.msgbox.MsgCategory
|
||||
import com.mogo.eagle.core.data.msgbox.OperationMsg
|
||||
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxEventListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener
|
||||
import com.mogo.eagle.core.function.api.order.IOrderListener
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.order.CallerOrderListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.MMsgBoxListAdapter
|
||||
import com.mogo.eagle.core.utilcode.util.ResourceUtils.getDrawable
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import kotlinx.android.synthetic.main.layout_m_msg_box_list.view.*
|
||||
|
||||
/**
|
||||
* M1消息盒子列表
|
||||
*/
|
||||
class MMsgBoxListView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener, IMsgBoxEventListener {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener, IMsgBoxEventListener,
|
||||
IOrderListener {
|
||||
|
||||
private val TAG = "MMsgBoxListView"
|
||||
var mMsgBoxListAdapter: MMsgBoxListAdapter?= null
|
||||
@@ -73,12 +79,14 @@ class MMsgBoxListView @JvmOverloads constructor(
|
||||
super.onAttachedToWindow()
|
||||
CallerMsgBoxListenerManager.addListener(TAG,this)
|
||||
CallerMsgBoxEventListenerManager.addListener(TAG,this)
|
||||
CallerOrderListenerManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerMsgBoxListenerManager.removeListener(TAG)
|
||||
CallerMsgBoxEventListenerManager.removeListener(TAG)
|
||||
CallerOrderListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onSummaryClickEvent() {
|
||||
@@ -103,4 +111,13 @@ class MMsgBoxListView @JvmOverloads constructor(
|
||||
|
||||
}
|
||||
|
||||
override fun onOrderRemoval() {
|
||||
//清除历史消息,并刷新列表
|
||||
CallerMsgBoxManager.delMsgTable(context)
|
||||
noticeList?.let {
|
||||
it.clear()
|
||||
mMsgBoxListAdapter?.setData(it)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -28,6 +28,10 @@ class ToggleDebugView private constructor() : IMoGoAutopilotStatusListener {
|
||||
private var mDebugSettingViewFloat: WarningFloat.Builder? = null
|
||||
private var mDebugSettingView: DebugSettingView? = null
|
||||
|
||||
fun isShowIng():Boolean{
|
||||
return mDebugSettingViewFloat != null
|
||||
}
|
||||
|
||||
/**
|
||||
* 开关DebugView
|
||||
*/
|
||||
@@ -85,7 +89,7 @@ class ToggleDebugView private constructor() : IMoGoAutopilotStatusListener {
|
||||
}
|
||||
}
|
||||
|
||||
private fun dismiss() {
|
||||
fun dismiss() {
|
||||
mDebugSettingViewFloat?.let {
|
||||
WarningFloat.dismiss(it.config.floatTag, false)
|
||||
mDebugSettingViewFloat = null
|
||||
|
||||
@@ -27,8 +27,7 @@ import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.MultiDisplayUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.rousetime.android_startup.model.CostTimesModel;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
import com.zhjt.service.chain.TracingConstants;
|
||||
@@ -49,6 +48,8 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
private final static Handler handlerV2XEvent = new Handler();
|
||||
private static Runnable runnableV2XEvent;
|
||||
|
||||
private static long lastKeyDownTimeMillis;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -59,7 +60,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
ActivityUtils.setDefaultL(this);
|
||||
//ActivityUtils.setDefaultL(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -185,6 +186,17 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
if (currentTimeMillis - lastKeyDownTimeMillis < 2000) {
|
||||
finish();
|
||||
System.exit(0);
|
||||
} else {
|
||||
ToastUtils.showLong(R.string.hint_exit_app_again);
|
||||
lastKeyDownTimeMillis = System.currentTimeMillis();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,4 +79,5 @@
|
||||
<string name="location_try_again">请检查定位是否正常</string>
|
||||
<string name="ok_tip">确定</string>
|
||||
<string name="retry">重试</string>
|
||||
<string name="hint_exit_app_again">再按一次退出应用</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.api.order
|
||||
package com.mogo.eagle.core.function.api.order
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
@@ -11,5 +11,10 @@ interface IOrderListener {
|
||||
* 通知订单状态
|
||||
* @param inOrder true:开始订单;false:订单结束
|
||||
*/
|
||||
fun onUpdateOrderStatus(inOrder: Boolean)
|
||||
fun onUpdateOrderStatus(inOrder: Boolean){}
|
||||
|
||||
/**
|
||||
* 订单核销
|
||||
*/
|
||||
fun onOrderRemoval(){}
|
||||
}
|
||||
@@ -18,4 +18,12 @@ object CallerOrderListenerManager: CallerBase<IOrderListener>() {
|
||||
}
|
||||
}
|
||||
|
||||
fun invokeOrderRemoval(){
|
||||
M_LISTENERS.forEach{
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onOrderRemoval()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user