Skip to content

Commit fea8ddb

Browse files
macgillsashishkumar468
authored andcommitted
commons-app#3763 IllegalArgumentException at fetchImagesForDepictedItem - pass entityId in (commons-app#3764)
1 parent 2cbf827 commit fea8ddb

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

app/src/main/java/fr/free/nrw/commons/depictions/Media/DepictedImagesContract.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ interface UserActionListener extends BasePresenter<View> {
9090

9191
/**
9292
* Fetches more images for the item and adds it to the grid view adapter
93+
* @param entityId
9394
*/
94-
void fetchMoreImages();
95+
void fetchMoreImages(String entityId);
9596

9697
/**
9798
* fetch captions for the image using filename and replace title of on the image thumbnail(if captions are available)

app/src/main/java/fr/free/nrw/commons/depictions/Media/DepictedImagesFragment.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCoun
136136
if (!NetworkUtils.isInternetConnectionEstablished(getContext())) {
137137
handleNoInternet();
138138
} else {
139-
presenter.fetchMoreImages();
139+
presenter.fetchMoreImages(entityId);
140140
}
141141
}
142142
if (isLastPage) {

app/src/main/java/fr/free/nrw/commons/depictions/Media/DepictedImagesPresenter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public class DepictedImagesPresenter implements DepictedImagesContract.UserActio
3939
* Wikibase enitityId for the depicted Item
4040
* Ex: Q9394
4141
*/
42-
private String entityId = null;
4342
private List<Media> queryList = new ArrayList<>();
4443

4544
@Inject
@@ -79,10 +78,11 @@ public void initList(String entityId) {
7978

8079
/**
8180
* Fetches more images for the item and adds it to the grid view adapter
81+
* @param entityId
8282
*/
8383
@SuppressLint("CheckResult")
8484
@Override
85-
public void fetchMoreImages() {
85+
public void fetchMoreImages(String entityId) {
8686
view.progressBarVisible(true);
8787
compositeDisposable.add(depictsClient.fetchImagesForDepictedItem(entityId, queryList.size())
8888
.subscribeOn(ioScheduler)

0 commit comments

Comments
 (0)