codacy: These nested if statements could be combined

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2019-08-22 16:42:10 +02:00
parent d445be1b5f
commit d2c9e3273f
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 6 additions and 8 deletions

View file

@ -218,11 +218,10 @@ public class ExtendedListFragment extends Fragment implements
handler.postDelayed(new Runnable() {
@Override
public void run() {
if (getActivity() != null && !(getActivity() instanceof FolderPickerActivity)) {
if (getActivity() != null && !(getActivity() instanceof FolderPickerActivity)
&& !(getActivity() instanceof UploadFilesActivity)) {
setFabVisible(!hasFocus);
if (!(getActivity() instanceof UploadFilesActivity)) {
setFabVisible(!hasFocus);
}
}
}
}, 100);

View file

@ -170,11 +170,10 @@ public class PhotoFragment extends OCFileListFragment {
int totalItemCount = gridLayoutManager.getItemCount();
int firstVisibleItem = gridLayoutManager.findFirstCompletelyVisibleItemPosition();
if ((totalItemCount - visibleItemCount) <= (firstVisibleItem + MAX_ITEMS_PER_ROW)) {
if ((totalItemCount - visibleItemCount) <= (firstVisibleItem + MAX_ITEMS_PER_ROW)
&& (totalItemCount - visibleItemCount) > 0) {
// Almost reached the end, continue to load new photos
if ((totalItemCount - visibleItemCount) > 0) {
searchAndDisplay();
}
searchAndDisplay();
}
}
}