2

I'm using SwipeRefreshLayout from appcompact rev22 but i want to know if there is a way to change the area length which i can pull down to show the refresh indicator i don't want it to work over all the screen height is this can be done? Thanks.

Antwan
  • 3,837
  • 9
  • 41
  • 62

1 Answers1

5

Use setDistanceToTriggerSync(int distance) if you're on API 21 +. To get an idea of what magnitude distance should be, if you look at the source code of SwipeRefreshLayout.java the default value is 64 x DisplayMetrics' density.

See answer here: https://stackoverflow.com/a/26580181/6003174

Community
  • 1
  • 1
jaydee713
  • 161
  • 1
  • 2
  • 9
  • setDistanceToTriggerSync(int distance) is to set the value that the swiperefresh layout will start refreshing after it, – Antwan Mar 30 '16 at 04:57