[登录和登出]
This commit is contained in:
yangyakun
2026-03-23 11:48:28 +08:00
parent 6e251b038c
commit 736707534a
6 changed files with 138 additions and 84 deletions

View File

@@ -0,0 +1,47 @@
package com.mogo.eagle.core.function.hmi.bone.unmanned
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.kotlin.onClick
import kotlinx.android.synthetic.main.unmanned_view_tool_logout.view.tvSignOut
import com.mogo.eagle.core.function.call.och.CallerOchBizFunctionCall4EagleManager
/**
* 一件停服
*/
class UnmannedToolLogoutView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {
companion object {
const val TAG = "UnmannedToolStopServiceView"
}
init {
LayoutInflater.from(context).inflate(R.layout.unmanned_view_tool_logout, this, true)
initView()
}
private fun initView() {
//一键停服
tvSignOut.onClick {
CallerOchBizFunctionCall4EagleManager.logout()
}
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
}
}

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/clCheckSystem"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/viewCheckShutDown"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_100"
android:contentDescription="@string/check_system_shut_down"
android:scaleType="fitXY"
android:src="@drawable/icon_toolkit_item_stop_service"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/icon_toolkit_item_stop_service_background" />
<TextView
android:id="@+id/tvSignOut"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_10"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:text="@string/check_system_logout"
android:textColor="@color/color_FFFFFF"
android:textSize="@dimen/sp_40"
app:layout_constraintBottom_toBottomOf="@id/viewCheckShutDown"
app:layout_constraintStart_toEndOf="@id/viewCheckShutDown"
app:layout_constraintTop_toTopOf="@id/viewCheckShutDown" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -49,6 +49,7 @@
<string name="bus_operation_title">Account Info</string>
<string name="check_system_operation">System Operation</string>
<string name="check_system_shut_down">One-click Shutdown</string>
<string name="check_system_logout">Sign out</string>
<string name="check_system_reboot">Reboot System</string>
<string name="check_system_reboot_title">Reboot Notice</string>
<string name="check_system_reboot_content">Reboot autonomous driving system?</string>

View File

@@ -49,6 +49,7 @@
<string name="bus_operation_title">账户信息</string>
<string name="check_system_operation">系统运行</string>
<string name="check_system_shut_down">一键停服</string>
<string name="check_system_logout">退出登录</string>
<string name="check_system_reboot">重启系统</string>
<string name="check_system_reboot_title">重启提示</string>
<string name="check_system_reboot_content">是否重启自动驾驶系统?</string>