From 6659fefc217fec36aeae3e18ae64dff72104d25b Mon Sep 17 00:00:00 2001 From: seven332 Date: Tue, 22 Mar 2016 16:58:49 +0800 Subject: [PATCH] Show require signing in tip in FavoriteScene --- .../com/hippo/ehviewer/client/parser/FavoritesParser.java | 6 ++++++ app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rHK/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 5 files changed, 10 insertions(+) diff --git a/app/src/main/java/com/hippo/ehviewer/client/parser/FavoritesParser.java b/app/src/main/java/com/hippo/ehviewer/client/parser/FavoritesParser.java index e68085343..ab40a7507 100644 --- a/app/src/main/java/com/hippo/ehviewer/client/parser/FavoritesParser.java +++ b/app/src/main/java/com/hippo/ehviewer/client/parser/FavoritesParser.java @@ -16,7 +16,10 @@ package com.hippo.ehviewer.client.parser; +import com.hippo.ehviewer.GetText; +import com.hippo.ehviewer.R; import com.hippo.ehviewer.client.data.GalleryInfo; +import com.hippo.ehviewer.client.exception.EhException; import com.hippo.ehviewer.client.exception.ParseException; import com.hippo.util.JsoupUtils; import com.hippo.yorozuya.AssertUtils; @@ -45,6 +48,9 @@ public class FavoritesParser { @SuppressWarnings("ConstantConditions") public static Result parse(String body) throws Exception { + if (body.contains("This page requires you to log on.

")) { + throw new EhException(GetText.getString(R.string.need_sign_in)); + } String[] catArray = new String[10]; int[] countArray = new int[10]; int current; diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 34aece1ff..da85054c4 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -474,6 +474,7 @@ 让我选择 收藏信息 收藏夹 + 需要登录 被玩坏了 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 69708cc11..df9e5f5ed 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -474,6 +474,7 @@ 讓我選擇 收藏信息 收藏夾 + 需要登錄 被玩壞了 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index a64c90cf7..28b749ec0 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -474,6 +474,7 @@ 讓我選擇 收藏資訊 收藏夾 + 需要登入 被玩壞了 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6df4514d2..616974a6e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -521,6 +521,7 @@ Let me select Favorites info Collections + Signing in is required Something wrong happened