Add stop all action in download notification

This commit is contained in:
seven332 committed 2016-02-26 20:40:08 +08:00
1 parent 7b604146f1
commit bfe1853bb5
5 files changed
+9 -1

No files matched your search

@@ -173,12 +173,16 @@ public class DownloadService extends Service implements DownloadManager.Download
return;
}
Intent stopAllIntent = new Intent(this, DownloadService.class);
stopAllIntent.setAction(ACTION_STOP_ALL);
PendingIntent piStopAll = PendingIntent.getService(this, 0, stopAllIntent, 0);
mDownloadingBuilder = new NotificationCompat.Builder(getApplicationContext())
.setSmallIcon(android.R.drawable.stat_sys_download)
.setOngoing(true)
.setAutoCancel(false)
.setCategory(NotificationCompat.CATEGORY_PROGRESS)
.setColor(getResources().getColor(R.color.colorPrimary));
.setColor(getResources().getColor(R.color.colorPrimary))
.addAction(R.drawable.ic_stop_x24, getString(R.string.stat_download_action_stop_all), piStopAll);
}
private void ensureDownloadedBuilder() {
@@ -190,6 +190,7 @@
<string name="download_remove_dialog_title">移除画廊</string>
<string name="download_remove_dialog_message">从下载列表移除 %s ?</string>
<string name="download_remove_dialog_check_text">删除图片文件</string>
<string name="stat_download_action_stop_all">全部停止</string>
<!-- Gallery Activity -->
<string name="page_menu_title">第 %d 页</string>
@@ -190,6 +190,7 @@
<string name="download_remove_dialog_title">移除畫廊</string>
<string name="download_remove_dialog_message">從下載列表移除 %s ?</string>
<string name="download_remove_dialog_check_text">刪除圖片文件</string>
<string name="stat_download_action_stop_all">全部停止</string>
<!-- Gallery Activity -->
<string name="page_menu_title">第 %d 頁</string>
@@ -190,6 +190,7 @@
<string name="download_remove_dialog_title">移除畫廊</string>
<string name="download_remove_dialog_message">從下載列表移除 %s ?</string>
<string name="download_remove_dialog_check_text">刪除圖片檔案</string>
<string name="stat_download_action_stop_all">全部停止</string>
<!-- Gallery Activity -->
<string name="page_menu_title">第 %d 頁</string>
+1
View File
@@ -230,6 +230,7 @@
<string name="download_remove_dialog_title">Remove Gallery</string>
<string name="download_remove_dialog_message">Remove %s from download list ?</string>
<string name="download_remove_dialog_check_text">Delete image files</string>
<string name="stat_download_action_stop_all">Stop All</string>
<!-- Gallery Activity -->
<string name="page_menu_title">Page %d</string>