I implemented SwipeRefreshLayout in my app. I need to change the height which has to be scrolled down to call onRefresh() method. Which method should I use to add a custom h
Currently there isn't a public method, or even an internal one for that matter, that can be used to adjust the trigger distance. But you can copy over the three classes from the support library into your project, then modify SwipeRefreshLayout
to your liking.
Here are the classes you'll need to copy over:
The tigger distance is calculated using the constants:
private static final float MAX_SWIPE_DISTANCE_FACTOR = .6f;
private static final int REFRESH_TRIGGER_DISTANCE = 120;
In your layout change
to
and make sure you change your imports, if you need to.