Merge branch 'dev_arch_opt_3.0' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_arch_opt_3.0

This commit is contained in:
lixiaopeng
2023-02-21 18:33:36 +08:00
30 changed files with 326 additions and 247 deletions

View File

@@ -60,8 +60,8 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
leftView?.setOnClickListener {
when {
isConfirm -> {
cacheHDOfflineData()
showNewContent(isLoading = true, false)
cacheHDOfflineData()
}
else -> {
dismiss()
@@ -72,6 +72,7 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
rightView?.setOnClickListener {
when {
isRetry -> {
showNewContent(isLoading = true, false)
cacheHDOfflineData()
}
else -> {
@@ -81,6 +82,9 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
}
okView?.setOnClickListener {
if (isLoading) {
CallerMapUIServiceManager.cancelDownloadCacheData()
}
dismiss()
}
}
@@ -90,6 +94,12 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
updateProgress(progress.toInt())
}
override fun onMapHdCacheResult(cityId: Int, state: Int) {
if (state == 0) {// 失败
showNewContent(isLoading = false, false)
}
}
})
}
@@ -131,6 +141,7 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
@SuppressLint("UseCompatLoadingForDrawables")
private fun showNewContent(isLoading: Boolean, isSuccess: Boolean) {
this.isLoading = isLoading
change2NewStyle()
when {
isLoading -> {
@@ -150,11 +161,14 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
downloadResultImg?.background = ContextCompat.getDrawable(context, R.drawable.download_success_icon)
}
else -> {
isRetry = true
isConfirm = false
offlineTitleView?.text = context.resources.getString(R.string.offline_download_failure)
okView?.visibility = View.GONE
progressBar?.visibility = View.GONE
downloadPercentView?.visibility = View.GONE
leftView?.visibility = View.VISIBLE
leftView?.text = context.resources.getString(R.string.ok_tip)
rightView?.visibility = View.VISIBLE
vertLineView?.visibility = View.VISIBLE
rightView?.text = context.resources.getString(R.string.retry)