Support favorites prev page load
This commit is contained in:
1 parent
dae8f21388
commit
3e4836c91e
2 files changed
+15
-1
No files matched your search
@@ -837,6 +837,7 @@ public class FavoritesScene extends BaseScene implements
|
||||
else
|
||||
pages = Integer.MAX_VALUE;
|
||||
|
||||
mHelper.prevPg = result.prevPage;
|
||||
mHelper.nextPg = result.nextPage;
|
||||
mHelper.onGetPageData(taskId, pages, mHelper.pgCounter + 1, result.galleryInfoList);
|
||||
|
||||
@@ -1158,6 +1159,7 @@ public class FavoritesScene extends BaseScene implements
|
||||
|
||||
private class FavoritesHelper extends GalleryInfoContentHelper {
|
||||
public int pgCounter = 0;
|
||||
public String prevPg = null;
|
||||
public String nextPg = null;
|
||||
|
||||
@Override
|
||||
@@ -1219,7 +1221,15 @@ public class FavoritesScene extends BaseScene implements
|
||||
final String keyword = mUrlBuilder.getKeyword();
|
||||
SimpleHandler.getInstance().post(() -> onGetFavoritesLocal(keyword, taskId));
|
||||
} else {
|
||||
mUrlBuilder.setNext(jumpTo == null ? nextPg : Integer.toString(minGid));
|
||||
String prevPage = null, nextPage = null;
|
||||
if (page != 0) {
|
||||
if (page >= mHelper.getPageForTop())
|
||||
nextPage = nextPg;
|
||||
else
|
||||
prevPage = prevPg;
|
||||
}
|
||||
mUrlBuilder.setPrev(prevPage);
|
||||
mUrlBuilder.setNext(jumpTo == null ? nextPage : Integer.toString(minGid));
|
||||
|
||||
mUrlBuilder.setJumpTo(jumpTo);
|
||||
jumpTo = null;
|
||||
@@ -1295,12 +1305,14 @@ public class FavoritesScene extends BaseScene implements
|
||||
@Override
|
||||
protected void beforeRefresh() {
|
||||
super.beforeRefresh();
|
||||
prevPg = null;
|
||||
nextPg = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Parcelable saveInstanceState(Parcelable superState) {
|
||||
Bundle bundle = (Bundle) super.saveInstanceState(superState);
|
||||
bundle.putString(KEY_PREV_PAGE, prevPg);
|
||||
bundle.putString(KEY_NEXT_PAGE, nextPg);
|
||||
return bundle;
|
||||
}
|
||||
@@ -1308,6 +1320,7 @@ public class FavoritesScene extends BaseScene implements
|
||||
@Override
|
||||
protected Parcelable restoreInstanceState(Parcelable state) {
|
||||
Bundle bundle = (Bundle) state;
|
||||
prevPg = bundle.getString(KEY_PREV_PAGE);
|
||||
nextPg = bundle.getString(KEY_NEXT_PAGE);
|
||||
return super.restoreInstanceState(state);
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@ abstract class GalleryInfoContentHelper : ContentHelper<GalleryInfo?>() {
|
||||
private const val KEY_DATA_MAP = "data_map"
|
||||
private const val KEY_MAX_GID = "max_gid"
|
||||
private const val KEY_MIN_GID = "min_gid"
|
||||
const val KEY_PREV_PAGE = "prev_page"
|
||||
const val KEY_NEXT_PAGE = "next_page"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user