mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-09-10 14:43:13 +02:00
Cleanup - squid:S1155 - Collection.isEmpty() should be used to test for emptiness (#371)
This commit is contained in:
parent
05c0516a57
commit
4c1da3575b
@ -530,7 +530,7 @@ public class VerticalViewPagerImpl extends ViewGroup {
|
|||||||
setScrollingCacheEnabled(false);
|
setScrollingCacheEnabled(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!always && mCurItem == item && mItems.size() != 0) {
|
if (!always && mCurItem == item && !mItems.isEmpty()) {
|
||||||
setScrollingCacheEnabled(false);
|
setScrollingCacheEnabled(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1676,7 +1676,7 @@ public class VerticalViewPagerImpl extends ViewGroup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean pageScrolled(int ypos) {
|
private boolean pageScrolled(int ypos) {
|
||||||
if (mItems.size() == 0) {
|
if (mItems.isEmpty()) {
|
||||||
mCalledSuper = false;
|
mCalledSuper = false;
|
||||||
onPageScrolled(0, 0, 0);
|
onPageScrolled(0, 0, 0);
|
||||||
if (!mCalledSuper) {
|
if (!mCalledSuper) {
|
||||||
@ -2258,7 +2258,7 @@ public class VerticalViewPagerImpl extends ViewGroup {
|
|||||||
targetPage = (int) (currentPage + pageOffset + truncator);
|
targetPage = (int) (currentPage + pageOffset + truncator);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mItems.size() > 0) {
|
if (!mItems.isEmpty()) {
|
||||||
final ItemInfo firstItem = mItems.get(0);
|
final ItemInfo firstItem = mItems.get(0);
|
||||||
final ItemInfo lastItem = mItems.get(mItems.size() - 1);
|
final ItemInfo lastItem = mItems.get(mItems.size() - 1);
|
||||||
|
|
||||||
@ -2315,7 +2315,7 @@ public class VerticalViewPagerImpl extends ViewGroup {
|
|||||||
super.onDraw(canvas);
|
super.onDraw(canvas);
|
||||||
|
|
||||||
// Draw the margin drawable between pages if needed.
|
// 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 scrollY = getScrollY();
|
||||||
final int height = getHeight();
|
final int height = getHeight();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user