|
29 | 29 | import butterknife.ButterKnife;
|
30 | 30 | import fr.free.nrw.commons.Media;
|
31 | 31 | import fr.free.nrw.commons.R;
|
| 32 | +import fr.free.nrw.commons.category.CategoryImagesCallback; |
32 | 33 | import fr.free.nrw.commons.auth.SessionManager;
|
33 | 34 | import fr.free.nrw.commons.bookmarks.Bookmark;
|
34 | 35 | import fr.free.nrw.commons.bookmarks.pictures.BookmarkPicturesContentProvider;
|
35 | 36 | import fr.free.nrw.commons.bookmarks.pictures.BookmarkPicturesDao;
|
36 |
| -import fr.free.nrw.commons.category.CategoryDetailsActivity; |
37 |
| -import fr.free.nrw.commons.category.CategoryImagesActivity; |
38 | 37 | import fr.free.nrw.commons.contributions.Contribution;
|
39 | 38 | import fr.free.nrw.commons.di.CommonsDaggerSupportFragment;
|
40 |
| -import fr.free.nrw.commons.explore.SearchActivity; |
41 |
| -import fr.free.nrw.commons.explore.categories.ExploreActivity; |
42 | 39 | import fr.free.nrw.commons.kvstore.JsonKvStore;
|
43 | 40 | import fr.free.nrw.commons.utils.ImageUtils;
|
44 | 41 | import fr.free.nrw.commons.utils.NetworkUtils;
|
@@ -332,28 +329,9 @@ public void onPageScrolled(int i, float v, int i2) {
|
332 | 329 | Timber.d("Returning as activity is destroyed!");
|
333 | 330 | return;
|
334 | 331 | }
|
335 |
| - if (i+1 >= adapter.getCount()){ |
336 |
| - try{ |
337 |
| - ((CategoryImagesActivity) getContext()).requestMoreImages(); |
338 |
| - }catch (Exception e){ |
339 |
| - e.printStackTrace(); |
340 |
| - } |
341 |
| - try{ |
342 |
| - ((CategoryDetailsActivity) getContext()).requestMoreImages(); |
343 |
| - }catch (Exception e){ |
344 |
| - e.printStackTrace(); |
345 |
| - } |
346 |
| - try{ |
347 |
| - ((SearchActivity) getContext()).requestMoreImages(); |
348 |
| - }catch (Exception e){ |
349 |
| - e.printStackTrace(); |
350 |
| - } |
351 |
| - try{ |
352 |
| - ((ExploreActivity) getContext()).requestMoreImages(); |
353 |
| - }catch (Exception e){ |
354 |
| - e.printStackTrace(); |
355 |
| - } |
356 |
| - } |
| 332 | + if (i+1 >= adapter.getCount()) |
| 333 | + ((CategoryImagesCallback) getContext()).requestMoreImages(); |
| 334 | + |
357 | 335 | getActivity().invalidateOptionsMenu();
|
358 | 336 | }
|
359 | 337 |
|
|
0 commit comments