Separate scroll and swipe views in SwipeRefreshLayout
Add a new view that gets tracked by SwipeRefreshLayout. This allows
SwipeRefreshLayout to have a full scrollable single child, but have the actual
view that gets dragged down be separate from the only single child. This is
useful for situations where there is a scroll view that has anchored headers
or footers. The progress bar is additionally moved down so that it's the top
anchor for the swipe view that is getting dragged downward.
The swipe view is specified by exposing a setTarget() method that takes in the
resource id of the view to become draggable.
This change is backwards compatible in that if setTarget() is not called,
it will default to having both the scroll and swipe view point
to the same view that is the single child of the SwipeRefreshLayout.
Change-Id: I346405656dba5c5435124763a92de7d42ddda685
2 files changed