From d7572f5a79332a0c9b5b0f55fa0eb7a0ed529572 Mon Sep 17 00:00:00 2001 From: tarsin Date: Thu, 3 Nov 2022 15:48:35 +0800 Subject: [PATCH] Fix restore state --- .../java/com/hippo/ehviewer/client/data/ListUrlBuilder.java | 1 + .../com/hippo/ehviewer/widget/GalleryInfoContentHelper.java | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/app/src/main/java/com/hippo/ehviewer/client/data/ListUrlBuilder.java b/app/src/main/java/com/hippo/ehviewer/client/data/ListUrlBuilder.java index 6b63be806..7a11c1803 100644 --- a/app/src/main/java/com/hippo/ehviewer/client/data/ListUrlBuilder.java +++ b/app/src/main/java/com/hippo/ehviewer/client/data/ListUrlBuilder.java @@ -108,6 +108,7 @@ public class ListUrlBuilder implements Cloneable, Parcelable { public void reset() { mMode = MODE_NORMAL; mNextGid = 0; + mPrevGid = 0; mCategory = EhUtils.NONE; mKeyword = null; mAdvanceSearch = -1; diff --git a/app/src/main/java/com/hippo/ehviewer/widget/GalleryInfoContentHelper.java b/app/src/main/java/com/hippo/ehviewer/widget/GalleryInfoContentHelper.java index 8241cd7b1..bcf2393f0 100644 --- a/app/src/main/java/com/hippo/ehviewer/widget/GalleryInfoContentHelper.java +++ b/app/src/main/java/com/hippo/ehviewer/widget/GalleryInfoContentHelper.java @@ -35,6 +35,8 @@ public abstract class GalleryInfoContentHelper extends ContentLayout.ContentHelp public int minGid = -1; private static final String KEY_DATA_MAP = "data_map"; + private static final String KEY_MAX_GID = "max_gid"; + private static final String KEY_MIN_GID = "min_gid"; private final FavouriteStatusRouter.Listener listener; @SuppressLint("UseSparseArrays") private Map map = new HashMap<>(); @@ -98,6 +100,8 @@ public abstract class GalleryInfoContentHelper extends ContentLayout.ContentHelp FavouriteStatusRouter router = EhApplication.getFavouriteStatusRouter(); int id = router.saveDataMap(map); bundle.putInt(KEY_DATA_MAP, id); + bundle.putInt(KEY_MIN_GID, minGid); + bundle.putInt(KEY_MAX_GID, maxGid); return bundle; } @@ -114,6 +118,8 @@ public abstract class GalleryInfoContentHelper extends ContentLayout.ContentHelp this.map = map; } } + minGid = bundle.getInt(KEY_MIN_GID); + maxGid = bundle.getInt(KEY_MAX_GID); return super.restoreInstanceState(state); }