增加离线地图下载流程

This commit is contained in:
squallzhjch
2023-03-30 10:50:20 +08:00
parent 97a48237ba
commit 3a80a4ee5d
129 changed files with 1590 additions and 13847 deletions

View File

@@ -0,0 +1,6 @@
package com.navinfo.omqs.bean
data class LoginUserBean(
var username: String = "",
var password: String = ""
)

View File

@@ -0,0 +1,32 @@
package com.navinfo.omqs.bean
data class OfflineMapCityBean(
val id: String,
val fileName: String,
val name: String,
val url: String,
val version: Long,
val fileSize: Long,
var currentSize:Long = 0,
var status:Int = NONE
) {
companion object Status{
const val NONE = 0 //无状态
const val WAITING = 1 //等待中
const val LOADING = 2 //下载中
const val PAUSE = 3 //暂停
const val ERROR = 4 //错误
const val DONE = 5 //完成
const val UPDATE = 6 //有新版本要更新
}
fun getFileSizeText(): String {
return if (fileSize < 1024.0)
"$fileSize B"
else if (fileSize < 1048576.0)
"%.2f K".format(fileSize / 1024.0)
else if (fileSize < 1073741824.0)
"%.2f M".format(fileSize / 1048576.0)
else
"%.2f M".format(fileSize / 1073741824.0)
}
}