Comments (3)
For the second issue (the empty view not being removed when the RealmRecyclerView goes from 0 -> 1 objects), I can confirm from my tests that View.GONE is being set correctly (see snippet below) but for some reason it does not hide the view in the UI. I'm still trying to figure out what is causing this.
private void updateEmptyContentContainerVisibility(RecyclerView.Adapter adapter) {
if (emptyViewId == 0) {
return;
}
emptyContentContainer.setVisibility(
adapter.getItemCount() == 0 ? View.VISIBLE : View.GONE);
}
from realm-recyclerview.
Unfortunately I have not been able to find a solution for this yet.
I've checked that the snippet above runs on the UI thread (it does) and also I've tried clearing any animations on the view as these coukd interfere with View.GONE
The issue is only for type LinearLayoutWithHeaders (and footers). I can't really see what is causing this bug comparing it with the other layout types.
Any help (or pointers of other things for me to try) would be greatly appreciated as currently this bug is a blocker for me to release an app using this feature.
from realm-recyclerview.
The problem is in RealmBasedRecyclerViewAdapter, it is caused by updateRowWrappers() not being called by the RealmBasedRecyclerViewAdapter if there are no ids in the collection.
To fix them problem requires a small change in the method getRealmChangeListener()
The following code should be change from
return new RealmChangeListener<OrderedRealmCollection<T>>() {
@Override
public void onChange(OrderedRealmCollection<T> element) {
if (animateResults && ids != null && !ids.isEmpty()) {
updateRowWrappers();
...
} else {
...
}
}
...
}
to
return new RealmChangeListener<OrderedRealmCollection<T>>() {
@Override
public void onChange(OrderedRealmCollection<T> element) {
updateRowWrappers();
if (animateResults && ids != null && !ids.isEmpty()) {
...
} else {
...
}
}
...
}
from realm-recyclerview.
Related Issues (20)
- 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
- 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
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.