@Override protected View initView() { View view = View.inflate(UIUtils.getContext(), R.layout.item_app_info, null); // View注入 ViewUtils.inject(this, view); // 设置点击事件 mPcvProgress.setOnClickListener(this); mDownloadManager = DownloadManager.getInstance(); // 初始化 return view; }
/** 检查下载状态 */ public void checkDownloadState() { mDownloadBean = DownloadManager.getInstance().getCurrentState(mData); safeRefreshView(mDownloadBean); }
/** 暂停 */ private void doPause() { mDownloadManager.pause(mData); }
/** 打开 */ private void doOpen() { mDownloadManager.open(mData); }
/** 安装 */ private void doInstall() { mDownloadManager.install(mData); }
/** 下载 */ private void doDownload() { mDownloadManager.download(mData); }