diff --git a/app/src/main/java/com/hippo/ehviewer/ui/CommonOperations.java b/app/src/main/java/com/hippo/ehviewer/ui/CommonOperations.java index bf4d7a385..92cdfe52c 100644 --- a/app/src/main/java/com/hippo/ehviewer/ui/CommonOperations.java +++ b/app/src/main/java/com/hippo/ehviewer/ui/CommonOperations.java @@ -37,6 +37,7 @@ import com.hippo.ehviewer.client.data.GalleryInfo; import com.hippo.ehviewer.dao.DownloadLabel; import com.hippo.ehviewer.download.DownloadManager; import com.hippo.ehviewer.download.DownloadService; +import com.hippo.ehviewer.ui.scene.BaseScene; import com.hippo.text.Html; import com.hippo.yorozuya.FileUtils; @@ -216,7 +217,7 @@ public final class CommonOperations { client.execute(request); } - public static void startDownload(final Activity activity, final GalleryInfo galleryInfo, boolean forceDefault) { + public static void startDownload(final MainActivity activity, final GalleryInfo galleryInfo, boolean forceDefault) { final DownloadManager dm = EhApplication.getDownloadManager(activity); boolean justStart = forceDefault || dm.containDownloadInfo(galleryInfo.gid); @@ -239,6 +240,8 @@ public final class CommonOperations { intent.putExtra(DownloadService.KEY_LABEL, label); intent.putExtra(DownloadService.KEY_GALLERY_INFO, galleryInfo); activity.startService(intent); + // Notify + activity.showTip(R.string.added_to_download_list, BaseScene.LENGTH_SHORT); } else { // Let use chose label List list = dm.getLabelList(); @@ -274,6 +277,8 @@ public final class CommonOperations { } else { Settings.putHasDefaultDownloadLabel(false); } + // Notify + activity.showTip(R.string.added_to_download_list, BaseScene.LENGTH_SHORT); } }, activity.getString(R.string.remember_download_label), false) .setTitle(R.string.download) diff --git a/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.java b/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.java index cf5810c7c..44bb16baf 100644 --- a/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.java +++ b/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.java @@ -74,6 +74,7 @@ import com.hippo.ehviewer.client.parser.RateGalleryParser; import com.hippo.ehviewer.dao.DownloadInfo; import com.hippo.ehviewer.ui.CommonOperations; import com.hippo.ehviewer.ui.GalleryActivity; +import com.hippo.ehviewer.ui.MainActivity; import com.hippo.ehviewer.ui.annotation.WholeLifeCircle; import com.hippo.rippleold.RippleSalon; import com.hippo.scene.Announcer; @@ -986,7 +987,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene } else if (mDownload == v) { GalleryInfo galleryInfo = getGalleryInfo(); if (galleryInfo != null) { - CommonOperations.startDownload(getActivity(), galleryInfo, false); + CommonOperations.startDownload((MainActivity) getActivity(), galleryInfo, false); } } else if (mRead == v) { GalleryInfo galleryInfo = null; @@ -1102,7 +1103,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene if (mDownload == v) { GalleryInfo galleryInfo = getGalleryInfo(); if (galleryInfo != null) { - CommonOperations.startDownload(getActivity(), galleryInfo, true); + CommonOperations.startDownload((MainActivity) getActivity(), galleryInfo, true); } return true; } diff --git a/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryListScene.java b/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryListScene.java index ce867e1ef..c1ac6c0ec 100644 --- a/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryListScene.java +++ b/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryListScene.java @@ -67,6 +67,7 @@ import com.hippo.ehviewer.client.data.ListUrlBuilder; import com.hippo.ehviewer.client.parser.GalleryListParser; import com.hippo.ehviewer.dao.QuickSearch; import com.hippo.ehviewer.ui.CommonOperations; +import com.hippo.ehviewer.ui.MainActivity; import com.hippo.ehviewer.widget.SearchBar; import com.hippo.ehviewer.widget.SearchLayout; import com.hippo.rippleold.RippleSalon; @@ -645,7 +646,7 @@ public final class GalleryListScene extends BaseScene public void onClick(DialogInterface dialog, int which) { switch (which) { case 0: // Download - CommonOperations.startDownload(getActivity(), gi, false); + CommonOperations.startDownload((MainActivity) getActivity(), gi, false); break; case 1: // Favorites CommonOperations.addToFavorites(getActivity(), gi, diff --git a/app/src/main/java/com/hippo/ehviewer/ui/scene/HistoryScene.java b/app/src/main/java/com/hippo/ehviewer/ui/scene/HistoryScene.java index 1d1453733..27e2deff2 100644 --- a/app/src/main/java/com/hippo/ehviewer/ui/scene/HistoryScene.java +++ b/app/src/main/java/com/hippo/ehviewer/ui/scene/HistoryScene.java @@ -39,6 +39,7 @@ import com.hippo.ehviewer.client.EhUtils; import com.hippo.ehviewer.client.data.GalleryInfo; import com.hippo.ehviewer.dao.HistoryInfo; import com.hippo.ehviewer.ui.CommonOperations; +import com.hippo.ehviewer.ui.MainActivity; import com.hippo.rippleold.RippleSalon; import com.hippo.scene.Announcer; import com.hippo.scene.SceneFragment; @@ -174,7 +175,7 @@ public class HistoryScene extends ToolbarScene public void onClick(DialogInterface dialog, int which) { switch (which) { case 0: // Download - CommonOperations.startDownload(getActivity(), gi, false); + CommonOperations.startDownload((MainActivity) getActivity(), gi, false); break; case 1: // Favorites CommonOperations.addToFavorites(getActivity(), gi, diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index c45e0988f..b4423112c 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -254,6 +254,7 @@ %1$s,剩余 %2$s 记住下载标签 默认下载标签 + 已添加至下载列表 这里是下载标签 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index df14570e4..d899a4967 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -254,6 +254,7 @@ %1$s,剩餘 %2$s 記住下載標籤 默認下載標籤 + 已添加至下載列表 這裏是下載標籤 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 284282e41..425b63539 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -254,6 +254,7 @@ %1$s,剩餘 %2$s 記住下載標籤 預設下載標籤 + 已新增至下載列表 這裡是下載標籤 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c61df6e3b..a628cada1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -294,6 +294,7 @@ %1$s, %2$s left Remember download label Default download label + Added to download list Download labels will be shown here