Comments (4)
Hi Mike, did you breakpoint the code and see the setRefreshing(false) was being called?
I have done a little bit of digging as I had the same problem too. From what I can see is the code for the SwipeRefreshLayout.OnRefreshListener in RealmRecyclerView (hidden at the very bottom of the file) does not turn off the refreshing if the onRefreshListener is null.
If you do have a onRefreshListener set then make sure that it does actually call setRefreshing(false) at the expected time.
I think a solution would be to update the listener as below:
recyclerViewRefreshListener = new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
if (!isRefreshing) {
if (onRefreshListener == null) {
swipeRefreshLayout.setRefreshing(false);
} else {
// listener is in charge of calling setRefreshing(false)
onRefreshListener.onRefresh();
isRefreshing = true;
}
}
}
};
from realm-recyclerview.
Ok so i figured out that the realmRecyclerView.setRefreshing(false) is happening too quickly in my code.
I'm guessing it is something to do with the animation only just starting and the speed at which the listener is triggered causing it to not be set to false correctly during the first call.
By adding a delay of 2 seconds to call realmRecyclerView.setRefreshing(false) the refresh animation removes successfully each time.
from realm-recyclerview.
have the same issue, something wrong with it.
I have empty adapter, by first refresh it works, by second attempt - endless refreshing animation.
from realm-recyclerview.
Hi @JamesMcIntosh,
Unfortunately the project i was doing this for has taken a back seat but it will come back around eventually. What you've written seems to make sense and I'll try and see if I can throw this in the project this weekend and confirm your solution. Thanks for posting, it's much appreciated.
from realm-recyclerview.
Related Issues (20)
- Is it possible to animate RealmRecycleView when i change sort directional?
- example app ArrayIndexOutOfBoundsException: rowIndex > available rows: 2 > 2
- Realm recycler view not refreshing on first insert HOT 1
- How to Make Recycler View show rows from bottom HOT 1
- java.lang.NullPointerException null object reference in Fragment
- Can I group by any field? HOT 1
- Please update to Realm Java 3.0.0
- Can't create a RealmRecycleView Programmatically
- Realm Recyclerview not working with Realm 3.5.0 HOT 1
- Error:(39, 14) Failed to resolve: com.github.thorbenprimke:realm-recyclerview:0.9.25 HOT 1
- Doesn't work with android studio 3.0
- How can we get the LayoutManager? HOT 2
- Enable swipe to delete only in one direction?
- Need to draw background with an icon when the user swipes an item
- Fatal signal 11 while deleting object from Realm
- How to scroll to position not softly?
- how to fire loadmore after fetching and showing every 100 records from realm HOT 1
- Issues When Having Multiple View Types HOT 1
- Attempting to use Realm-recyclerview with Object Server.... HOT 4
- Size APK HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from realm-recyclerview.