Skip to content
This repository has been archived by the owner on Oct 15, 2018. It is now read-only.

Fix the pull happening when the top element is not shown #234

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,10 @@ private boolean isFirstItemVisible() {
* now we'll just add one to account for it and rely on the inner
* condition which checks getTop().
*/
if (mRefreshableView.getFirstVisiblePosition() <= 1) {
if ((null == mIndicatorIvTop && mRefreshableView.getFirstVisiblePosition() == 0) ||
(null != mIndicatorIvTop && mRefreshableView.getFirstVisiblePosition() <= 1)) {
final View firstVisibleChild = mRefreshableView.getChildAt(0);
if (firstVisibleChild != null) {
if (firstVisibleChild != null && firstVisibleChild != mIndicatorIvTop) {
return firstVisibleChild.getTop() >= mRefreshableView.getTop();
}
}
Expand Down Expand Up @@ -423,10 +424,11 @@ private boolean isLastItemVisible() {
* account for it and rely on the inner condition which checks
* getBottom().
*/
if (lastVisiblePosition >= lastItemPosition - 1) {
if ((null == mIndicatorIvBottom && lastVisiblePosition == lastItemPosition) ||
(null != mIndicatorIvBottom && lastVisiblePosition >= lastItemPosition - 1)) {
final int childIndex = lastVisiblePosition - mRefreshableView.getFirstVisiblePosition();
final View lastVisibleChild = mRefreshableView.getChildAt(childIndex);
if (lastVisibleChild != null) {
if (lastVisibleChild != null && lastVisibleChild != mIndicatorIvBottom) {
return lastVisibleChild.getBottom() <= mRefreshableView.getBottom();
}
}
Expand Down