[1.0.2]
[debugview 高度适配]
This commit is contained in:
yangyakun
2023-02-17 16:46:56 +08:00
parent 5f1ac507a6
commit 6b607838b7
3 changed files with 17 additions and 1 deletions

View File

@@ -265,6 +265,16 @@ internal class DebugSettingView @JvmOverloads constructor(
}
private fun initView() {
post {
val maxHeight = ScreenUtils.getScreenHeight()-BarUtils.getStatusBarHeight()
val height = clDebugContain.height
if(height>maxHeight){
val layoutParamsOther = clDebugContain.layoutParams
layoutParamsOther.height = maxHeight
clDebugContain.layoutParams = layoutParamsOther
}
}
val iconDown = ContextCompat.getDrawable(context, R.drawable.icon_down)
iconDown?.setBounds(0, 0, iconDown.minimumWidth, iconDown.minimumHeight)
val iconRight = ContextCompat.getDrawable(context, R.drawable.icon_right)

View File

@@ -12,6 +12,8 @@ import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
import com.mogo.eagle.core.utilcode.util.BarUtils
import com.mogo.eagle.core.utilcode.util.ScreenUtils
import com.mogo.eagle.core.utilcode.util.TimeUtils
import me.jessyan.autosize.utils.AutoSizeUtils
import mogo_msg.MogoReportMsg
@@ -76,13 +78,16 @@ class ToggleDebugView private constructor() : IMoGoAutopilotStatusListener {
}
})
}
val height = AutoSizeUtils.dp2px(context, 1100f)
val maxHeight = ScreenUtils.getScreenHeight() - BarUtils.getStatusBarHeight()
val currentHeight = if(height>maxHeight) maxHeight else height
mDebugSettingViewFloat = WarningFloat.with(context)
.setTag("DebugSettingView")
.setLayout(mDebugSettingView!!)
.setSidePattern(sidePattern)
.setGravity(gravity, offsetY = 70)
.setImmersionStatusBar(true)
.setWindowHeight(AutoSizeUtils.dp2px(context, 1100f))
.setWindowHeight(currentHeight)
.setWindowWidth(AutoSizeUtils.dp2px(context, 800f))
.setAnimator(object : DefaultAnimator() {
override fun enterAnim(

View File

@@ -2,6 +2,7 @@
<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:id="@+id/clDebugContain"
android:layout_width="@dimen/dp_800"
android:layout_height="@dimen/dp_1100"
android:background="#FFFFFF">