Merge branch 'dev_robotaxi-d_240401_6.4.0' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robotaxi-d_240401_6.4.0
This commit is contained in:
@@ -4,11 +4,12 @@ import android.content.Context
|
||||
import android.view.View
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.biz.login.callback.ILoginViewCallback
|
||||
import com.mogo.och.biz.login.callback.ITaxiLoginCallback
|
||||
import com.mogo.och.biz.login.model.LoginStatusDefaultModel
|
||||
import com.mogo.och.biz.login.ui.LoginFragment
|
||||
import com.mogo.och.biz.login.ui.LoginPassengerFragment
|
||||
@@ -19,6 +20,12 @@ import com.mogo.och.common.module.biz.login.LoginService
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
import com.mogo.och.common.module.biz.login.RoleEnum
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusEnum
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BusinessType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.EnvType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.ProjectType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.VehicleType
|
||||
import com.mogo.och.common.module.utils.Project
|
||||
import com.mogo.och.common.module.utils.ProjectUtils
|
||||
|
||||
/**
|
||||
* 网约车小巴业务实现入口
|
||||
@@ -117,7 +124,87 @@ class LoginProvider : LoginService {
|
||||
}
|
||||
}
|
||||
if (loginFragment is ILoginViewCallback) {
|
||||
(loginFragment as ILoginViewCallback).showErrorInfo("业务模式不支持")
|
||||
val reaseon = when (businessEnum) {
|
||||
BusinessEnum.Taxi -> "后台配置为:出租车模式、请检查应用或配置"
|
||||
BusinessEnum.Bus -> "后台配置为:小巴模式、请检查应用或配置"
|
||||
BusinessEnum.Shuttle -> "后台配置为:接驳模式、请检查应用或配置"
|
||||
BusinessEnum.Charter -> "后台配置为:包车模式、请检查应用或配置"
|
||||
else -> "后台配置为:未知模式${businessType}、请检查应用或配置"
|
||||
}
|
||||
UiThreadHandler.post({
|
||||
(loginFragment as ILoginViewCallback).showErrorInfo(reaseon)
|
||||
},UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override fun checkAllEnv(
|
||||
projectType: ProjectType,
|
||||
envType: EnvType,
|
||||
vehicleType: VehicleType,
|
||||
businessType: BusinessType
|
||||
): Boolean {
|
||||
|
||||
val isProjectSupply = when (ProjectUtils.getProjectType()) {
|
||||
Project.SAAS -> projectType == ProjectType.saas
|
||||
Project.DALI -> projectType == ProjectType.dali
|
||||
Project.MOGO -> projectType == ProjectType.mogo
|
||||
Project.YANTAI -> projectType == ProjectType.yantai
|
||||
}
|
||||
|
||||
val envTypeSupply = when (DebugConfig.getNetMode()) {
|
||||
2 -> {
|
||||
envType == EnvType.qa
|
||||
}
|
||||
|
||||
3 -> {
|
||||
envType == EnvType.online
|
||||
}
|
||||
|
||||
4 -> {
|
||||
envType == EnvType.demo
|
||||
}
|
||||
|
||||
else -> {
|
||||
envType == EnvType.qa
|
||||
}
|
||||
}
|
||||
val vehicleTypeSupply =
|
||||
if (AppIdentityModeUtils.isT1T2(FunctionBuildConfig.appIdentityMode)) {
|
||||
vehicleType == VehicleType.T1T2
|
||||
} else if (AppIdentityModeUtils.isM1(FunctionBuildConfig.appIdentityMode)) {
|
||||
vehicleType == VehicleType.M1
|
||||
} else if (AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)) {
|
||||
vehicleType == VehicleType.B1
|
||||
} else if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
|
||||
vehicleType == VehicleType.B2
|
||||
} else {
|
||||
vehicleType == VehicleType.C1
|
||||
}
|
||||
|
||||
val businessTypeSupply = checkBusinessMine(businessType)
|
||||
|
||||
if(isProjectSupply&&envTypeSupply&&vehicleTypeSupply&&businessTypeSupply){
|
||||
|
||||
}else{
|
||||
if (loginFragment is ILoginViewCallback) {
|
||||
UiThreadHandler.post({
|
||||
(loginFragment as ILoginViewCallback).checkAllEnv(projectType,envType,vehicleType,businessType)
|
||||
},UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
}
|
||||
|
||||
return isProjectSupply&&envTypeSupply&&vehicleTypeSupply&&businessTypeSupply
|
||||
}
|
||||
|
||||
fun checkBusinessMine(businessType: BusinessType) :Boolean{
|
||||
if(businessType==BusinessType.none){
|
||||
return true
|
||||
}
|
||||
FunctionBuildConfig.supportBusiness.forEach {
|
||||
if (businessType.name == it) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
package com.mogo.och.biz.login.callback
|
||||
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BusinessType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.EnvType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.ProjectType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.VehicleType
|
||||
|
||||
interface ILoginViewCallback {
|
||||
fun showErrorInfo(errorInfo: String)
|
||||
|
||||
fun checkAllEnv(
|
||||
projectType: ProjectType,
|
||||
envType: EnvType,
|
||||
vehicleType: VehicleType,
|
||||
businessType: BusinessType
|
||||
){}
|
||||
|
||||
fun updateStatus(status:String){}
|
||||
|
||||
}
|
||||
|
||||
@@ -105,7 +105,6 @@ class LoginPresenter(view: LoginFragment?) : Presenter<LoginFragment?>(view), IT
|
||||
return
|
||||
}
|
||||
if(!LoginStatusManager.checkBusiness(LoginStatusManager.getBusInessType().code)){
|
||||
mView?.showErrorInfo("不支持的类型")
|
||||
LoginStatusDefaultModel.queryCarStatus()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -19,6 +19,10 @@ import com.mogo.och.biz.R
|
||||
import com.mogo.och.biz.login.callback.ILoginViewCallback
|
||||
import com.mogo.och.biz.login.presenter.LoginPresenter
|
||||
import com.mogo.och.common.module.biz.login.BusinessEnum
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BusinessType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.EnvType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.ProjectType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.VehicleType
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import kotlinx.android.synthetic.main.biz_login_view.biz_acbtn_login
|
||||
import kotlinx.android.synthetic.main.biz_login_view.biz_ace_login_phone_value
|
||||
@@ -183,6 +187,16 @@ class LoginFragment : MvpFragment<LoginFragment?, LoginPresenter?>(), ILoginView
|
||||
override fun showErrorInfo(errorInfo: String) {
|
||||
ToastUtils.showLong(errorInfo)
|
||||
eiv_Info.visibility = View.VISIBLE
|
||||
eiv_Info.showErrinfo(errorInfo)
|
||||
}
|
||||
|
||||
override fun checkAllEnv(
|
||||
projectType: ProjectType,
|
||||
envType: EnvType,
|
||||
vehicleType: VehicleType,
|
||||
businessType: BusinessType
|
||||
) {
|
||||
// 司机屏不用处理 只处理 后台返回的业务模型就行
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
||||
@@ -1,16 +1,24 @@
|
||||
package com.mogo.och.biz.login.ui
|
||||
|
||||
import android.view.View
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
import com.mogo.och.biz.R
|
||||
import com.mogo.och.biz.login.callback.ILoginViewCallback
|
||||
import com.mogo.och.biz.login.presenter.LoginPassengerPresenter
|
||||
import kotlinx.android.synthetic.main.biz_login_passenger_view.biz_actv_login_show_sn
|
||||
import kotlinx.android.synthetic.main.biz_login_passenger_view.biz_cl_passenger_main
|
||||
import kotlinx.android.synthetic.main.biz_login_passenger_view.bv_switch_business
|
||||
import com.mogo.och.biz.login.ui.debugview.BusinessView
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BusinessType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.EnvType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.ProjectType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.VehicleType
|
||||
import kotlinx.android.synthetic.main.biz_login_view.eiv_Info
|
||||
import java.lang.StringBuilder
|
||||
|
||||
|
||||
/**
|
||||
@@ -20,29 +28,43 @@ import kotlinx.android.synthetic.main.biz_login_passenger_view.bv_switch_busines
|
||||
class LoginPassengerFragment : MvpFragment<LoginPassengerFragment?, LoginPassengerPresenter?>(),
|
||||
ILoginViewCallback {
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.biz_login_passenger_view
|
||||
}
|
||||
private var biz_cl_passenger_main: ConstraintLayout?=null
|
||||
private var biz_actv_login_show_sn: AppCompatTextView?=null
|
||||
private var bv_switch_business: BusinessView?=null
|
||||
private var actv_app_version: AppCompatTextView?=null
|
||||
private var actv_connect_status: AppCompatTextView?=null
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
|
||||
override fun initViews() {
|
||||
if (AppIdentityModeUtils.isM1(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isPassenger((FunctionBuildConfig.appIdentityMode))
|
||||
) {
|
||||
biz_cl_passenger_main.setBackgroundResource(R.drawable.biz_login_passenger_1920x1080)
|
||||
return R.layout.biz_login_passenger_view_1920x1080
|
||||
} else if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isPassenger((FunctionBuildConfig.appIdentityMode))
|
||||
) {
|
||||
biz_cl_passenger_main.setBackgroundResource(R.drawable.biz_login_passenger_1080x1920)
|
||||
return R.layout.biz_login_passenger_view_1080x1920
|
||||
} else {
|
||||
biz_cl_passenger_main.setBackgroundResource(R.drawable.biz_login_passenger_2560x1600)
|
||||
}
|
||||
biz_actv_login_show_sn.text = SharedPrefsMgr.getInstance().sn
|
||||
biz_actv_login_show_sn.setOnLongClickListener {
|
||||
bv_switch_business.selectBusniess()
|
||||
true
|
||||
return R.layout.biz_login_passenger_view_2560x1600
|
||||
}
|
||||
|
||||
CallerLogger.d(TAG,"init")
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
|
||||
biz_cl_passenger_main = findViewById(R.id.biz_cl_passenger_main)
|
||||
biz_actv_login_show_sn= findViewById(R.id.biz_actv_login_show_sn)
|
||||
bv_switch_business= findViewById(R.id.bv_switch_business)
|
||||
actv_app_version= findViewById(R.id.actv_app_version)
|
||||
actv_connect_status= findViewById(R.id.actv_connect_status)
|
||||
|
||||
biz_actv_login_show_sn?.text = SharedPrefsMgr.getInstance().sn
|
||||
biz_actv_login_show_sn?.setOnLongClickListener {
|
||||
bv_switch_business?.selectBusniess()
|
||||
true
|
||||
}
|
||||
actv_app_version?.text = "版本号:${AppUtils.getAppVersionName()}"
|
||||
CallerLogger.d(TAG, "init")
|
||||
}
|
||||
|
||||
override fun createPresenter(): LoginPassengerPresenter {
|
||||
@@ -62,13 +84,63 @@ class LoginPassengerFragment : MvpFragment<LoginPassengerFragment?, LoginPasseng
|
||||
|
||||
}
|
||||
|
||||
override fun checkAllEnv(
|
||||
projectType: ProjectType,
|
||||
envType: EnvType,
|
||||
vehicleType: VehicleType,
|
||||
businessType: BusinessType
|
||||
) {
|
||||
|
||||
val info = StringBuilder()
|
||||
|
||||
info.append("司机屏支持的业务模式")
|
||||
|
||||
when (projectType) {
|
||||
ProjectType.dali -> info.append("大理环境")
|
||||
ProjectType.mogo -> info.append("衡阳环境")
|
||||
ProjectType.saas -> info.append("saas环境")
|
||||
ProjectType.yantai -> info.append("烟台环境")
|
||||
}
|
||||
when (envType) {
|
||||
EnvType.qa -> info.append("、qa测试环境")
|
||||
EnvType.online -> info.append("、正式环境环境")
|
||||
EnvType.demo -> info.append("、开发环境环境")
|
||||
}
|
||||
when (vehicleType) {
|
||||
VehicleType.T1T2 -> info.append("、车型是:T1T2")
|
||||
VehicleType.C1 -> info.append("、车型是:B2")
|
||||
VehicleType.B1 -> info.append("、车型是:B1")
|
||||
VehicleType.B2 -> info.append("、车型是:B2")
|
||||
VehicleType.M1 -> info.append("、车型是:M1")
|
||||
}
|
||||
|
||||
info.append("、支持的业务类型有:")
|
||||
when (businessType) {
|
||||
BusinessType.none -> {
|
||||
return
|
||||
}
|
||||
BusinessType.bus -> info.append("小巴车")
|
||||
BusinessType.shuttle -> info.append("接驳车")
|
||||
BusinessType.charter -> info.append("包车")
|
||||
BusinessType.taxi -> info.append("出租车")
|
||||
BusinessType.taxiunmanned -> info.append("无人化出租车")
|
||||
}
|
||||
|
||||
eiv_Info.visibility = View.VISIBLE
|
||||
eiv_Info.showErrinfo(info.toString())
|
||||
}
|
||||
|
||||
override fun updateStatus(status: String) {
|
||||
actv_connect_status?.text = "当前状态:${status}"
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
CallerLogger.d(TAG,"onResume")
|
||||
CallerLogger.d(TAG, "onResume")
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
CallerLogger.d(TAG,"onPause")
|
||||
CallerLogger.d(TAG, "onPause")
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,23 @@ import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.och.biz.R
|
||||
import com.mogo.och.biz.login.ui.debugview.BusinessViewModel
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BusinessType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.EnvType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.ProjectType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.VehicleType
|
||||
import com.mogo.och.common.module.utils.Project
|
||||
import com.mogo.och.common.module.utils.ProjectUtils
|
||||
import kotlinx.android.synthetic.main.biz_login_errorinfo_view.view.actv_countdown
|
||||
import kotlinx.android.synthetic.main.biz_login_errorinfo_view.view.actv_error_body
|
||||
import kotlinx.android.synthetic.main.biz_login_errorinfo_view.view.actv_error_head
|
||||
import kotlinx.android.synthetic.main.biz_login_errorinfo_view.view.actv_see
|
||||
import java.lang.StringBuilder
|
||||
|
||||
|
||||
class ErrorInfoView : ConstraintLayout, ErrorInfoViewModel.IErrorInfoViewCallback {
|
||||
@@ -26,6 +40,69 @@ class ErrorInfoView : ConstraintLayout, ErrorInfoViewModel.IErrorInfoViewCallbac
|
||||
private var viewModel: ErrorInfoViewModel? = null
|
||||
private fun initView() {
|
||||
LayoutInflater.from(context).inflate(R.layout.biz_login_errorinfo_view, this, true)
|
||||
|
||||
|
||||
if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isPassenger((FunctionBuildConfig.appIdentityMode))
|
||||
) {
|
||||
actv_see.visibility = GONE
|
||||
}
|
||||
|
||||
actv_see.onClick {
|
||||
viewModel?.cancleCountDown()
|
||||
actv_countdown.text = "10s"
|
||||
visibility = GONE
|
||||
}
|
||||
|
||||
val info = StringBuilder()
|
||||
|
||||
when (ProjectUtils.getProjectType()) {
|
||||
Project.SAAS -> info.append("saas环境")
|
||||
Project.DALI -> info.append("大理环境")
|
||||
Project.MOGO -> info.append("衡阳环境")
|
||||
Project.YANTAI -> info.append("烟台环境")
|
||||
}
|
||||
|
||||
when (DebugConfig.getNetMode()) {
|
||||
2 -> {
|
||||
info.append("、qa测试环境")
|
||||
}
|
||||
|
||||
3 -> {
|
||||
info.append("、正式环境环境")
|
||||
}
|
||||
|
||||
4 -> {
|
||||
info.append("、开发环境环境")
|
||||
}
|
||||
|
||||
else -> {
|
||||
info.append("、qa测试环境")
|
||||
}
|
||||
}
|
||||
val vehicleTypeSupply =
|
||||
if (AppIdentityModeUtils.isT1T2(FunctionBuildConfig.appIdentityMode)) {
|
||||
info.append("、车型是:T1T2")
|
||||
} else if (AppIdentityModeUtils.isM1(FunctionBuildConfig.appIdentityMode)) {
|
||||
info.append("、车型是:M1")
|
||||
} else if (AppIdentityModeUtils.isB1(FunctionBuildConfig.appIdentityMode)) {
|
||||
info.append("、车型是:B1")
|
||||
} else if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
|
||||
info.append("、车型是:B2")
|
||||
} else {
|
||||
info.append("、车型是:C1")
|
||||
}
|
||||
info.append("、支持的业务类型有:")
|
||||
FunctionBuildConfig.supportBusiness.forEachIndexed { index, s ->
|
||||
if (index==FunctionBuildConfig.supportBusiness.size-1) {
|
||||
info.append(s)
|
||||
}else{
|
||||
info.append("$s、")
|
||||
}
|
||||
}
|
||||
|
||||
actv_error_body.text = info
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -65,4 +142,8 @@ class ErrorInfoView : ConstraintLayout, ErrorInfoViewModel.IErrorInfoViewCallbac
|
||||
}
|
||||
}
|
||||
|
||||
fun showErrinfo(errorInfo: String) {
|
||||
actv_error_head.text = errorInfo
|
||||
}
|
||||
|
||||
}
|
||||
@@ -35,6 +35,7 @@ class ErrorInfoViewModel : ViewModel() {
|
||||
if(RxUtils.isNotDisposed(countDownDisposable)){
|
||||
return
|
||||
}
|
||||
RxUtils.disposeSubscribe(countDownDisposable)
|
||||
countDownDisposable = Observable.intervalRange(0, countDownSeconds, 0, 1, TimeUnit.SECONDS)
|
||||
.map { aLong -> countDownSeconds - aLong }
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -62,6 +63,10 @@ class ErrorInfoViewModel : ViewModel() {
|
||||
|
||||
}
|
||||
|
||||
fun cancleCountDown() {
|
||||
RxUtils.disposeSubscribe(countDownDisposable)
|
||||
}
|
||||
|
||||
interface IErrorInfoViewCallback {
|
||||
fun setCountDownText(s: String, b: Boolean)
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 66 KiB |
BIN
OCH/common/biz/src/main/res/drawable-nodpi/biz_login_pop_bg.png
Executable file
BIN
OCH/common/biz/src/main/res/drawable-nodpi/biz_login_pop_bg.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 75 KiB |
@@ -2,8 +2,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:layout_width="@dimen/dp_939"
|
||||
android:layout_height="@dimen/dp_710"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/biz_login_error_info">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
@@ -20,9 +20,11 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_error_head"
|
||||
android:layout_width="@dimen/dp_818"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_120"
|
||||
android:layout_marginStart="@dimen/dp_60"
|
||||
android:layout_marginEnd="@dimen/dp_60"
|
||||
android:gravity="center"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_46"
|
||||
@@ -34,7 +36,9 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_error_body"
|
||||
android:layout_width="@dimen/dp_818"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_60"
|
||||
android:layout_marginEnd="@dimen/dp_60"
|
||||
android:layout_height="0dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@android:color/white"
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<?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"
|
||||
android:id="@+id/biz_cl_passenger_main"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<com.mogo.och.biz.login.ui.debugview.BusinessView
|
||||
android:id="@+id/bv_switch_business"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/biz_actv_login_show_sn"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:textColor="@android:color/white"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginEnd="@dimen/dp_50"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?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/biz_cl_passenger_main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/biz_login_passenger_1080x1920">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_connect_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:text="当前状态:等待中"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_44"
|
||||
app:layout_constraintBottom_toTopOf="@+id/actv_app_version"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_app_version"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_70"
|
||||
android:text="版本号:6.4.0"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_44"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<com.mogo.och.biz.login.ui.errorview.ErrorInfoView
|
||||
android:id="@+id/eiv_Info"
|
||||
android:layout_width="@dimen/dp_751"
|
||||
android:layout_height="@dimen/dp_568"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
<com.mogo.och.biz.login.ui.debugview.BusinessView
|
||||
android:id="@+id/bv_switch_business"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/biz_actv_login_show_sn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_50"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_30"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?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/biz_cl_passenger_main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/biz_login_passenger_1920x1080">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_connect_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_70"
|
||||
android:text="当前状态:等待中"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_44"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/actv_app_version"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_app_version"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_70"
|
||||
android:text="版本号:6.4.0"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_44"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/actv_connect_status" />
|
||||
|
||||
<com.mogo.och.biz.login.ui.errorview.ErrorInfoView
|
||||
android:id="@+id/eiv_Info"
|
||||
android:layout_width="@dimen/dp_939"
|
||||
android:layout_height="@dimen/dp_710"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
<com.mogo.och.biz.login.ui.debugview.BusinessView
|
||||
android:id="@+id/bv_switch_business"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/biz_actv_login_show_sn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_50"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_30"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?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/biz_cl_passenger_main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/biz_login_passenger_2560x1600">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_connect_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_70"
|
||||
android:text="当前状态:等待中"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_44"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/actv_app_version"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_app_version"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_70"
|
||||
android:text="版本号:6.4.0"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_44"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/actv_connect_status" />
|
||||
|
||||
<com.mogo.och.biz.login.ui.errorview.ErrorInfoView
|
||||
android:id="@+id/eiv_Info"
|
||||
android:layout_width="@dimen/dp_939"
|
||||
android:layout_height="@dimen/dp_710"
|
||||
android:layout_marginBottom="@dimen/dp_414"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
<com.mogo.och.biz.login.ui.debugview.BusinessView
|
||||
android:id="@+id/bv_switch_business"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/biz_actv_login_show_sn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_50"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_30"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -12,6 +12,16 @@
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_login_bg_pop"
|
||||
android:src="@drawable/biz_login_pop_bg"
|
||||
android:layout_marginTop="@dimen/dp_66"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="1071dp"
|
||||
android:layout_height="1533dp"/>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/biz_actv_welcome_login_title"
|
||||
|
||||
@@ -37,10 +37,17 @@ object LoginLanDriverSocket : ILoginCallback {
|
||||
|
||||
override fun onMsgReceived(obj: Array<in BaseDPMsg>) {
|
||||
println("-------${obj}")
|
||||
getEnvCheck()
|
||||
val msg =
|
||||
ChangeBusinessType(vehicleType!!, businessType!!, projectType!!, envType!!)
|
||||
LanSocketManager.sendMsgToClient(msg)
|
||||
if(LoginStatusManager.isLogin()) {
|
||||
getEnvCheck()
|
||||
val msg =
|
||||
ChangeBusinessType(vehicleType!!, businessType!!, projectType!!, envType!!)
|
||||
LanSocketManager.sendMsgToClient(msg)
|
||||
}else{
|
||||
getEnvCheck()
|
||||
val msg =
|
||||
ChangeBusinessType(vehicleType!!, BusinessType.none, projectType!!, envType!!)
|
||||
LanSocketManager.sendMsgToClient(msg)
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -131,9 +138,6 @@ object LoginLanDriverSocket : ILoginCallback {
|
||||
Project.YANTAI -> ProjectType.yantai
|
||||
}
|
||||
envType = when (DebugConfig.getNetMode()) {
|
||||
1 -> {
|
||||
EnvType.demo
|
||||
}
|
||||
|
||||
2 -> {
|
||||
EnvType.qa
|
||||
@@ -142,6 +146,9 @@ object LoginLanDriverSocket : ILoginCallback {
|
||||
3 -> {
|
||||
EnvType.online
|
||||
}
|
||||
4 -> {
|
||||
EnvType.demo
|
||||
}
|
||||
|
||||
else -> {
|
||||
EnvType.qa
|
||||
|
||||
@@ -3,12 +3,19 @@ package com.mogo.och.common.module.biz.lansocket
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.och.common.module.biz.login.BusinessEnum
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusEnum
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
import com.mogo.och.common.module.manager.socket.lan.ILanMessageListener
|
||||
import com.mogo.och.common.module.manager.socket.lan.LanSocketManager
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BaseDPMsg
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BusinessType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.ChangeBusinessType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.DPMsgType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.EnvCheck
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.EnvType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.ProjectType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.VehicleType
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
object LoginLanPassengerSocket : IReceivedMsgListener {
|
||||
@@ -29,10 +36,22 @@ object LoginLanPassengerSocket : IReceivedMsgListener {
|
||||
}
|
||||
|
||||
override fun onMsgReceived(obj: Array<in EnvCheck>) {
|
||||
println("EnvCheck-------${obj}")
|
||||
if (obj.isNotEmpty()) {
|
||||
val first = obj.first() as EnvCheck
|
||||
checkEnv(first.projectType, first.envType, first.vehicleType, first.businessType)
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
private fun checkEnv(
|
||||
projectType: ProjectType,
|
||||
envType: EnvType,
|
||||
vehicleType: VehicleType,
|
||||
businessType: BusinessType
|
||||
): Boolean {
|
||||
return LoginStatusManager.checkAllEnv(projectType, envType, vehicleType, businessType)
|
||||
}
|
||||
|
||||
// 环境监测+业务展示和跳转
|
||||
private val changeBusinessType = object : ILanMessageListener<ChangeBusinessType> {
|
||||
@@ -41,10 +60,28 @@ object LoginLanPassengerSocket : IReceivedMsgListener {
|
||||
}
|
||||
|
||||
override fun onMsgReceived(obj: Array<in ChangeBusinessType>) {
|
||||
println("ChangeBusinessType -------${obj}")
|
||||
if (obj.isNotEmpty()) {
|
||||
var first = obj.first() as ChangeBusinessType
|
||||
println("ChangeBusinessType -------${first}")
|
||||
val first = obj.first() as ChangeBusinessType
|
||||
val checkEnv = checkEnv(
|
||||
first.projectType,
|
||||
first.envType,
|
||||
first.vehicleType,
|
||||
first.businessType
|
||||
)
|
||||
if(checkEnv){
|
||||
when (first.businessType) {
|
||||
BusinessType.none -> {
|
||||
LoginStatusManager.setBusinessType(BusinessEnum.None.code)
|
||||
return LoginStatusManager.setLoginStatus(LoginStatusEnum.Logout)
|
||||
}
|
||||
BusinessType.bus -> LoginStatusManager.setBusinessType(BusinessEnum.Bus.code)
|
||||
BusinessType.shuttle -> LoginStatusManager.setBusinessType(BusinessEnum.Shuttle.code)
|
||||
BusinessType.charter -> LoginStatusManager.setBusinessType(BusinessEnum.Charter.code)
|
||||
BusinessType.taxi -> LoginStatusManager.setBusinessType(BusinessEnum.Taxi.code)
|
||||
BusinessType.taxiunmanned ->LoginStatusManager.setBusinessType(BusinessEnum.Taxi.code)
|
||||
}
|
||||
LoginStatusManager.setLoginStatus(LoginStatusEnum.Login)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,6 +106,7 @@ object LoginLanPassengerSocket : IReceivedMsgListener {
|
||||
changeBusinessType
|
||||
)
|
||||
}
|
||||
|
||||
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.mogo.och.common.module.biz.login
|
||||
|
||||
import com.mogo.och.common.module.biz.provider.CommonService
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BusinessType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.EnvType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.ProjectType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.VehicleType
|
||||
|
||||
interface LoginService :CommonService {
|
||||
fun setLoginInfo(loginInfo: LoginInfo)
|
||||
@@ -23,5 +27,11 @@ interface LoginService :CommonService {
|
||||
*/
|
||||
fun loginOut(mLatitude:Double,mLongitude:Double)
|
||||
fun checkBusiness(businessType: Int): Boolean
|
||||
fun checkAllEnv(
|
||||
projectType: ProjectType,
|
||||
envType: EnvType,
|
||||
vehicleType: VehicleType,
|
||||
businessType: BusinessType
|
||||
): Boolean
|
||||
|
||||
}
|
||||
@@ -4,6 +4,10 @@ package com.mogo.och.common.module.biz.login
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BusinessType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.EnvType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.ProjectType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.VehicleType
|
||||
import com.mogo.och.common.module.utils.CallerBase
|
||||
|
||||
object LoginStatusManager : CallerBase<ILoginCallback>() {
|
||||
@@ -110,5 +114,17 @@ object LoginStatusManager : CallerBase<ILoginCallback>() {
|
||||
return false
|
||||
}
|
||||
|
||||
fun checkAllEnv(
|
||||
projectType: ProjectType,
|
||||
envType: EnvType,
|
||||
vehicleType: VehicleType,
|
||||
businessType: BusinessType
|
||||
):Boolean {
|
||||
loginService?.let {
|
||||
return it.checkAllEnv(projectType,envType,vehicleType,businessType)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -65,7 +65,7 @@ object LanSocketManager : IReceivedMsgListener {
|
||||
}
|
||||
}
|
||||
}catch (e:Exception){
|
||||
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.biz.lansocket.LoginLanDriverSocket
|
||||
import com.mogo.och.common.module.biz.lansocket.LoginLanPassengerSocket
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
@@ -60,8 +61,11 @@ abstract class FacadeProvider : IMoGoFunctionProvider, ILoginCallback {
|
||||
private fun showFragment() {
|
||||
val supportFragmentManager: FragmentManager? = activity?.supportFragmentManager
|
||||
val fragment = if (LoginStatusManager.isLogin()) {
|
||||
getFragment()
|
||||
val fragment = getFragment()
|
||||
injectStatusBar()
|
||||
fragment
|
||||
} else {
|
||||
removeStatusBar()
|
||||
CallerHmiManager.hideToolsView()
|
||||
ToggleDebugView.toggleDebugView.dismiss()
|
||||
SopView.sopView.dismiss()
|
||||
@@ -138,7 +142,9 @@ abstract class FacadeProvider : IMoGoFunctionProvider, ILoginCallback {
|
||||
|
||||
override fun onStatusChange(currentStatus: LoginStatusEnum) {
|
||||
d(TAG, "登录状态发生改变 ${currentStatus}")
|
||||
showFragment()
|
||||
UiThreadHandler.post {
|
||||
showFragment()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBusinessChange(businessEnum: BusinessEnum) {
|
||||
@@ -188,5 +194,14 @@ abstract class FacadeProvider : IMoGoFunctionProvider, ILoginCallback {
|
||||
decorView.addView(statusBarView, statusBarLP)
|
||||
}
|
||||
}
|
||||
private fun removeStatusBar(){
|
||||
activity?.let {
|
||||
val decorView = it.window.decorView as? FrameLayout ?: return
|
||||
val statusBar = decorView.findViewWithTag<View>("status_bar")
|
||||
statusBar?.let {
|
||||
decorView.removeView(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,12 +19,14 @@ import java.lang.ref.WeakReference
|
||||
|
||||
class BatteryGroupView : LinearLayout, IMoGoSkinModeChangeListener {
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : super(context, attrs, defStyleAttr) {
|
||||
}
|
||||
constructor(context: Context?) : super(context)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
|
||||
|
||||
|
||||
private var batteryHandler: BatteryHandler = BatteryHandler(this)
|
||||
private var view: View =
|
||||
|
||||
@@ -46,7 +46,6 @@ class StatusBarView @JvmOverloads constructor(
|
||||
params.height = BarUtils.getStatusBarHeight()
|
||||
layoutParams = params
|
||||
}
|
||||
viewStatusBarRight.addView(BatteryGroupView(this.context))
|
||||
|
||||
//添加view控制
|
||||
CallerHmiViewControlListenerManager.addListener(TAG,this)
|
||||
|
||||
@@ -77,5 +77,8 @@
|
||||
android:layout_marginEnd="@dimen/dp_44"
|
||||
android:gravity="end|center"
|
||||
android:orientation="horizontal">
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.BatteryGroupView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
</merge>
|
||||
Reference in New Issue
Block a user