@@ -21,6 +21,7 @@ import com.mogo.utils.logger.Logger
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 2021/8/5 5:29 下午
|
||||
* 弹窗Window 管理
|
||||
*/
|
||||
internal class WarningFloatWindowHelper(
|
||||
val context: Context,
|
||||
@@ -62,8 +63,8 @@ internal class WarningFloatWindowHelper(
|
||||
// 设置浮窗以外的触摸事件可以传递给后面的窗口、不自动获取焦点
|
||||
flags = if (config.immersionStatusBar)
|
||||
// 没有边界限制,允许窗口扩展到屏幕外
|
||||
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL or WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
|
||||
else WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL or WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL or WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
|
||||
else WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
|
||||
width = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
height = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
|
||||
@@ -142,7 +143,7 @@ internal class WarningFloatWindowHelper(
|
||||
.enterAnim()?.apply {
|
||||
// 可以延伸到屏幕外,动画结束按需去除该属性,不然旋转屏幕可能置于屏幕外部
|
||||
params.flags =
|
||||
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL or WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
|
||||
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL or WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
|
||||
|
||||
addListener(object : Animator.AnimatorListener {
|
||||
override fun onAnimationRepeat(animation: Animator?) {}
|
||||
@@ -152,7 +153,7 @@ internal class WarningFloatWindowHelper(
|
||||
if (!config.immersionStatusBar) {
|
||||
// 不需要延伸到屏幕外了,防止屏幕旋转的时候,浮窗处于屏幕外
|
||||
params.flags =
|
||||
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL or WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +188,7 @@ internal class WarningFloatWindowHelper(
|
||||
if (config.isAnim) return
|
||||
config.isAnim = true
|
||||
params.flags =
|
||||
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL or WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
|
||||
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL or WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
|
||||
animator.addListener(object : Animator.AnimatorListener {
|
||||
override fun onAnimationRepeat(animation: Animator?) {}
|
||||
|
||||
|
||||
@@ -3,16 +3,17 @@ package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.constants.MoGoOBUConfig
|
||||
import com.mogo.eagle.core.data.obu.ObuStatusInfo
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.call.obu.CallerOBUManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.KeyboardUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.utils.storage.SharedPrefsMgr
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -46,16 +47,20 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
private fun initView() {
|
||||
tvObuInfo.text = CallerObuListenerManager.getObuStatusInfo()
|
||||
etObuIP.setOnClickListener {
|
||||
//获取焦点
|
||||
etObuIP.isFocusable = true;
|
||||
etObuIP.isFocusableInTouchMode = true;
|
||||
etObuIP.requestFocus();
|
||||
btnSetObuIP.setOnClickListener {
|
||||
val obuIP = etObuIP.text.toString()
|
||||
if (obuIP.isNotEmpty()) {
|
||||
CallerOBUManager.resetObuIpAddress(obuIP)
|
||||
} else {
|
||||
ToastUtils.showShort("请输入正确的IP地址")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onObuStatusResponse(obuStatusInfo: ObuStatusInfo) {
|
||||
tvObuInfo.text = GsonUtils.toJson(obuStatusInfo)
|
||||
etObuIP.setText(obuStatusInfo.connectIP)
|
||||
etObuIP.text?.let { etObuIP.setSelection(it.length) }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -25,7 +25,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<EditText
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/etObuIP"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -37,6 +37,7 @@
|
||||
android:textSize="@dimen/dp_34" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSetObuIP"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
|
||||
Reference in New Issue
Block a user