[charter]

[3.2.0]
[更换ui+debugview]
This commit is contained in:
yangyakun
2023-05-08 18:33:19 +08:00
parent 7ef091faf6
commit 0066c01e9b
14 changed files with 196 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
package com.mogo.och.bus.passenger.presenter
import com.mogo.och.bus.passenger.ui.dialogfragment.DebugViewWatchDogFragment
import com.mogo.och.bus.passenger.ui.dialogfragment.M1CarUserNoOrderFragment
class DebugWatchDogPresenter(view: DebugViewWatchDogFragment?) :
BusBasePassengerFunctionDevicePresenter<DebugViewWatchDogFragment?>(view){
companion object {
private const val TAG = "BusPassengerFunctionPresenter"
}
}

View File

@@ -12,6 +12,7 @@ import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.data.config.HdMapBuildConfig
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
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
@@ -22,6 +23,7 @@ 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
import com.mogo.och.bus.passenger.R
import com.mogo.och.bus.passenger.bean.event.DebugView
import com.mogo.och.bus.passenger.bean.event.EventLineSites
@@ -37,6 +39,7 @@ 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
@@ -73,6 +76,7 @@ class MainFragment :
}
override fun initViews() {
omvOverMap.hideResetView()
viewBusPM1MsgBoxButton.setClickListener(object : MMsgBoxButtonView.ClickListener {
override fun showMsgBoxList(show: Boolean) {
if (show) {
@@ -111,6 +115,22 @@ class MainFragment :
debug_arrive_dest.setOnClickListener {
CharterPassengerModel.arriveDest()
}
aciv_map_2_default.setOnClickListener {
omvOverMap.displayCustomOverView()
val controller = getMapUIController()
if (controller != null) {
//切换地图的远近视图
// if (controller.currentMapVisualAngle.isLongSight) {
// controller.setLockMode(true)
// controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
// } else if (controller.currentMapVisualAngle.isMediumSight) {
// controller.setLockMode(false)
// controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
// } else {
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
// }
}
}
}
private fun openSettingPage(tab: String) {

View File

@@ -0,0 +1,116 @@
package com.mogo.och.bus.passenger.ui.dialogfragment
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.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.Companion.M_BUS_P
import com.mogo.eagle.core.utilcode.util.BarUtils
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.*
/**
* @author: yangyakun
* @date: 2023/1/28
*/
class DebugViewWatchDogFragment :
MvpDialogFragment<DebugViewWatchDogFragment?, DebugWatchDogPresenter?>() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
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)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
dialog?.window?.let {
BarUtils.hideStatusBarAndSticky(it)
it.addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
dialog?.setOnShowListener { _ ->
it.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
BarUtils.hideStatusBarAndSticky(it)
}
}
}
override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
}
override fun createPresenter(): DebugWatchDogPresenter =
DebugWatchDogPresenter(this)
/**
* 重写父类show()方法
* 避免出现java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
*/
override fun show(manager: FragmentManager, tag: String?) {
try {
var cls = this.javaClass.superclass ?: return
while (true) {
if (cls.name == "java.lang.Object") {
break
}
cls = cls.superclass!!
if (cls == DialogFragment::class.java) {
break
}
}
val mDismissed = cls.getDeclaredField("mDismissed")
val mShownByMe = cls.getDeclaredField("mShownByMe")
mDismissed.isAccessible = true
mShownByMe.isAccessible = true
mDismissed.setBoolean(this, false)
mShownByMe.setBoolean(this, true)
if (isAdded) { //解决方法就是添加这行代码如果已经添加了就移除掉然后再show就不会出现Fragment already added的错误了。
return
}
val ft: FragmentTransaction = manager.beginTransaction()
ft.add(this, tag)
ft.commitAllowingStateLoss()
} catch (e: Exception) {
Log.e("DialogFragment", "show", e.fillInStackTrace())
}
}
override fun onViewStateRestored(savedInstanceState: Bundle?) {
CallerLogger.d(M_BUS_P+ TAG, "onViewStateRestored")
super.onViewStateRestored(savedInstanceState)
}
companion object {
const val TAG = "BusPassengerFunctionFragment"
@JvmStatic
fun newInstance(): DebugViewWatchDogFragment {
val args = Bundle()
val fragment = DebugViewWatchDogFragment()
fragment.arguments = args
return fragment
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@@ -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_e0efff"/>
</shape>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bus_p_m1_80000000"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/aciv_debugview_head"
android:src="@drawable/charter_p_debug_view_password"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginTop="@dimen/dp_305"
android:layout_width="@dimen/dp_721"
android:layout_height="@dimen/dp_124"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_580"
android:layout_height="@dimen/dp_311"
app:layout_constraintTop_toBottomOf="@+id/aciv_debugview_head"
app:layout_constraintEnd_toEndOf="@+id/aciv_debugview_head"
android:background="@drawable/charter_p_debugview_bg"
android:layout_marginTop="@dimen/dp_40"
android:clickable="true">
<!-- 结束包车 后展示的界面 根据车辆状态来显示 -->
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -31,6 +31,14 @@
android:layout_width="0dp"
android:layout_height="match_parent"/>
<androidx.appcompat.widget.AppCompatImageView
app:layout_constraintEnd_toEndOf="parent"
android:id="@+id/aciv_map_2_default"
android:src="@drawable/bus_p_overmap_reset"
app:layout_constraintBottom_toTopOf="@+id/bb_boorombar"
android:layout_width="@dimen/dp_148"
android:layout_height="@dimen/dp_150"/>
<TextView
android:text="到站"
android:id="@+id/debug_arrive_dest"

View File

@@ -32,9 +32,11 @@
<color name="bus_p_m1_5F7096">#5F7096</color>
<color name="bus_p_m1_9aabd2">#9AABD2</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>
<color name="bus_p_m1_332C2D31">#332C2D31</color>
<color name="bus_p_m1_80000000">#80000000</color>
<color name="bus_p_m1_80288dfc">#80288DFC</color>
<color name="bus_p_m1_3060ABFE">#3060ABFE</color>
<color name="bus_p_m1_0060ABFE">#0060ABFE</color>