调试面板
增加SN、docker版本和经纬度的复制
This commit is contained in:
@@ -2,6 +2,8 @@ package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.content.ClipData
|
||||
import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.os.Build
|
||||
@@ -12,6 +14,7 @@ import android.view.View
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.ContextCompat.getSystemService
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import chassis.Chassis
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
@@ -133,6 +136,9 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
//剪切板
|
||||
private var clipboardManager: ClipboardManager ?= null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_debug_setting, this, true)
|
||||
initView()
|
||||
@@ -616,6 +622,39 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
clickListener?.showReportListWindow(isChecked)
|
||||
}
|
||||
|
||||
//SN复制按钮
|
||||
tvPadSnClip.setOnClickListener {
|
||||
if(clipboardManager==null){
|
||||
//获取剪贴板管理器:
|
||||
clipboardManager = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
}
|
||||
// 创建普通字符型ClipData ,将ClipData内容放到系统剪贴板里
|
||||
clipboardManager?.setPrimaryClip(ClipData.newPlainText("MoGoSN",AppConfigInfo.mogoSN))
|
||||
ToastUtils.showLong("SN复制成功")
|
||||
}
|
||||
|
||||
//工控机镜像复制按钮
|
||||
tvIpcVersionInfoClip.setOnClickListener{
|
||||
if(clipboardManager==null){
|
||||
//获取剪贴板管理器:
|
||||
clipboardManager = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
}
|
||||
// 创建普通字符型ClipData ,将ClipData内容放到系统剪贴板里
|
||||
clipboardManager?.setPrimaryClip(ClipData.newPlainText("DockVersion",mAutoPilotStatusInfo?.dockVersion))
|
||||
ToastUtils.showLong("docker版本复制成功")
|
||||
}
|
||||
|
||||
//经纬度复制按钮
|
||||
tvCarInfoCopyClip.setOnClickListener{
|
||||
if(clipboardManager==null){
|
||||
//获取剪贴板管理器:
|
||||
clipboardManager = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
}
|
||||
// 创建普通字符型ClipData ,将ClipData内容放到系统剪贴板里
|
||||
clipboardManager?.setPrimaryClip(ClipData.newPlainText("LonAndLat","${mGnssInfo?.longitude},${mGnssInfo?.latitude}"))
|
||||
ToastUtils.showLong("经纬度复制成功")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -207,11 +207,32 @@
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPadSn"
|
||||
style="@style/DebugSettingText"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPadSn"
|
||||
style="@style/DebugSettingText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPadSnClip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="复制"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#0000FF"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
@@ -316,11 +337,29 @@
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvIpcVersionInfo"
|
||||
style="@style/DebugSettingText"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvIpcVersionInfo"
|
||||
style="@style/DebugSettingText"
|
||||
android:layout_width="@dimen/dp_600"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvIpcVersionInfoClip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="复制"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#0000FF"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
@@ -565,12 +604,23 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/recordBagDivider" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCarInfoCopyClip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="复制经纬度"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#0000FF"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCarInfoCopy"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvIdentifyInfoCopy"
|
||||
style="@style/DebugSettingText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCarInfoCopy" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCarInfoCopyClip" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTrajectoryInfoSizeCopy"
|
||||
|
||||
Reference in New Issue
Block a user