[2.14.0][Opt]地图缓存功能交互优化

This commit is contained in:
chenfufeng
2023-02-13 18:32:46 +08:00
parent fc7732e8f5
commit d37737d956
3 changed files with 10 additions and 3 deletions

View File

@@ -55,6 +55,8 @@ class SystemVersionView @JvmOverloads constructor(
private var previousProgress: Int = -1 //前一秒的下载进度,用于计算下载剩余时间
private var currentProgress: Int = -1 //当前已下载包体大小
private var isHDCached = false
init {
LayoutInflater.from(context).inflate(R.layout.view_system_version, this, true)
initView()
@@ -141,7 +143,11 @@ class SystemVersionView @JvmOverloads constructor(
}
ivHDCache.setOnClickListener {
OfflineMapDialog(context).show()
if (isHDCached) {// 已缓存
ToastUtils.showShort(resources.getString(R.string.offline_had_downloaded))
} else {// 未缓存
OfflineMapDialog(context).show()
}
}
updateHDDataCacheStatus(CallerMapUIServiceManager.isCityDataCached())
@@ -253,11 +259,10 @@ class SystemVersionView @JvmOverloads constructor(
fun updateHDDataCacheStatus(isCached: Boolean) {
if (isCached) {
ivHDCacheStatus?.setImageResource(R.drawable.icon_latest_version)
ivHDCache.isEnabled = false
} else {
ivHDCacheStatus?.setImageResource(R.drawable.icon_be_updated)
ivHDCache.isEnabled = true
}
isHDCached = isCached
}
/**

View File

@@ -70,6 +70,7 @@
<string name="offline_downloading">离线地图下载中</string>
<string name="offline_download_success">离线地图下载成功</string>
<string name="offline_download_failure">离线地图下载失败</string>
<string name="offline_had_downloaded">当前已为最新版本</string>
<string name="ok_tip">确定</string>
<string name="retry">重试</string>
</resources>