Code Monkey home page Code Monkey logo

realm-recyclerview's People

Contributors

4xes avatar allsimon avatar callmepeanut avatar carlbenson avatar dereklucas avatar dkpalmer avatar donnfelker avatar eyecreate avatar fabioranieri avatar jkreiser avatar lujop avatar mplacona avatar papjohn24 avatar sirrah avatar skhaz avatar thorbenprimke avatar vitas avatar xoex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

realm-recyclerview's Issues

Pull-to-refresh only works once.

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);
        }
    });

Cannot connect

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.

can not build library

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

Section headers?

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.

getRecyclerView method?

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?

notifyItemChanged() question

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.

AbstractMethodError

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 ?

Enhancement: Option to override default dismiss callback

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 when adding "Belgium" in section example

Crash if inserting place far from visible area.
For repeat exception:

  1. Open "SEСTION HEADER LAYOUT EXAMPLE"
  2. Scroll to D.
  3. Click "ADD BELGIUM"
  4. See crash.
 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.

How to access addItemDecoration (To add line separators)?

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!)

hasLoadMoreFired never set back to false after loading more

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.

Upgrade Realm to 0.88.X

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.

EmptyLayout issues while using Footers and/or Headers

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.

Add header

Adding header support(Not section headers). I need to create "classic construction list" with header and footer.

Remove refreshing animation

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.

build error

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'
}

Change Loading text color (when enabling loadmore)

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.

How to change ViewHolder type?

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).

upgrade to Realm 0.89.0

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)

0.87.5

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.

Remove Pull Animation and make Setting Item Background working

(1) I am setting my recycler item background to this: android:background="?attr/selectableItemBackground". But it doesnt work when I click on one item.

(2) I am getting an animation when I am pulling down from the top but I havent set it refreshable. How can I turn this off?

pull

columnIndex is less than 0.

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?

Cannot customize header names overriding createHeaderFromColumnValue

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 at the dependencies

Error:(29, 13) Failed to resolve: com.github.thorbenprimke:realm-recycler-view:0.9.5

Then what min SDK does the project support?

LoadMore

Hello
I have trouble with load more. This method single executed.

Store context or expose it as a protected field or method

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 a way to scroll to the top when I add new Item in the top

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

A better swipe to delete

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

clipToPadding="false" Is not working.

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.