felipecsl/QuickReturn

In ScrollView the bottom QuickReturn target doesn't disappear

Closed this issue · 2 comments

In the ScrollView option, only the top QuickReturn target appears and disappears. The bottom QuickReturn target stays as it is.

The solution to this is to add to add to file ScrollViewQuickReturnAttacher.java in function addTargetView the line:
scrollView.setOnScrollListener(onScrollListener);

and to comment out in ScrollViewScrollTarget.java in the constructor ScrollViewScrollTarget the line-
//scrollView.setOnScrollListener(this);

Then the bottom QuickReturn target appears and disappears.
This is because in upon scrolling onScrollChanged is triggered in ObservableScrollView.java. This way control is passed to CompositeOnScrollListener.java/onScrollChanged which iterates through the top and bottom QuickReturnTarget's and makes them disappear and reappear respectively. Previously, from ObservableScrollView.java controll was being passed directly on ScrollViewScrollTarget.java's onScrollChanged which was being called just once on the top QuickReturnTargetView

fixed. thanks!