thorbenprimke / realm-recyclerview Goto Github PK
View Code? Open in Web Editor NEWA RecyclerView that is powered by Realm and lots more
A RecyclerView that is powered by Realm and lots more
When adding this repo to gradle (as described in the README) I get the following error:
Error:Could not GET 'https://jitpack.io/com/github/thorbenprimke/realm-recycler-view/0.9.13/realm-recycler-view-0.9.13.pom'. Received status code 401 from server: Repo not found or no access token provided
Enable Gradle 'offline mode' and sync project
Other repos from jitpack are working fine.
Can you please fix this?
I am using the following code to create a refresh listener
But this works only the first time. When I pull-to-refresh again the onRefresh() method is not called.
Am I doing something wrong.
mForecastRecyclerView.setOnRefreshListener(new RealmRecyclerView.OnRefreshListener() {
@Override public void onRefresh() {
Toast.makeText(activity, "Refreshing", Toast.LENGTH_LONG).show();
// refresh work
mForecastRecyclerView.setRefreshing(false);
}
});
I can't access setLayoutManager()
Do you have ideas to solve this?
Please consider adding Gridview with headers
Hello,
What is the best way to customize headers ?
Thanks
Please update compatibility with respect to the new Realm 0.90.0.
I can't connect this library. When I try to connect with it (compile 'com.github.thorbenprimke:realm-recyclerview:0.9.7') in build.gradle I take error
When I try to find it in maven or anywhere also I have no results.
Hi! Is there any way to get reversed items order (scroll from bottom to top)?
I used setStackFromEnd(true) for LayoutManager, but it is private here..
Android Studio was unable to sync the gradle files of this library.
java.lang.NullPointerException
at com.intellij.openapi.util.io.FileUtilRt.toSystemIndependentName(FileUtilRt.java:207)
The only useful info I could find outside that is that running gradle using the shell wrapper fails at this step: :library:processDebugResources
I'm having a really hard time trying to implement section headers with the realm recycler view.. Is there any chance you could upload an example? I'm looking to create different sections with separate realm queries.
In my app I need to access the recycler view inside the realm recycler view. I am doing this to attach an item touch helper to the recycler view. Is there any way that I can accomplish this?
After adding dependancy along with io.realm dependancy, getting following error.
Error:Execution failed for task ':App:transformClassesWithJarMergingForBetaBuildConfig'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: io/realm/annotations/Ignore.class
hello thorbenprimke,
first of all thank you for your great work, I'm quite new to realm and your library is working quite well for me.
I was wondering if when editing an item I'm supposed to be using notifyItemChanged() (like I would do normally) or there is a better way to do it. Without it the item isn't refreshed automatically.
Will you be supporting the RealmModel interface?
Ok,so even your demo project is crashing with :
Process: co.moonmonkeylabs.realmrecyclerview.example, PID: 24363
java.lang.AbstractMethodError: abstract method "void io.realm.RealmChangeListener.onChange(java.lang.Object)"
at io.realm.RealmResults.notifyChangeListeners(RealmResults.java:1032)
at io.realm.RealmResults.notifyChangeListeners(RealmResults.java:1018)
at io.realm.HandlerController.notifyRealmResultsCallbacks(HandlerController.java:296)
at io.realm.HandlerController.notifySyncRealmResultsCallbacks(HandlerController.java:277)
at io.realm.HandlerController.notifyTypeBasedListeners(HandlerController.java:268)
at io.realm.HandlerController.notifyAllListeners(HandlerController.java:255)
at io.realm.HandlerController.realmChanged(HandlerController.java:378)
at io.realm.HandlerController.handleMessage(HandlerController.java:110)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Are you guyz still maintaining this or what ?
I find the default dismiss callback implementation insufficient for my needs. Is it possible if you can add an option to override the default dismiss callback. This way, we can delete the RealmObject ourselves and will allow us to show a snackbar to the user for a nice action feedback. Thank you.
Crash if inserting place far from visible area.
For repeat exception:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: co.moonmonkeylabs.realmrecyclerview.example, PID: 20150
java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.ViewGroup$LayoutParams android.view.View.getLayoutParams()' on a null object reference
at com.tonicartos.superslim.LayoutManager.getAnchorAtEnd(LayoutManager.java:1038)
at com.tonicartos.superslim.LayoutManager.fillNextSectionToEnd(LayoutManager.java:725)
at com.tonicartos.superslim.LayoutManager.layoutChildren(LayoutManager.java:1369)
at com.tonicartos.superslim.LayoutManager.onLayoutChildren(LayoutManager.java:276)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3028)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2906)
at android.support.v7.widget.RecyclerView.consumePendingUpdateOperations(RecyclerView.java:1482)
at android.support.v7.widget.RecyclerView.access$400(RecyclerView.java:147)
at android.support.v7.widget.RecyclerView$1.run(RecyclerView.java:294)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:603)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
It happen after recyclerview was notified about inserting one element.
This is a feature request actually. How about implementing reordering of items (drag and drop) for the recyclerview?
https://medium.com/@ipaulpro/drag-and-swipe-with-recyclerview-b9456d2b1aaf#.5pm6p02gp
and
https://medium.com/@ipaulpro/drag-and-swipe-with-recyclerview-6a6f0c422efd#.in4t3beg5
and thank you for your great work!
It even has no description on it :(
Hey, was just curious what the best way to go about adding decorations/line separators between each item in the RecyclerView
?
I'm new to Java and Android, so I may be missing another solution that would work better in this situation. But, I came across these examples:
However, in the case of RealmRecyclerView
the addItemDecoration
method is not exposed. My thinking was it could be exposed right about here: https://github.com/thorbenprimke/realm-recyclerview/blob/master/library/src/main/java/co/moonmonkeylabs/realmrecyclerview/RealmRecyclerView.java#L330
I'd be up for forking and adding a wrapper method to expose addItemDecoration
but I am not sure about best practices in terms of variable arguments? Is method overloading the way to go? Or varargs?
Appreciate any help (and thanks for the great library!)
Right before onLoadMore() is triggered, the flag boolean hasLoadMoreFired is set to true to avoid calling this method several times. Problem is its never set to false again so onLoadMore() only is going to be called once.
Since it is a private member, it needs to be exposed so we can set it back to false when we finish the load of more data.
This official realm-adapter repo just got published: https://github.com/realm/realm-android-adapters
With this in mind, will this repo still be supported in the future? Or will these repos merge?
Hi,
updateRealmResults() method raises "java.lang.IllegalArgumentException: Listener should not be null" when RealmBasedRecyclerViewAdapter is initialized with automaticUpdate=false after 0.9.16 update.
What if my items are sorted by modified time, not primary key?
This is (probably) a big change since it Realm has changed to a gradle plugin. I'm starting to upgrade my app to 0.88.2 so as I do that, I'll take a stab at this as well. (Unless @Sirrah wants to!)
Unfortunately none of the other add-ons listed on Realm.io have upgraded to 0.88, so I don't see any similar libraries to cargo cult from.
While using Footers (by addFooter):
The emptyLayout is never shown even when list size is 0.
Another issue I found is when using Headers.
If the list starts from 0 objects and I add objects, let's say by pressing a button, the view does not update and remains empty (with or without an emptyLayout). But when i close and reopen that activity, the list populates, and if we start from a list that already has objects in it, there is no problem. But if I call mRealm.delete(Object.class) and start adding again, the same problems occurs and nothing populates.
Adding header support(Not section headers). I need to create "classic construction list" with header and footer.
Hi @thorbenprimke, i'm having an issue that i'm struggling to figure out with removing the refreshing animation.
Ok so i'll just do a quick explanation of what i'm doing. When the users pulls to refresh i check to see if they have a network connection and if they don't i show an error message along with realmRecyclerView.setRefreshing(false). This works great the first time, the error is shown and the animation gets removed.
But when this is done a second time the animation is endless and the pull to refresh doesn't seem to trigger my onRefreshListener. I'm using an adapter with automatic updates set to true and i wonder if the fact my data has not changed has anything to do with it as i cannot seen why it would be a problem.
I have no such issues with it when i need to remove the animation when i have a network connection and i get data from my api.
Thanks for your hardwork. I'll have a look at the source in the meantime to see if i can find anything.
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.company.suits.yourweek"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:recyclerview-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:support-v4:23.2.1'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'joda-time:joda-time:2.9.2'
compile 'com.github.thorbenprimke:realm-recyclerview:0.9.12'
}
Hello,
I am using RealmRecyclerView in my app, the problem is that the default background of my application is black, and so i can not see the "Loading" text when the recycler is loading more views.
How can one change the text color of the "Loading" text?
With regards,
Hay.
Hi
I make chat-like ui and use your awesome library for creating conversaion list.
How to change ViewHolder type on onCreateRealmViewHolder or onBindRealmViewHolder? Example: recycleview with two type items - recived and sent message view (use different resources).
Could you add method to programmatically change empty layout in RealmRecyclerView?
Hi Thorben, do you have any plans to add staggered grid view support?
Please upgrade to Realm 0.89.0.
In my project I use this versione and now I had this error:
FATAL EXCEPTION:
java.lang.NoSuchMethodError: No virtual method get(I)Lio/realm/RealmObject; in class Lio/realm/RealmResults; or its super classes (declaration of 'io.realm.RealmResults' appears in /data/data/<package>/files/instant-run/dex/slice-io.realm-realm-android-library-0.89.0_1e0e323ab8ec35a6ebf8c8bfff373693aed24725-classes.dex)
at io.realm.RealmBasedRecyclerViewAdapter.getRealmRowId(RealmBasedRecyclerViewAdapter.java:376)
at io.realm.RealmBasedRecyclerViewAdapter.getIdsOfRealmResults(RealmBasedRecyclerViewAdapter.java:367)
at io.realm.RealmBasedRecyclerViewAdapter.updateRealmResults(RealmBasedRecyclerViewAdapter.java:335)
at io.realm.RealmBasedRecyclerViewAdapter.<init>(RealmBasedRecyclerViewAdapter.java:198)
at io.realm.RealmBasedRecyclerViewAdapter.<init>(RealmBasedRecyclerViewAdapter.java:105)
I have an issue coming from this version. I have read the discussion from here. I have got Mutable method call during read transaction
when i try to remove one item from the list.
Everytime i try to set the RealmAdapter i get the following error:
Caused by: java.lang.ArrayIndexOutOfBoundsException: columnIndex is less than 0.
Has anyone gone throught this?
Extending RealmBasedRecyclerViewAdapter
when writing using Kotlin introduces a problem when overriding createHeaderFromColumnValue
because the method is called in the super class constructor. Therefore only hard-coded strings work since any string interpolation is impossible unless you expose the injected context
object from the base class or postpone calling createHeaderFromColumnValue
until later.
e.g.
class DreamRecyclerViewAdapter(val context: Context,
results: RealmResults<Dream>,
automaticUpdate: Boolean,
animateIdType: Boolean,
addSectionHeaders: Boolean = false,
headerColumnName: String? = null) :
RealmBasedRecyclerViewAdapter<Dream, DreamItemViewHolder>(context, results, automaticUpdate, animateIdType, addSectionHeaders, headerColumnName) {
override fun createHeaderFromColumnValue(columnValue: String) = when (columnValue) {
// context is null here because this method is called in super class constructor
// and any value injected will be uninitialized before super constructor has finished.
"accomplished" -> context.getString(R.string.transaction_dream_accomplished_header)
"cancelled" -> context.getString(R.string.transaction_dream_cancelled_header)
else -> context.getString(R.string.transaction_dream_active_header)
}
}
Error:(29, 13) Failed to resolve: com.github.thorbenprimke:realm-recycler-view:0.9.5
Then what min SDK does the project support?
Hi. I tried to make not fixed height recycler view but as I understand RealmRecyclerView class doesn't work with android:layout_height="wrap_content"
. Will you add this feature in the future?
Hello
I have trouble with load more. This method single executed.
Use case:
My implementation of adapter needs a context do decode resources for createHeaderFromColumnValue() implementation
The problem is that this method is called from super RealmBasedRecyclerViewAdapter constructor and I've no way to get it.
Is there any way to customize the section headers?
In realm/realm-java#1982 as crash is reported. One comment mentioned RealmCyclerView
, and it might be appropriate to see if the issue is related to Realm or the cycler view.
Hello
I use realm-recyclerview
And I use .findAllSorted("date", Sort.DESCENDING)
The problem is when I add new Item
well be added in the top but I can see it
I need to scroll up manually
Is there a way to scroll to the top automatically
from realmAdapter or from realmRecyclerview automatically when there is any thing add to the recyclerview
Hello thobenprimke, first of all , awesome efforts put into making something that works with Realm. Since you mentioned "What functionality are you missing? Open a Github issue and let me know." I thought I'd suggest an improvement.
I do notice that the item gets deleted on the screen when you swipe it, though its not that obvious yet. One of the first and simplest improvements you can do is to let people remove items using this https://developer.android.com/reference/android/support/v7/widget/helper/ItemTouchHelper.html from the RecyclerView , Here is a detailed usage guide https://medium.com/@ipaulpro/drag-and-swipe-with-recyclerview-b9456d2b1aaf just in case. I am playing with the samples currently, if I find something I'll let you know. Thanks and keep up the good work
Hey everyone, I'm trying to add a paddind in the top and bottom and use the atribute clipToPadding="false" on xml to prevent my floating Action Button to overlap my RealmRecyclerView's information.
On the RecyclerView it's works okay, but it's don't seems to work on RealmRecyclerView.
It's a bug or I'm doing something wrong?
How we use multi select ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.