优化默认值
This commit is contained in:
@@ -51,9 +51,9 @@ class DeviceInitActivity : BaseActivity<ActivityDeviceInitBinding>() {
|
||||
withContext(Dispatchers.Default) {
|
||||
//val count = FaceApi().queryFaceCount()
|
||||
//if (count == 0) {
|
||||
if (SpTool.getFirstGetFace()) {
|
||||
if (SpTool.firstGetFace) {
|
||||
userViewModel.getUserFaceCache { status, msg ->
|
||||
SpTool.setFirstGetFace(false)
|
||||
SpTool.firstGetFace = false
|
||||
getDeviceConfig()
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.sw.inbound.utils.SPUtil
|
||||
import com.sw.inbound.utils.SPUtil.Companion.getInstance
|
||||
import com.sw.platecabinet.MyApp
|
||||
import com.sw.platecabinet.model.response.EquipmentUserInfo
|
||||
import kotlin.text.get
|
||||
|
||||
object SpTool {
|
||||
const val LAST_FACE_TIMESTAMP: String = "faceTimestamp"
|
||||
@@ -42,9 +43,10 @@ object SpTool {
|
||||
return GsonUtils.fromJsonList(jsonData, EquipmentUserInfo::class.java)
|
||||
}
|
||||
|
||||
fun getFirstGetFace() = spUtil?.get(IS_FIRST_GET_FACE, true)?:true
|
||||
fun setFirstGetFace(state: Boolean) {
|
||||
spUtil?.boolean(IS_FIRST_GET_FACE, state)
|
||||
}
|
||||
var firstGetFace: Boolean
|
||||
get() = spUtil?.get(IS_FIRST_GET_FACE, true)?:true
|
||||
set(value) {
|
||||
spUtil?.boolean(IS_FIRST_GET_FACE, value)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user