Skip to content

Commit 91efa07

Browse files
ilgazermaskara
authored and
maskara
committed
Made Codacy happy.
1 parent ce63911 commit 91efa07

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

app/src/main/java/fr/free/nrw/commons/explore/images/SearchImageFragment.java

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package fr.free.nrw.commons.explore.images;
22

33

4+
import android.annotation.SuppressLint;
45
import android.content.SharedPreferences;
56
import android.content.res.Configuration;
67
import android.os.Bundle;
@@ -123,6 +124,7 @@ public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
123124
* Checks for internet connection and then initializes the recycler view with 25 images of the searched query
124125
* Clearing imageAdapter every time new keyword is searched so that user can see only new results
125126
*/
127+
@SuppressLint("CheckResult")
126128
public void updateImageList(String query) {
127129
this.query = query;
128130
if (imagesNotFoundView != null) {
@@ -146,6 +148,7 @@ public void updateImageList(String query) {
146148
/**
147149
* Adds more results to existing search results
148150
*/
151+
@SuppressLint("CheckResult")
149152
public void addImagesToList(String query) {
150153
this.query = query;
151154
progressBar.setVisibility(View.VISIBLE);
@@ -163,13 +166,11 @@ public void addImagesToList(String query) {
163166
*/
164167
private void handlePaginationSuccess(List<Media> mediaList) {
165168
progressBar.setVisibility(View.GONE);
166-
if (mediaList.size()!=0){
167-
if (!queryList.get(queryList.size()-1).getFilename().equals(mediaList.get(mediaList.size()-1).getFilename())) {
168-
queryList.addAll(mediaList);
169-
imagesAdapter.addAll(mediaList);
170-
imagesAdapter.notifyDataSetChanged();
171-
((SearchActivity)getContext()).viewPagerNotifyDataSetChanged();
172-
}
169+
if (mediaList.size() != 0 || !queryList.get(queryList.size() - 1).getFilename().equals(mediaList.get(mediaList.size() - 1).getFilename())) {
170+
queryList.addAll(mediaList);
171+
imagesAdapter.addAll(mediaList);
172+
imagesAdapter.notifyDataSetChanged();
173+
((SearchActivity) getContext()).viewPagerNotifyDataSetChanged();
173174
}
174175
}
175176

app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public boolean isDummy() {
7171
this.context = context;
7272
this.mwApi = mwApi;
7373
this.contentResolver = context.getContentResolver();
74-
useExtStorage = prefs.getBoolean("useExternalStorage", true);
74+
useExtStorage = this.prefs.getBoolean("useExternalStorage", true);
7575
}
7676

7777
@SuppressLint("CheckResult")

0 commit comments

Comments
 (0)