Giter VIP home page Giter VIP logo

Comments (7)

thorbenprimke avatar thorbenprimke commented on June 28, 2024

I actually followed that same article as an inspiration for the swipe to dismiss.

Drag and drop should be possible but you would have to have a "order" field on the Realm object so that once a field is dragged around, the underlaying data structure can be updated as well as that the order is persisted between data/screen views.

@kmare - Do you usually have a "order" field in your data structure for this? If so, that should make it possible.
This would be a pretty cool feature to add.

from realm-recyclerview.

kmare avatar kmare commented on June 28, 2024

I haven't really started yet working on that feature, but yeah.. I plan on adding an "order" field. I don't think it's possible to (realistically) implement it any other way. Following the mentioned tutorial/links I actually implemented it on a few non-realm (sqlite) projects with custom logic just fine. Unfortunately, I don't think I'll have much time to implement it any time soon for realm-recyclerview, but if I do, I'll gladly send a pull request.

from realm-recyclerview.

thorbenprimke avatar thorbenprimke commented on June 28, 2024

@kmare - sounds good. Yea, I'll see if I can maybe tackle this on the weekend. Should be pretty straight forward as long as I can manage drag/drop updates and realmUpdates. One solution for that might be to turn off Realm updates while the user is dragging items around. Anyhow, I'll dig into it. I'll update this thread once I start working on it so that we don't execute on it in parallel.

Do you have a use-case / would utilize it in one of your apps?

from realm-recyclerview.

kmare avatar kmare commented on June 28, 2024

Unfortunately I'll probably have time to work on it in a couple of weeks during the christmas period anyway. Right now I'm not really using realm in a real world project. I'm mainly evaluating it in different use cases for future projects I'd like to work on. So nothing serious at the moment. For now I just built a note/google-keep like app (I know, very original..), adding features just to see what I'd be missing from realm that I wouldn't with normal sqlite operations. So far, I'm not exactly happy with the migration part of realm, but it looks like they're re-implementing it anyway.
Thanks again for your work, it's much appreciated!

from realm-recyclerview.

astigsen avatar astigsen commented on June 28, 2024

you would have to have a "order" field on the Realm object so that once a field is dragged around, the underlaying data structure can be updated as well as that the order is persisted

It would be really nice if you could just use a RealmList (which is intrinsically ordered) instead of a query result.

It even has a nice move() method to reorder entries: https://realm.io/docs/java/latest/api/io/realm/RealmList.html#move-int-int-

from realm-recyclerview.

rohan2817 avatar rohan2817 commented on June 28, 2024

I have a field basis on which I need to sort the list, this field changes on user action rather drag and drop, but changing the order at run time adding one more extra element also randomly replacing other elements. Thought this issue is relevant here.

from realm-recyclerview.

edgardowardo avatar edgardowardo commented on June 28, 2024

Hi I wondered if anyone started working on this feature?

from realm-recyclerview.

Related Issues (20)

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.