1、依赖
implementation 'com.github.zxyUncle:zxyDowloadFile:1.5'
2、自带动态获取权限读写权限,下载的路径在这里/storage/emulated/0/Download/apk/1631086326015.apk
3、一句话开始下载
//开始下载
DowloadFile.init(apkPath, this) { step, isSuccess ->
//step 返回的进度 isSuccess 是否下载失败
}
4、自定义对话框,或者使用demo自带的对话框,更换布局就ok
alertDialogUtils = AlertDialogUtils.build(this)
.setView(R.layout.dialog_button) //必选 设置布局View
.create { view, alertDialogUtils ->
//对点击事件的处理-这里没有
}