修复弹出监控Dialog没有被销毁的bug

Signed-off-by: 董宏宇 <martindhy@gmail.com>
This commit is contained in:
董宏宇
2021-10-20 16:41:17 +08:00
parent a8d8e19f67
commit 0e90cee85d
6 changed files with 90 additions and 208 deletions

View File

@@ -43,20 +43,23 @@ class SpeedPanelView @JvmOverloads constructor(
var mContext: Context
var mSpeedChartView: SpeedChartView
var mDebugSettingViewFloat: WarningFloat.Builder? = null
var mDebugSettingView: DebugSettingView? = null
init {
setOnLongClickListener {
Log.d(TAG, "长按显示状态工具栏")
context.let {
val debugSettingView = DebugSettingView(it)
if (mDebugSettingViewFloat != null) {
WarningFloat.dismiss(mDebugSettingViewFloat!!.config.floatTag, false)
mDebugSettingViewFloat = null
mDebugSettingView = null
} else {
if (mDebugSettingView == null) {
mDebugSettingView = DebugSettingView(it)
}
mDebugSettingViewFloat = WarningFloat.with(it)
.setTag("DebugSettingView")
.setLayout(debugSettingView)
.setLayout(mDebugSettingView!!)
.setSidePattern(SidePattern.RIGHT)
.setGravity(Gravity.RIGHT, offsetY = 70)
.setImmersionStatusBar(true)

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/dp_1300"
android:layout_width="@dimen/dp_900"
android:layout_height="match_parent"
android:background="#FFFFFF">
@@ -32,7 +32,7 @@
android:id="@+id/rgGpsProvider"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:orientation="vertical">
<RadioButton
android:id="@+id/rbGpsProviderAndroid"
@@ -67,7 +67,7 @@
android:id="@+id/rgIsDrawIdentifyData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:orientation="vertical">
<RadioButton
android:id="@+id/rbDraw"