From 4c1da3575b97c0042904909a32200ba24aaf6986 Mon Sep 17 00:00:00 2001 From: Mohamed Ezzat Date: Wed, 29 Jun 2016 15:31:41 +0200 Subject: [PATCH] Cleanup - squid:S1155 - Collection.isEmpty() should be used to test for emptiness (#371) --- .../viewer/pager/vertical/VerticalViewPagerImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/vertical/VerticalViewPagerImpl.java b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/vertical/VerticalViewPagerImpl.java index 60b1d21026..8f50151e21 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/vertical/VerticalViewPagerImpl.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/vertical/VerticalViewPagerImpl.java @@ -530,7 +530,7 @@ public class VerticalViewPagerImpl extends ViewGroup { setScrollingCacheEnabled(false); return; } - if (!always && mCurItem == item && mItems.size() != 0) { + if (!always && mCurItem == item && !mItems.isEmpty()) { setScrollingCacheEnabled(false); return; } @@ -1676,7 +1676,7 @@ public class VerticalViewPagerImpl extends ViewGroup { } private boolean pageScrolled(int ypos) { - if (mItems.size() == 0) { + if (mItems.isEmpty()) { mCalledSuper = false; onPageScrolled(0, 0, 0); if (!mCalledSuper) { @@ -2258,7 +2258,7 @@ public class VerticalViewPagerImpl extends ViewGroup { targetPage = (int) (currentPage + pageOffset + truncator); } - if (mItems.size() > 0) { + if (!mItems.isEmpty()) { final ItemInfo firstItem = mItems.get(0); final ItemInfo lastItem = mItems.get(mItems.size() - 1); @@ -2315,7 +2315,7 @@ public class VerticalViewPagerImpl extends ViewGroup { super.onDraw(canvas); // Draw the margin drawable between pages if needed. - if (mPageMargin > 0 && mMarginDrawable != null && mItems.size() > 0 && mAdapter != null) { + if (mPageMargin > 0 && mMarginDrawable != null && !mItems.isEmpty() && mAdapter != null) { final int scrollY = getScrollY(); final int height = getHeight();