[8.0.0]
[fea] [debugview 更新]
This commit is contained in:
@@ -10,14 +10,17 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.Product
|
||||
import com.mogo.eagle.core.utilcode.mogo.Vehicle
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.och.biz.R
|
||||
import com.mogo.och.biz.login.LoginServiceManager
|
||||
import com.mogo.och.biz.login.bean.LoginInfo
|
||||
import com.mogo.och.common.module.biz.login.EnumLoginStatus
|
||||
import kotlinx.android.synthetic.main.biz_login_business_view.view.actv_business_bus
|
||||
import kotlinx.android.synthetic.main.biz_login_business_view.view.actv_business_bus_B1
|
||||
import kotlinx.android.synthetic.main.biz_login_business_view.view.actv_business_bus_B2
|
||||
import kotlinx.android.synthetic.main.biz_login_business_view.view.actv_business_charter
|
||||
import kotlinx.android.synthetic.main.biz_login_business_view.view.actv_business_shuttle
|
||||
import kotlinx.android.synthetic.main.biz_login_business_view.view.actv_business_shuttle_B1
|
||||
import kotlinx.android.synthetic.main.biz_login_business_view.view.actv_business_shuttle_B2
|
||||
import kotlinx.android.synthetic.main.biz_login_business_view.view.actv_business_sweeper
|
||||
import kotlinx.android.synthetic.main.biz_login_business_view.view.actv_business_taxi
|
||||
import kotlinx.android.synthetic.main.biz_login_business_view.view.actv_debugview
|
||||
@@ -61,21 +64,24 @@ class BusinessView : ConstraintLayout, BusinessViewModel.IErrorInfoViewCallback
|
||||
|
||||
viewModel?.setDistanceCallback(this)
|
||||
|
||||
actv_business_shuttle.onClick { swtichBusiness(Product.SHUTTLE) }
|
||||
actv_business_bus.onClick { swtichBusiness(Product.BUS) }
|
||||
actv_business_taxi.onClick { swtichBusiness(Product.TAXI) }
|
||||
actv_business_charter.onClick { swtichBusiness(Product.CHARTER) }
|
||||
actv_business_sweeper.onClick { swtichBusiness(Product.SWEEPER) }
|
||||
actv_business_shuttle_B1.onClick { swtichBusiness(Product.SHUTTLE, Vehicle.B1) }
|
||||
actv_business_shuttle_B2.onClick { swtichBusiness(Product.SHUTTLE,Vehicle.B2) }
|
||||
actv_business_bus_B1.onClick { swtichBusiness(Product.BUS,Vehicle.B1) }
|
||||
actv_business_bus_B2.onClick { swtichBusiness(Product.BUS,Vehicle.B2) }
|
||||
actv_business_taxi.onClick { swtichBusiness(Product.TAXI,Vehicle.T1T2) }
|
||||
actv_business_charter.onClick { swtichBusiness(Product.CHARTER,Vehicle.M1) }
|
||||
actv_business_sweeper.onClick { swtichBusiness(Product.SWEEPER,Vehicle.C1) }
|
||||
actv_debugview.onClick { ToggleDebugView.toggleDebugView.toggle(context) }
|
||||
}
|
||||
|
||||
private fun swtichBusiness(businessEnum: Product) {
|
||||
private fun swtichBusiness(businessEnum: Product, vehicle: Vehicle) {
|
||||
var loginInfo = LoginServiceManager.getLoginInfo()
|
||||
if(loginInfo==null) {
|
||||
loginInfo = GsonUtils.fromJson(tempLoginJson, LoginInfo::class.java)
|
||||
}
|
||||
loginInfo?.driverStatus = EnumLoginStatus.Login.code
|
||||
loginInfo?.businessType = businessEnum.code
|
||||
loginInfo?.carModel = vehicle.code
|
||||
LoginServiceManager.setLoginInfo(loginInfo!!)
|
||||
FunctionBuildConfig.ochdebug = true
|
||||
}
|
||||
|
||||
@@ -1,19 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout 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_200"
|
||||
android:layout_height="@dimen/dp_480"
|
||||
android:layout_height="@dimen/dp_580"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/biz_login_error_info">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_business_bus"
|
||||
android:id="@+id/actv_business_bus_B1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingTop="@dimen/dp_20"
|
||||
android:paddingBottom="@dimen/dp_20"
|
||||
android:text="公交模式"
|
||||
android:text="公交模式B1"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintBottom_toTopOf="@+id/actv_business_charter"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_business_bus_B2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingTop="@dimen/dp_20"
|
||||
android:paddingBottom="@dimen/dp_20"
|
||||
android:text="公交模式B2"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintBottom_toTopOf="@+id/actv_business_charter"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -35,19 +50,34 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/actv_business_bus" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_business_shuttle"
|
||||
android:id="@+id/actv_business_shuttle_B1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/dp_20"
|
||||
android:paddingBottom="@dimen/dp_20"
|
||||
android:gravity="center"
|
||||
android:text="接驳模式"
|
||||
android:text="接驳模式B1"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintBottom_toTopOf="@+id/actv_business_taxi"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/actv_business_charter" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_business_shuttle_B2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/dp_20"
|
||||
android:paddingBottom="@dimen/dp_20"
|
||||
android:gravity="center"
|
||||
android:text="接驳模式B2"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintBottom_toTopOf="@+id/actv_business_taxi"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/actv_business_charter" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_business_taxi"
|
||||
android:layout_width="match_parent"
|
||||
@@ -91,4 +121,4 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/actv_business_sweeper" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user