[FeedBack]反馈代码提交

[feedback]优化ui
This commit is contained in:
renwj
2022-03-17 14:58:59 +08:00
parent 11c6f2cf2b
commit 639950ccc5
50 changed files with 1334 additions and 149 deletions

View File

@@ -169,6 +169,10 @@ class WarningFloat {
this.config.isEnqueue = enqueue
}
fun softInputMode(mode: Int) = apply {
this.config.softInputMode = mode
}
/**
* 创建浮窗包括Activity浮窗和系统浮窗如若系统浮窗无权限先进行权限申请
*/

View File

@@ -56,6 +56,7 @@ internal class WarningFloatWindowHelper(
// 获取 WindowManager
windowManager = context.getSystemService(Service.WINDOW_SERVICE) as WindowManager
params = WindowManager.LayoutParams().apply {
// 设置窗口类型为应用子窗口和PopupWindow同类型
type = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL
format = PixelFormat.RGBA_8888
@@ -73,6 +74,10 @@ internal class WarningFloatWindowHelper(
x = config.locationPair.first
y = config.locationPair.second
}
//添加软键盘展示模式
if (config.softInputMode != 0) {
softInputMode = config.softInputMode
}
}
}
@@ -89,6 +94,7 @@ internal class WarningFloatWindowHelper(
// 为了避免创建的时候闪一下我们先隐藏视图不能直接设置GONE否则定位会出现问题
floatingView.visibility = View.INVISIBLE
// 将frameLayout添加到系统windowManager中
windowManager.addView(frameLayout, params)
// 在浮窗绘制完成的时候,设置初始坐标、执行入场动画

View File

@@ -19,6 +19,9 @@ data class WarningNotificationConfig(
var layoutId: Int? = null,
var layoutView: View? = null,
// 软键盘模式
var softInputMode: Int = 0,
// 当前浮窗的tag
var floatTag: String? = null,
// 是否正在执行动画

View File

@@ -6,6 +6,7 @@ import android.text.TextUtils
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import android.view.WindowManager.LayoutParams
import android.view.animation.OvershootInterpolator
import androidx.lifecycle.lifecycleScope
import com.alibaba.android.arouter.facade.annotation.Route
@@ -80,8 +81,6 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
private var toolsView: AutoPilotAndCheckView? = null
private var autoPilotToolsFloat: WarningFloat.Builder? = null
// 检测、自动驾驶速度设置
private var toolsViewFloat: WarningFloat.Builder? = null
@@ -223,6 +222,11 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
override fun showDebugPanelView() {
toggleDebugView()
}
override fun showFeedbackView() {
dismissToolsFloatView()
CallerDevaToolsManager.showFeedbackView(it)
}
})
}
toolsViewFloat = WarningFloat.with(it)
@@ -874,7 +878,8 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
}
override fun showBadCaseFloat(tag: String, floatView: View): () -> Unit {
override fun showFloatWindow(tag: String, floatView: View, attrs: LayoutParams?): () -> Unit {
var floatWindow: WarningFloat.Builder?
WarningFloat.with(context ?: Utils.getApp())
.setTag(tag)
.setLayout(floatView)
@@ -884,7 +889,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
.setAnimator(object : DefaultAnimator() {
override fun enterAnim(
view: View,
params: WindowManager.LayoutParams,
params: LayoutParams,
windowManager: WindowManager,
sidePattern: SidePattern
): Animator? =
@@ -895,7 +900,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
override fun exitAnim(
view: View,
params: WindowManager.LayoutParams,
params: LayoutParams,
windowManager: WindowManager,
sidePattern: SidePattern
): Animator? =
@@ -904,17 +909,20 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
})
.addWarningStatusListener(object : IMoGoWarningStatusListener {
override fun onDismiss() {
autoPilotToolsFloat = null
floatWindow = null
}
})
.also {
autoPilotToolsFloat = it
floatWindow = it
if (((attrs?.softInputMode?: 0) and LayoutParams.SOFT_INPUT_MASK_ADJUST) != 0) {
it.softInputMode(attrs!!.softInputMode)
}
}
.show()
return {
autoPilotToolsFloat?.let {
floatWindow?.let {
WarningFloat.dismiss(it.config.floatTag, false)
autoPilotToolsFloat = null
floatWindow = null
}
}
}

View File

@@ -13,10 +13,10 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.utils.KeyBoardUtil
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import kotlinx.android.synthetic.main.view_auto_pilot_check.view.*
import kotlinx.android.synthetic.main.view_check_system.view.*
/**
* @author ChenFufeng
@@ -85,6 +85,9 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
ivDebugPanel.setOnClickListener {
clickListener?.showDebugPanelView()
}
ivDebugFeedback.onClick {
clickListener?.showFeedbackView()
}
etInputSpeed.setOnTouchListener { v, _ ->
if (!connectStatus) {
ToastUtils.showShort("设置车速失败,请启动域控制器")
@@ -176,5 +179,6 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
fun go2CheckPage()
fun onClose(v: View)
fun showDebugPanelView()
fun showFeedbackView()
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -67,8 +67,7 @@
android:background="@drawable/debug_icon_nor"
app:layout_constraintStart_toEndOf="@id/viewCheckStatus"
app:layout_constraintTop_toTopOf="@id/viewCheckStatus"
android:layout_marginStart="142px"
/>
android:layout_marginStart="142px" />
<TextView
android:id="@+id/tvDebug"
@@ -82,6 +81,27 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ivDebugPanel" />
<ImageView
android:id="@+id/ivDebugFeedback"
android:layout_width="150px"
android:layout_height="150px"
android:background="@drawable/debug_icon_feedback"
app:layout_constraintStart_toEndOf="@id/ivDebugPanel"
app:layout_constraintTop_toTopOf="@id/viewCheckStatus"
android:layout_marginStart="142px" />
<TextView
android:id="@+id/tvDebugFeedback"
android:layout_width="128px"
android:layout_height="42px"
android:layout_marginStart="740px"
android:layout_marginTop="23px"
android:text="@string/debug_panel_fb"
android:textColor="@color/color_FFA7B6F0"
android:textSize="32px"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivDebugFeedback" />
<View
android:layout_width="14px"
android:layout_height="50px"

View File

@@ -21,6 +21,7 @@
<string name="check_vehicle_detection">车辆检测</string>
<string name="debug_panel">调试面板</string>
<string name="debug_panel_fb">反馈</string>
<string name="check_vehicle_speed_setting">车速设置</string>
<string name="check_system_operation">系统运行</string>
<string name="check_system_shut_down">关机</string>