[1.0.0]
[feature] [判断是否是M1]
This commit is contained in:
@@ -25,7 +25,7 @@ project.android.productFlavors {
|
||||
buildConfigField 'int', 'GPS_PROVIDER', "1"
|
||||
|
||||
// 构建的应用身份类型,具体查看 README.md APP_IDENTITY_MODE规则
|
||||
buildConfigField 'String', 'APP_IDENTITY_MODE', "\"Bus_Passenger_Base\""
|
||||
buildConfigField 'String', 'APP_IDENTITY_MODE', "\"Bus_Passenger_M1\""
|
||||
// 连接的工控机IP地址
|
||||
buildConfigField 'String', 'ADAS_CONNECT_IP', "\"192.168.8.103\""
|
||||
// 构建的是否是演示(美化)模式
|
||||
|
||||
@@ -25,6 +25,10 @@ object AppIdentityModeUtils {
|
||||
private const val BUS = "Bus"
|
||||
private const val SWEEPER = "Sweeper"
|
||||
|
||||
// 车型
|
||||
private const val M1 = "M1"
|
||||
|
||||
|
||||
|
||||
|
||||
private fun getInfo(appIdentityMode: String): Array<String> {
|
||||
@@ -44,7 +48,7 @@ object AppIdentityModeUtils {
|
||||
@JvmStatic
|
||||
fun isDriver(appIdentityMode: String): Boolean {
|
||||
val (_, identity, _) = getInfo(appIdentityMode)
|
||||
if (!identity.isEmpty()) {
|
||||
if (identity.isNotEmpty()) {
|
||||
return identity == DRIVER
|
||||
}
|
||||
return false
|
||||
@@ -59,7 +63,7 @@ object AppIdentityModeUtils {
|
||||
@JvmStatic
|
||||
fun isPassenger(appIdentityMode: String): Boolean {
|
||||
val (_, identity, _) = getInfo(appIdentityMode)
|
||||
if (!identity.isEmpty()) {
|
||||
if (identity.isNotEmpty()) {
|
||||
return identity == PASSENGER
|
||||
}
|
||||
return false
|
||||
@@ -74,12 +78,21 @@ object AppIdentityModeUtils {
|
||||
@JvmStatic
|
||||
fun isBus(appIdentityMode: String): Boolean {
|
||||
val (bussness, _, _) = getInfo(appIdentityMode)
|
||||
if (!bussness.isEmpty()) {
|
||||
if (bussness.isNotEmpty()) {
|
||||
return bussness == BUS
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun isM1(appIdentityMode: String): Boolean {
|
||||
val (_, _, model) = getInfo(appIdentityMode)
|
||||
if (model.isNotEmpty()) {
|
||||
return model == M1
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是 清扫车(这里不细分具体是:司机、乘客等类型)
|
||||
*
|
||||
@@ -89,7 +102,7 @@ object AppIdentityModeUtils {
|
||||
@JvmStatic
|
||||
fun isSweeper(appIdentityMode: String): Boolean {
|
||||
val (bussness, _, _) = getInfo(appIdentityMode)
|
||||
if (!bussness.isEmpty()) {
|
||||
if (bussness.isNotEmpty()) {
|
||||
return bussness == SWEEPER
|
||||
}
|
||||
return false
|
||||
@@ -104,7 +117,7 @@ object AppIdentityModeUtils {
|
||||
@JvmStatic
|
||||
fun isTaxi(appIdentityMode: String): Boolean {
|
||||
val (bussness, _, _) = getInfo(appIdentityMode)
|
||||
if (!bussness.isEmpty()) {
|
||||
if (bussness.isNotEmpty()) {
|
||||
return bussness == TAXI
|
||||
}
|
||||
return false
|
||||
@@ -155,6 +168,10 @@ object AppIdentityModeUtils {
|
||||
return isTaxi(appIdentityMode) && isPassenger(appIdentityMode)
|
||||
}
|
||||
|
||||
fun isBusPassengerM1(appIdentityMode: String): Boolean {
|
||||
return isBus(appIdentityMode) && isPassenger(appIdentityMode) && isM1(appIdentityMode)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user