Skip to content
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 @@ -251,6 +251,29 @@ public boolean canScroll() {
return !mViewPort.contains(bitmapRect);
}

@Override
public boolean canScrollHorizontally(int direction) {
return canScroll(-direction);
}

@Override
public boolean canScrollVertically(int direction) {
RectF bitmapRect = getBitmapRect();
updateRect( bitmapRect, mScrollRect );
Rect imageViewRect = new Rect();
getGlobalVisibleRect( imageViewRect );

if( null == bitmapRect ) {
return false;
}

if ( bitmapRect.bottom >= imageViewRect.bottom && direction < 0 ) {
return Math.abs( bitmapRect.bottom - imageViewRect.bottom ) > SCROLL_DELTA_THRESHOLD;
}

return Math.abs( bitmapRect.top - mScrollRect.top ) > SCROLL_DELTA_THRESHOLD;
}

/**
* Determines whether this ImageViewTouch can be scrolled.
*
Expand Down