fixed download video notification
This commit is contained in:
@@ -89,12 +89,12 @@ public class VideoDownloader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String notificationTitle = "Загрузка видео";
|
String notificationTitle = "Загрузка видео";
|
||||||
String[][] notificationText = {{"Загрузка началась"}};
|
String notificationText = "Загрузка началась";
|
||||||
|
|
||||||
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(AndroidUtils.getGlobalContext(), channelId)
|
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(AndroidUtils.getGlobalContext(), channelId)
|
||||||
.setSmallIcon(R.drawable.ic_download_24)
|
.setSmallIcon(R.drawable.ic_download_24)
|
||||||
.setContentTitle(notificationTitle)
|
.setContentTitle(notificationTitle)
|
||||||
.setContentText(notificationText[0][0])
|
.setContentText(notificationText)
|
||||||
.setProgress(0, 0, true)
|
.setProgress(0, 0, true)
|
||||||
.setOngoing(true);
|
.setOngoing(true);
|
||||||
|
|
||||||
@@ -134,10 +134,9 @@ public class VideoDownloader {
|
|||||||
outputStream.write(buffer, 0, bytesRead);
|
outputStream.write(buffer, 0, bytesRead);
|
||||||
totalBytesRead += bytesRead;
|
totalBytesRead += bytesRead;
|
||||||
int progress = (int) ((totalBytesRead * 100) / fileSize);
|
int progress = (int) ((totalBytesRead * 100) / fileSize);
|
||||||
notificationText[0][0] = "Загружено " + progress + "%";
|
|
||||||
|
|
||||||
notificationBuilder.setProgress(100, progress, false)
|
notificationBuilder.setProgress(100, progress, false)
|
||||||
.setContentText(notificationText[0][0]);
|
.setContentText("Загружено " + progress + "%");
|
||||||
|
|
||||||
notificationManager.notify(notificationId, notificationBuilder.build());
|
notificationManager.notify(notificationId, notificationBuilder.build());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user