@@ -881,7 +881,6 @@ private void loadBookshelf(PagedList<Content> iLibrary) {
881
881
return ;
882
882
}
883
883
884
- // TODO explore using PagedList.Callback instead
885
884
/* We're using PagedList v2.1.1 against the use case it has been designed for (endless lists loaded linearly).
886
885
Doing it right requires the following algorithm :
887
886
@@ -896,7 +895,6 @@ Check if there is unloaded data in the working dataset (iLibrary)
896
895
NB : Case C implementation _is_ quick and hacky (no discussion about that).
897
896
The alternative would be to implement a whole alternate data source for Hentoid paged mode, which is massively more complex
898
897
*/
899
-
900
898
//noinspection Convert2MethodRef need API24
901
899
long nbPlaceholders = Stream .of (iLibrary .subList (minIndex , maxIndex )).filter (c -> c == null ).count ();
902
900
Timber .d (">> nb placeholders : %s" , nbPlaceholders );
@@ -996,6 +994,7 @@ private void onLibraryChanged(PagedList<Content> result) {
996
994
if (Preferences .getEndlessScroll ()) {
997
995
pagedItemAdapter .submitList (result , this ::differEndCallback );
998
996
} else {
997
+
999
998
if (newSearch ) pager .setCurrentPage (1 );
1000
999
pager .setPageCount ((int ) Math .ceil (result .size () * 1.0 / Preferences .getContentPageQuantity ()));
1001
1000
minLoadedBound = Integer .MAX_VALUE ;
@@ -1039,8 +1038,7 @@ private void updateTitle(long totalSelectedCount, long totalCount) {
1039
1038
private boolean onBookClick (ContentItem item , int position ) {
1040
1039
if (0 == selectExtension .getSelectedItems ().size ()) {
1041
1040
if (!invalidateNextBookClick ) {
1042
- topItemPosition = position ;
1043
- // unObserveAll();
1041
+ topItemPosition = position ; // TODO - still useful ?
1044
1042
ContentHelper .openHentoidViewer (requireContext (), item .getContent (), viewModel .getSearchManagerBundle ());
1045
1043
} else invalidateNextBookClick = false ;
1046
1044
@@ -1138,7 +1136,7 @@ private void differEndCallback() {
1138
1136
Timber .i (">> differEnd::current vs. memorized %s / %s" , currentPosition , topItemPosition );
1139
1137
if (currentPosition != topItemPosition ) {
1140
1138
Timber .i (">> differEnd::scrolling to last memorized position : %s" , topItemPosition );
1141
- // llm.scrollToPositionWithOffset(topItemPosition, 0);
1139
+ // llm.scrollToPositionWithOffset(topItemPosition, 0); // TODO - enable or delete the whole method
1142
1140
topItemPosition = -1 ;
1143
1141
}
1144
1142
}
0 commit comments