启动页面优化
This commit is contained in:
@@ -41,38 +41,41 @@ class InitActivity : BaseActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
statusBarDarkFont(enable = true)
|
||||
// useBackground(false)
|
||||
binding = ActivityInitBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
setHeaderBackground(isHomePage = true)
|
||||
|
||||
// 获取 ANDROID_ID
|
||||
var androidId =
|
||||
Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID)
|
||||
androidId = "39a7abdd06b3c7ab"
|
||||
BaseApp.deviceId = androidId
|
||||
SpTool.put(SpTool.DEVICE_ID, androidId)
|
||||
BaseApp.configUrl = UrlConfig.BASE_URL
|
||||
BaseApp.canteenId = "0"
|
||||
// TODO: 以上保存deviceId用于临时使用,后续改为下面注释方式
|
||||
// setHeaderBackground(isHomePage = true)
|
||||
setHeaderBgVisible(false)
|
||||
|
||||
// var deviceId = AppUtil.getUDID(this)
|
||||
// Log.d(TAG, "onCreate: deviceId=$deviceId")
|
||||
//// deviceId = "39a7abdd06b3c7ab"
|
||||
//// deviceId = "3ea47dc0-3cf0-3c2f-909c-265a9a65572e"
|
||||
//// deviceId = "6ce7cd59-b875-38b2-b73d-88a570be3212"
|
||||
//
|
||||
// BaseApp.deviceId = deviceId
|
||||
//
|
||||
// SpTool.put(SpTool.DEVICE_ID, deviceId)
|
||||
// val deviceConfigCache = SpTool.getString(SpTool.DEVICE_CONFIG_CACHE)
|
||||
// val checkResult = checkConfigData(deviceConfigCache)
|
||||
// if (checkResult.not()) {
|
||||
// binding.ivQrCode.visible()
|
||||
// binding.btnInit.visible()
|
||||
// //进行初始化操作
|
||||
// initConfig()
|
||||
// return
|
||||
// }
|
||||
// // 获取 ANDROID_ID
|
||||
// var androidId =
|
||||
// Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID)
|
||||
// androidId = "39a7abdd06b3c7ab"
|
||||
// BaseApp.deviceId = androidId
|
||||
// SpTool.put(SpTool.DEVICE_ID, androidId)
|
||||
// BaseApp.configUrl = UrlConfig.BASE_URL
|
||||
// BaseApp.canteenId = "0"
|
||||
// // TODO: 以上保存deviceId用于临时使用,后续改为下面注释方式
|
||||
|
||||
var deviceId = AppUtil.getUDID(this)
|
||||
Log.d(TAG, "onCreate: deviceId=$deviceId")
|
||||
// deviceId = "39a7abdd06b3c7ab"
|
||||
deviceId = "3ea47dc0-3cf0-3c2f-909c-265a9a65572e"
|
||||
// deviceId = "6ce7cd59-b875-38b2-b73d-88a570be3212"
|
||||
|
||||
BaseApp.deviceId = deviceId
|
||||
|
||||
SpTool.put(SpTool.DEVICE_ID, deviceId)
|
||||
val deviceConfigCache = SpTool.getString(SpTool.DEVICE_CONFIG_CACHE)
|
||||
val checkResult = checkConfigData(deviceConfigCache)
|
||||
if (checkResult.not()) {
|
||||
binding.ivQrCode.visible()
|
||||
binding.btnInit.visible()
|
||||
//进行初始化操作
|
||||
initConfig()
|
||||
return
|
||||
}
|
||||
|
||||
binding.ivQrCode.invisible()
|
||||
binding.btnInit.invisible()
|
||||
|
||||
Reference in New Issue
Block a user