From 7e1e4a0f579bc92ae662bb00fa0334c17a7a2cb3 Mon Sep 17 00:00:00 2001 From: seven332 Date: Thu, 21 Mar 2019 15:30:33 +0800 Subject: [PATCH] Only show tips for subscription if no watched tags --- .../com/hippo/ehviewer/client/parser/GalleryListParser.java | 2 ++ .../java/com/hippo/ehviewer/ui/scene/GalleryListScene.java | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/hippo/ehviewer/client/parser/GalleryListParser.java b/app/src/main/java/com/hippo/ehviewer/client/parser/GalleryListParser.java index c2122e207..a1e159227 100644 --- a/app/src/main/java/com/hippo/ehviewer/client/parser/GalleryListParser.java +++ b/app/src/main/java/com/hippo/ehviewer/client/parser/GalleryListParser.java @@ -64,6 +64,7 @@ public class GalleryListParser { public static class Result { public int pages; public int nextPage; + public boolean noWatchedTags; public List galleryInfoList; } @@ -282,6 +283,7 @@ public class GalleryListParser { } } catch (Throwable e) { ExceptionUtils.throwIfFatal(e); + result.noWatchedTags = body.contains("

You do not have any watched tags"); if (body.contains("No hits found

")) { result.pages = 0; //noinspection unchecked 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 263f89a33..8fd1f8157 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 @@ -1453,8 +1453,7 @@ public final class GalleryListScene extends BaseScene private void onGetGalleryListSuccess(GalleryListParser.Result result, int taskId) { if (mHelper != null && mSearchBarMover != null && mHelper.isCurrentTask(taskId)) { - // TODO tell the difference between no result and subscribed tags - String emptyString = getResources2().getString(mUrlBuilder.getMode() == ListUrlBuilder.MODE_SUBSCRIPTION + String emptyString = getResources2().getString(mUrlBuilder.getMode() == ListUrlBuilder.MODE_SUBSCRIPTION && result.noWatchedTags ? R.string.gallery_list_empty_hit_subscription : R.string.gallery_list_empty_hit); mHelper.setEmptyString(emptyString);