|
|
@@ -4,6 +4,7 @@ import android.app.Activity;
|
|
|
import android.content.Intent;
|
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
+import android.text.TextUtils;
|
|
|
import android.view.View;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.ProgressBar;
|
|
|
@@ -33,10 +34,12 @@ import com.sheep.gamegroup.view.fragment.BaseListFragment6;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.ClassFileHelper;
|
|
|
+import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
|
|
|
|
|
|
import org.afinal.simplecache.ApiKey;
|
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
|
|
|
|
+import java.io.File;
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
@@ -164,8 +167,8 @@ public class FgtDownloadManager extends BaseListFragment6<String> {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
+ updateView(getActivity(), item, item_dm_btn_tv, item_dm_pb, item_dm_info_tv);
|
|
|
|
|
|
- updateView(getActivity(), item, item_dm_btn_tv);
|
|
|
}
|
|
|
};
|
|
|
appFormGameCenterAdapter = new AdpGameCenter4_3(apiRefresh2.getList());
|
|
|
@@ -271,16 +274,23 @@ public class FgtDownloadManager extends BaseListFragment6<String> {
|
|
|
|
|
|
|
|
|
//更新按钮状态与添加点击事件
|
|
|
- private void updateView(Activity activity, DownLoadInfo item, TextView textView) {
|
|
|
+ private void updateView(Activity activity, DownLoadInfo item, TextView textView, ProgressBar progressBar, TextView completeView) {
|
|
|
DownloadInfoHelper downloadInfoHelper = downloadInfoHelperMap.get(item.getMDownloadUrl());
|
|
|
if (downloadInfoHelper == null) {
|
|
|
downloadInfoHelper = new DownloadInfoHelper(item);
|
|
|
downloadInfoHelperMap.put(item.getMDownloadUrl(), downloadInfoHelper);
|
|
|
downloadInfoHelperMap.put(item.getMPackageName(), downloadInfoHelper);
|
|
|
- downloadInfoHelper.updateDownloadTaskView(activity, textView);
|
|
|
- } else {
|
|
|
- downloadInfoHelper.updateDownloadTaskView(activity, textView);
|
|
|
}
|
|
|
+ downloadInfoHelper.updateDownloadTaskView(activity, textView);
|
|
|
+ downloadInfoHelper.getDownloadStatus(downloadUtil, (o)->{
|
|
|
+ if (o instanceof Integer) {
|
|
|
+ int st = (int) o;
|
|
|
+ if(st == DownloadUtil.STATUS_FINISH){
|
|
|
+ progressBar.setProgress(100);
|
|
|
+ ViewUtil.setText(completeView, "全部下载完成");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private AbsGetDownloadListener absGetDownloadListener = new AbsGetDownloadListener(true) {
|