realm / realm-android-adapters

Adapters for combining Realm Java with Android UI components and framework classes
realm.io
Apache License 2.0
414 stars 134 forks source link

Allow changing autoUpdate and updateOnModification in RealmRecyclerViewAdapter #146

Open ridcully99 opened 6 years ago

ridcully99 commented 6 years ago

Goal

I want to be able to turn autoUpdate and updateOnMofification on and off after the RealmRecyclerViewAdapter has alrady been created.

Having that feature allows me to implement Drag & Drop.

For now I cloned the class changed it accordingly, but it would be nice to have it in the original class.

Expected Results

Be able to do something like this:

RealmRecyclerViewAdapter adapter = new RealmRecyclerViewAdapter(data, true, true);
...
adapter.enableAutoUpdates(false, false);
...
adapter.enableAutoUpdates(true, true);