Kaynağa Gözat

添加下载状态回调2

zengjiebin 7 yıl önce
ebeveyn
işleme
9411f7f518

+ 3 - 1
app/src/main/java/com/sheep/gamegroup/util/js/BaseActWeb.java

@@ -190,7 +190,9 @@ public abstract class BaseActWeb extends BaseUMActivity {
                     case DOWNLOAD_RUNNING:
                         loadJs(String.format(Locale.CHINA, "onUpdateDownloadStatus(%d)", DownloadUtil.STATUS_ING));
                         try {
-                            String progressText = String.format(Locale.CHINA, "%d%%(%s)", Math.abs(task.getMPercent()), task.getAverageSpeed());//添加下载速度
+                            String btnText = String.format(Locale.CHINA, "%d%%(%s)", Math.abs(task.getMPercent()), task.getAverageSpeed());//添加下载速度
+                            String progressText = String.format(Locale.CHINA, "%d%%", Math.abs(task.getMPercent()));//添加下载速度简单版本
+                            loadJs(String.format(Locale.CHINA, "onUpdateDownloadBtnText('%s')", btnText));
                             loadJs(String.format(Locale.CHINA, "onUpdateDownloadProgress('%s')", progressText));
                         } catch (Exception e) {
                             e.printStackTrace();