Improve download notifications
This commit is contained in:
@@ -101,8 +101,13 @@ class DownloadNotificationFactory @AssistedInject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
suspend fun create(state: DownloadState?): Notification = mutex.withLock {
|
suspend fun create(state: DownloadState?): Notification = mutex.withLock {
|
||||||
builder.setContentTitle(state?.manga?.title ?: context.getString(R.string.preparing_))
|
if (state == null) {
|
||||||
|
builder.setContentTitle(context.getString(R.string.manga_downloading_))
|
||||||
|
builder.setContentText(context.getString(R.string.preparing_))
|
||||||
|
} else {
|
||||||
|
builder.setContentTitle(state.manga.title)
|
||||||
builder.setContentText(context.getString(R.string.manga_downloading_))
|
builder.setContentText(context.getString(R.string.manga_downloading_))
|
||||||
|
}
|
||||||
builder.setProgress(1, 0, true)
|
builder.setProgress(1, 0, true)
|
||||||
builder.setSmallIcon(android.R.drawable.stat_sys_download)
|
builder.setSmallIcon(android.R.drawable.stat_sys_download)
|
||||||
builder.setContentIntent(queueIntent)
|
builder.setContentIntent(queueIntent)
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ class TimeLeftEstimator {
|
|||||||
emptyTick()
|
emptyTick()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (lastTick?.value == value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
val tick = Tick(value, total, SystemClock.elapsedRealtime())
|
val tick = Tick(value, total, SystemClock.elapsedRealtime())
|
||||||
lastTick?.let {
|
lastTick?.let {
|
||||||
val ticksCount = value - it.value
|
val ticksCount = value - it.value
|
||||||
|
|||||||
Reference in New Issue
Block a user