Coder Social home page Coder Social logo

Comments (10)

davideas avatar davideas commented on September 21, 2024

Hello @danielpassos, during the development I also thought to divide the listeners, but in the end I opted for 1 only. I can separate them again now.
But I will not remove the parameter from the constructor because it's easier for a developer (the adapter can do these assignments for him), because changing the signature will change the current implementation of hundreds of people, because developers don't know the internal names of the listeners and they have to check the adapter code.

from flexibleadapter.

danielpassos avatar danielpassos commented on September 21, 2024

because changing the signature will change the current implementation of hundreds of people

I agree with that, I'll put it back in my PR, but pass a Object in the contructor seems wrong to me. Maybe deprecate that and create a new one or only deprecate that to remove in future releases. wdyt?

from flexibleadapter.

davideas avatar davideas commented on September 21, 2024

Wait to change the PR.
Also I was thinking that the method startUndoTimer can accept the listener for confirmation of deletion: basically it's only in that occasion and it is not necessary to have listener as member but can be kept as final parameter.

from flexibleadapter.

danielpassos avatar danielpassos commented on September 21, 2024

Wait to change the PR.

Done. I put it back as @deprecated but leave the example app using the new one

Also I was thinking that the method startUndoTimer can accept the listener for confirmation of deletion: basically it's only in that occasion and it is not necessary to have listener as member but can be kept as final parameter.

Not sure if I got you point here.

from flexibleadapter.

davideas avatar davideas commented on September 21, 2024

I mean to pass the listener to this function:

public void startUndoTimer(final OnDeleteCompleteListener listener, long timeout) {
    mHandler = new Handler(Looper.getMainLooper(), new Handler.Callback() {
            public boolean handleMessage(Message message) {
                if (listener != null) listener.onDeleteConfirmed();
                ...
            }
        });
    ...
}

from flexibleadapter.

danielpassos avatar danielpassos commented on September 21, 2024

Gotcha. Must better and done! :)

from flexibleadapter.

davideas avatar davideas commented on September 21, 2024

@danielpassos, so about OnUpdateListener, I am not sure to keep it, because after all I don't see a big advantage of an Asynchronous loading: usually the list is already loaded Asynchronously somewhere else.
I wanted a suggestion from you.

from flexibleadapter.

danielpassos avatar danielpassos commented on September 21, 2024

I totally agree with you but we need to keep in mind it will broke the old project/compatibility. I know it's sucks, but it's a library and what we do in libraries/frameworks is:

  1. Make it as deprecated
  2. Update the docs
  3. Announce in some place we are about to remove it.
  4. In a new version bumping MAJOR (see the semver) and remove it. It make clear for the developers we broke the compatibility.

from flexibleadapter.

davideas avatar davideas commented on September 21, 2024

Indeed it will break compatibility, but before release as major version, I wanted to add new functionalities, such as animation on loading. I already know how to do it, maybe multi ViewHolder, fix the way how ItemAnimator are used, use or import a nice SearchView, that I have identified, in the example App.
So your changes will not be released soon, and we have time to inform ppl about these deprecation.
In the meantime I have to work also on others projects...
Thanks for the suggestion.

from flexibleadapter.

danielpassos avatar danielpassos commented on September 21, 2024

You can release a small version bumping MINOR with the new listeners or for every new feature you add, and than release a new one with a new big improvement/removing deprecation bumping the MAJOR

from flexibleadapter.

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.