修改任务下载

This commit is contained in:
squallzhjch
2023-07-27 11:16:36 +08:00
parent 01bc6ac7fc
commit 2b4b2645a6
5 changed files with 30 additions and 5 deletions

View File

@@ -83,6 +83,12 @@ class TaskDownloadManager constructor(
* 只有等待中的任务和正在下载中的任务才可以进行暂停操作
*/
fun pause(id: Int) {
if (scopeMap.containsKey(id)) {
val downloadScope = scopeMap[id]
downloadScope?.let {
downloadScope.pause()
}
}
if (taskScopeMap.containsKey(id)) {
val downloadScope = taskScopeMap[id]
downloadScope?.let {

View File

@@ -60,8 +60,12 @@ class TaskDownloadScope(
fun pause() {
downloadJob?.cancel("pause")
launch {
if (taskBean.fileSize == 0L) {
change(FileDownloadStatus.NONE)
} else {
change(FileDownloadStatus.PAUSE)
}
}
}

View File

@@ -449,7 +449,7 @@ class MainViewModel @Inject constructor(
)
if(itemList.size == 1){
SignUtil.getSignNameText(itemList[0])
}
}
}

View File

@@ -306,7 +306,11 @@ class TaskListAdapter(
binding.taskProgressText.text =
"$progress%"
binding.taskDownloadBtn.setProgress(progress)
} else {
binding.taskDownloadBtn.setProgress(0)
binding.taskProgressText.text = ""
}
when (taskBean.status) {
FileDownloadStatus.NONE -> {
if (binding.taskProgressText.visibility == View.VISIBLE) binding.taskProgressText.visibility =

View File

@@ -80,6 +80,8 @@ class SignUtil {
2008 -> "种别"
//道路方向
2010 -> "方向"
//车道边界类型
2013 -> "车道边界类型"
//常规线限速
2019 -> "线限速"
//车道数
@@ -404,7 +406,16 @@ class SignUtil {
return stringBuffer.toString()
}
/**
* 获取车道边界线详细信息
*/
fun getLaneBoundaryInfo(data:RenderEntity){
}
/**
* 获取道路名列表
*/
fun getRoadNameList(data: RenderEntity): MutableList<RoadNameBean> {
val list = mutableListOf<RoadNameBean>()
if (data.code == 2011) {