bugfix: error offsetRange if mBottomView == null

This commit is contained in:
cgspine
2021-08-18 14:28:23 +08:00
parent 01391e82f3
commit 65e99758e7
@@ -440,9 +440,12 @@ public class QMUIContinuousNestedScrollLayout extends CoordinatorLayout implemen
}
public int getOffsetRange() {
if (mTopView == null || mBottomView == null) {
if (mTopView == null && mBottomView == null) {
return 0;
}
if(mBottomView == null){
return Math.max(0, ((View) mTopView).getHeight() - getHeight());
}
int contentHeight = mBottomView.getContentHeight();
if (contentHeight != IQMUIContinuousNestedBottomView.HEIGHT_IS_ENOUGH_TO_SCROLL) {
return Math.max(0, ((View) mTopView).getHeight() + contentHeight - getHeight());