Open jakubkrolewski opened 8 years ago
I've managed to fix the problem by adding the following code to the ObservableScrollView
`
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
trimScrollY();
}
private void trimScrollY() {
View child = getChildAt(0);
if (child != null) {
int childHeight = child.getHeight();
int verticalSpaceForChild = getHeight() - getPaddingTop() - getPaddingBottom();
int maxScrollY = Math.max(0, childHeight - verticalSpaceForChild);
mScrollY = Math.min(mScrollY, maxScrollY);
}
}
`
Expected result: the view is not scrolled, so the output of the getCurrentScrollY() method should be 0 Actual result: getCurrentScrollY() method returns the previously stored value (so 123 as in the point 4)