From 62ffb65aa52e2174484f912cb87a7708643c7619 Mon Sep 17 00:00:00 2001 From: xuxinchao <13522809046@163.com> Date: Fri, 20 May 2022 17:29:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E4=B8=8A=E6=8A=A5=E5=BC=B9?= =?UTF-8?q?=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调整弹窗UI、增加关闭按钮 --- .../core/function/report/IPCReportManager.kt | 1 - .../core/function/hmi/ui/MoGoHmiFragment.kt | 8 +++- .../hmi/ui/setting/IPCReportWindow.kt | 21 +++++++- .../res/drawable-xxhdpi/icon_report_close.png | Bin 0 -> 850 bytes .../src/main/res/layout/item_ipc_report.xml | 45 ++++++++++++++++-- .../src/main/res/layout/view_ipc_report.xml | 37 ++++++++++---- .../src/main/res/values/strings.xml | 6 +++ 7 files changed, 103 insertions(+), 15 deletions(-) create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xxhdpi/icon_report_close.png diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/report/IPCReportManager.kt b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/report/IPCReportManager.kt index d4f41bdca5..08dc07db56 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/report/IPCReportManager.kt +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/report/IPCReportManager.kt @@ -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 diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index 991406e9a6..3a420c7c9c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -232,9 +232,15 @@ class MoGoHmiFragment : MvpFragment(), 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) } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/IPCReportWindow.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/IPCReportWindow.kt index 559a5def67..efc5ef32be 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/IPCReportWindow.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/IPCReportWindow.kt @@ -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){ @@ -122,5 +131,13 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{ return sbar } + fun setClickListener(clickListener: ClickListener) { + this.clickListener = clickListener + } + + interface ClickListener { + fun closeWindow() + } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xxhdpi/icon_report_close.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xxhdpi/icon_report_close.png new file mode 100644 index 0000000000000000000000000000000000000000..3268295fba67cdc0b0c9d188280fc5603da16583 GIT binary patch literal 850 zcmeAS@N?(olHy`uVBq!ia0vp^DImSGHL+&LRKe}4S@{r08Tzwcj<-!O0asm^!WEGe45>UQtf znOlFy?q3Y6>SBG%6Wd;V4cWuw6&4>fVSU#=Ca<)3qX~N#SualcuF5E>xl7s0HU6bS ztlk%QgDJM24%3=eNzK^RUc0F{Ro`gB>IET5I+9+FyB3Eew=|TvDkiivmN+j=XlW{O zR7`AXz7Uupp{WoeqU0vU!Q0w3k;}19hG zpHS~5US>w2)=PrS%!}M!b~Q2uE-X2Apz+M2lH(3db6kJsJo|jQQd$31`Ozo-Jnn}i zZa#Z)({9tVUA&^q){5B$f*L72HYa9oU%%ILVe%FRpymS^%tqapSQm?)h@9dl!Dd;M zJ#CBbw{71y{-0^R&M){9QwrPS!|DBRPqwoMCX_fiHftE}T9DwVWMH*G!Lct%M?Cj` zk>Lxo4?M?yrC&Gx&9=3;BJxU$22<#oLJQZ2d=dhw6HaYyiR9O9W$5HENIJXFMcrJB zy^}|;=h$+PU!jl~u#6;p(T3$xKc>4H3bolw-0Ur_Z~XZd1uKSHS4luQ12ehCD6TUfgS)5|Yiq zvGU->+rD0Biv+xq7Yp2e%dyqlk%M<`qr$=y4(l2mcUnp}zg^ZKZ6k zSEsY2d~u$(DkJoP^6MU-{hRb9Py7#<;@Z!$@=hAR>)q)hPb9l`Wu)F%oL$>0baA@O z6G7EQFD?pPy`3Al=oc4bWZ<;<;Xm&y-sY}NiBD8`wfXbzHR%E~wm9-Ic{7CdsUK0; kz>@H^!igv@3)?6DvpY;C$+K*i2Idt8Pgg&ebxsLQ0H?ERcK`qY literal 0 HcmV?d00001 diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_ipc_report.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_ipc_report.xml index 6841bc661d..b055c72d90 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_ipc_report.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_ipc_report.xml @@ -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" /> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_ipc_report.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_ipc_report.xml index 66efb068a3..066d30f6db 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_ipc_report.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_ipc_report.xml @@ -1,17 +1,38 @@ - + android:layout_height="wrap_content"> + + + + + + 确认 稍后升级 + 时间: + 类型: + 原因: + 建议操作: + 绑定车机 是否修改车机绑定? 是否绑定车机? +