-
Notifications
You must be signed in to change notification settings - Fork 337
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
Comments
通知栏百分比进度,还没有发布版本,只是先还好了,你可以参考github源代码------------------ 原始邮件 ------------------
发件人: "RWXJH"<notifications@github.com>
发送时间: 2019年5月31日(星期五) 下午2:42
收件人: "azhon/AppUpdate"<AppUpdate@noreply.github.com>;
抄送: "Subscribed"<subscribed@noreply.github.com>;
主题: [azhon/AppUpdate] 通知栏的百分比进度没有显示,demo和依赖库都一样,是我姿势不对吗 (#39)
@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)
这个地方的百分比转换是不是有点小问题
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
1.能在通知栏添加暂停下载、和继续下载的功能吗?2.下载任务加入线程调度池,下次启动应用继续断点下载? 现在1的应用场景是要能保证网络随意切换,下载进度不受影响, 2的场景是提醒用户去处理之前的下载任务,现在看到demo里面是下一次检查更新,然后下载时取之前的进度继续下载,但是是从0跳到之前的百分比,能否直接显示之前已经下载的进度,能否优化下这个功能? |
第一个肯定不行,涉及适配问题,投入产出比划不来, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@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)
这个地方的百分比转换是不是有点小问题
The text was updated successfully, but these errors were encountered: