Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

通知栏的百分比进度没有显示,demo和依赖库都一样,是我姿势不对吗 #39

Closed
MannaYang opened this issue May 31, 2019 · 3 comments

Comments

@MannaYang
Copy link

@OverRide
public void downloading(int max, int progress) {
LogUtil.i(TAG, "max: " + max + " --- progress: " + progress);
if (showNotification) {
//优化通知栏更新,减少通知栏更新次数
int curr = (int) (progress / (double) max * 100.0);
if (curr != lastProgress) {
lastProgress = curr;
String downloading = getResources().getString(R.string.start_downloading);
NotificationUtil.showProgressNotification(this, smallIcon, downloading, "", max, progress);
}
}
if (listener != null) {
listener.downloading(max, progress);
}
}


int curr = (int) (progress / (double) max * 100.0);
if (curr != lastProgress)
这个地方的百分比转换是不是有点小问题

@azhon
Copy link
Owner

azhon commented May 31, 2019 via email

@MannaYang
Copy link
Author

1.能在通知栏添加暂停下载、和继续下载的功能吗?2.下载任务加入线程调度池,下次启动应用继续断点下载? 现在1的应用场景是要能保证网络随意切换,下载进度不受影响, 2的场景是提醒用户去处理之前的下载任务,现在看到demo里面是下一次检查更新,然后下载时取之前的进度继续下载,但是是从0跳到之前的百分比,能否直接显示之前已经下载的进度,能否优化下这个功能?

@azhon
Copy link
Owner

azhon commented Jun 1, 2019

第一个肯定不行,涉及适配问题,投入产出比划不来,
第二个,现在不就是从上次的百分比开始显示的吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants