Questions tagged [swiperefreshlayout]

SwipeRefresLayout is a standard way to implement the common Pull to Refresh pattern in Android.

Description

The SwipeRefreshLayout should be used whenever the user can refresh the contents of a view via a vertical swipe gesture. The activity that instantiates this view should add an OnRefreshListener to be notified whenever the swipe to refresh gesture is completed. The SwipeRefreshLayout will notify the listener each and every time the gesture is completed again; the listener is responsible for correctly determining when to actually initiate a refresh of its content. If the listener determines there should not be a refresh, it must call setRefreshing(false) to cancel any visual indication of a refresh. If an activity wishes to show just the progress animation, it should call setRefreshing(true). To disable the gesture and progress animation, call setEnabled(false) on the view.

Link

Android Developer

685 questions
36
votes
4 answers

SwipeRefreshLayout with scrollView and Layout above

I have the following layout
user3009752
  • 164
  • 2
  • 9
  • 24
34
votes
5 answers
32
votes
4 answers

Inflating class android.support.v4.widget.SwipeRefreshLayout

I am trying to implement SwipeRefreshLayout in fragments. It is looking created correctly, but I continue to get the errors: Caused by: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class…
user10991969
32
votes
5 answers

SwipeRefreshLayout - Pull From Bottom

Is there a way to use SwipeRefreshLayout to refresh ListView when it's pulled from bottom? I created pull from top, but I would also need pull from bottom. There are many tutorials on how to create pull from top, but I couldn't find any tutorials…
user3486440
  • 357
  • 1
  • 3
  • 4
27
votes
4 answers

How to adjust the swipe down distance in SwipeRefreshLayout?

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 height ? Implementation of SwipeRefreshLayout private SwipeRefreshLayout…
Anirudh
  • 2,767
  • 5
  • 69
  • 119
26
votes
2 answers

Is it possible to set the color scheme of SwipeRefreshLayout in XML?

I'm working with SwipeRefreshLayout. I know how to setColorScheme dynamically. Is it possible to set the scheme color attribute of SwipeRefreshLayout in XML?
Huy Tower
  • 7,769
  • 16
  • 61
  • 86
26
votes
6 answers

IllegalArgumentException: pointerIndex out of range from SwipeRefreshLayout

I've been getting some of these IllegalArgumentException: pointerIndex out of range crashes on crashlytics and I don't understand what's happening. It's not limited to one android build or device, it happens on 5.0.1, 4.4.4, 4.4.2, 4.0.4, 2.3.6 all…
MrEngineer13
  • 38,642
  • 13
  • 74
  • 93
24
votes
2 answers

Scrolling down triggers refresh instead of revealing the toolbar

I started using the new CoordinatorLayout and I ran into this issue: As you can see when I try to scroll down when the toolbar is partially visible and the recylcerview is at the top position it triggers the refresh event instead of pulling down…
Longi
  • 3,913
  • 2
  • 28
  • 38
24
votes
1 answer

Android Error inflating class SwipeRefreshLayout

I am working on an App right now that uses 3 tabs with a fragment in each and I am trying to implement SwipeRefreshLayout in each of these fragments. I believe that I have created this correctly, but I continue to get the…
Rbro112
  • 247
  • 1
  • 2
  • 9
18
votes
6 answers

SwipeRefreshLayout in API 21

I previously was using API 19 and was using SwipeRefreshLayout for many of my fragments. When I loaded content for the first time previously, I was using the setRefreshing(true); and was able to load content and it worked fine. I'm noticing in…
KVISH
  • 12,923
  • 17
  • 86
  • 162
18
votes
7 answers

SwiperefreshLayout in Android

i am using SwipeRefreshLayout in my below layout:
17
votes
4 answers

SwipeRefreshLayout intercepts with ViewPager

I have a ViewPager wrapped inside a SwipeRefreshLayout. Sometimes, when I swipe to the left/right the SRL get's triggered. This mostly happens when I'm at the top of my fragment. How do I solve this? Do I need to listen to some kind of event in…
Crosswind
  • 940
  • 1
  • 10
  • 26
17
votes
8 answers

SwipeRefreshLayout refresh animation doesn't stop

I've implemented a fragment which has a SwipeRefreshLayout as content view. Refresh animation is triggered at onRefresh but it never stops even if setRefreshing is set to false after retrieving the data from server. @Override public void…
blavi
  • 531
  • 1
  • 10
  • 26
17
votes
9 answers

Android support v4 SwipeRefreshLayout empty view issue

SwipeRefresh is not working after setting an empty view for listview which is the only child of a SwipeRefresh layout. How to solve this issue?
Dinesh
  • 965
  • 2
  • 11
  • 23
16
votes
1 answer

SwipeRefreshLayout on a LinearLayout?

On a ListView, the SwipeRefreshLayout works fine. However, on a LinearLayout only (without ListView) the behaviour is bizarre. The SwiperefreshLayout's progress bar doesn't appear completely, in fact, it just appears for a fraction of second. What…
vinay vyas
  • 491
  • 1
  • 4
  • 17
1
2
3
45 46