异常上报弹窗
调整弹窗UI、增加关闭按钮
This commit is contained in:
@@ -5,7 +5,6 @@ import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import mogo_msg.MogoReportMsg
|
||||
|
||||
|
||||
@@ -232,9 +232,15 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
ThreadUtils.runOnUiThread{
|
||||
if(ipcReportWindow==null){
|
||||
ipcReportWindow= activity?.let { IPCReportWindow(it) }
|
||||
ipcReportWindow?.showFloatWindow()
|
||||
ipcReportWindow?.setClickListener(object: IPCReportWindow.ClickListener{
|
||||
override fun closeWindow() {
|
||||
ipcReportWindow?.hideFloatWindow()
|
||||
ipcReportWindow =null
|
||||
}
|
||||
})
|
||||
AIAssist.getInstance(AbsMogoApplication.getApp()).speakTTSVoice("嘟")
|
||||
}
|
||||
ipcReportWindow?.showFloatWindow()
|
||||
ipcReportWindow?.refreshData(reportList)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.app.Activity
|
||||
import android.graphics.PixelFormat
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.*
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
@@ -21,6 +22,7 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
private var mWindowParams: WindowManager.LayoutParams? = null
|
||||
private var mWindowManager: WindowManager? = null
|
||||
private lateinit var rvIPCReport: RecyclerView
|
||||
private lateinit var ivIpcClose: ImageView
|
||||
private var ipcReportAdapter: IPCReportAdapter?=null
|
||||
|
||||
private lateinit var mFloatLayout: View
|
||||
@@ -31,6 +33,8 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
private var mInScreenX = 0f
|
||||
private var mInScreenY = 0f
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
init {
|
||||
initFloatWindow();
|
||||
}
|
||||
@@ -39,20 +43,25 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
mFloatLayout = LayoutInflater.from(mActivity).inflate(R.layout.view_ipc_report, null) as View
|
||||
mFloatLayout.setOnTouchListener(this)
|
||||
rvIPCReport= mFloatLayout.findViewById(R.id.rv_ipc_report)
|
||||
ivIpcClose = mFloatLayout.findViewById(R.id.iv_ipc_close)
|
||||
mWindowParams = WindowManager.LayoutParams()
|
||||
mWindowManager = mActivity.windowManager
|
||||
mWindowParams?.let {
|
||||
it.format = PixelFormat.RGBA_8888
|
||||
it.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||
it.gravity = Gravity.START or Gravity.TOP
|
||||
it.width = 800
|
||||
it.height = 1000
|
||||
it.width = 600
|
||||
it.height = 800
|
||||
it.alpha = 0.9f
|
||||
}
|
||||
ipcReportAdapter = IPCReportAdapter()
|
||||
rvIPCReport.layoutManager = LinearLayoutManager(mActivity,
|
||||
LinearLayoutManager.VERTICAL,false)
|
||||
rvIPCReport.adapter = ipcReportAdapter
|
||||
|
||||
ivIpcClose.setOnClickListener {
|
||||
clickListener?.closeWindow()
|
||||
}
|
||||
}
|
||||
|
||||
fun refreshData(data:List<ReportEntity>){
|
||||
@@ -122,5 +131,13 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
return sbar
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
interface ClickListener {
|
||||
fun closeWindow()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 850 B |
@@ -10,6 +10,11 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="14sp"
|
||||
android:text="@string/ipc_report_time"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -18,6 +23,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvReportTimeTitle"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -26,15 +35,24 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvReportTimeTitle"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="14sp"
|
||||
android:text="@string/ipc_report_type"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportResultContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/tvReportResultTitle"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvReportResultTitle"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:textColor="@color/color_FF0006"
|
||||
android:textSize="14sp"
|
||||
android:minLines="1"
|
||||
android:layout_marginEnd="10dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -43,15 +61,24 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvReportResultContent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="14sp"
|
||||
android:text="@string/ipc_report_msg"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportMsgContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/tvReportMsgTitle"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvReportMsgTitle"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:minLines="1"
|
||||
android:textColor="@color/color_FF0006"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginEnd="10dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -60,15 +87,24 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvReportMsgContent"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="14sp"
|
||||
android:text="@string/ipc_report_action"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportActionContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/tvReportActionTitle"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvReportActionTitle"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:minLines="1"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginEnd="10dp"
|
||||
/>
|
||||
|
||||
<View
|
||||
@@ -76,6 +112,9 @@
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvReportActionContent"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="5dp"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,17 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="840px"
|
||||
android:layout_height="584px"
|
||||
android:layout_width="500px"
|
||||
android:layout_height="350px"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/icon_drag"
|
||||
android:padding="15dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
/>
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_ipc_drag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/icon_drag"
|
||||
android:padding="10dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_ipc_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/icon_report_close"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_ipc_drag"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_ipc_drag"
|
||||
android:padding="10dp"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -39,9 +39,15 @@
|
||||
<string name="confirm">确认</string>
|
||||
<string name="cancel">稍后升级</string>
|
||||
|
||||
<string name="ipc_report_time">时间:</string>
|
||||
<string name="ipc_report_type">类型:</string>
|
||||
<string name="ipc_report_msg">原因:</string>
|
||||
<string name="ipc_report_action">建议操作:</string>
|
||||
|
||||
<!--绑定车机-->
|
||||
<string name="bindingcar_title">绑定车机</string>
|
||||
<string name="modify_binding_car">是否修改车机绑定?</string>
|
||||
<string name="to_binding_car">是否绑定车机?</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user