Git Product home page Git Product logo

Comments (11)

slidenerd avatar slidenerd commented on July 19, 2024

Some from my end as well

  1. a swipe to refresh at the bottom , probably instead of the load more,.
    testgif

2)this effect when you try to do swipe to refresh at the top where you are able to drag the recycler to a bit and then it bounces back to its original place

from ultimaterecyclerview.

cymcsg avatar cymcsg commented on July 19, 2024

@Zeliret Thank you very much for giving advice.

I think the 2,3,4 suggestions are very useful and I try to add these in next version of the library.
I'm a little confused about the first suggestion.What the function swapAdapter() do?

Thanks.

from ultimaterecyclerview.

cymcsg avatar cymcsg commented on July 19, 2024

@slidenerd Thank you very much.
In fact, the suggestion 2 is what I am doing now as I said in the ReadMe Colorful style of Swipe to refresh so I think you will see the feature in 0.3.0 of UltimateRecyclerview.

However,for the suggestion 1 which said a swipe to refresh at the bottom , probably instead of the load more I think the loading more has more situations to be used than swiping to refresh at the bottom. So I don't think it is a good idea to instead of loading but I can manage to set it as a option to choose.

from ultimaterecyclerview.

Zeliret avatar Zeliret commented on July 19, 2024

@cymcsg There are two methods (setAdapter and swapAdapter) in the RecyclerView.
They both call the same internal method but with one little exception. With swapAdapter u can change current adapter with a new one without recreating viewholders if they both are compatible (instances of the same class). When u do this the RecyclerView will animate all changes between both adapters.
Actually the swapAdapter method is a better way to change all data at once. Instead of using something like clear+add(array[]) u can just create a new adapter and set it =)

from ultimaterecyclerview.

slidenerd avatar slidenerd commented on July 19, 2024

There is one thing though, the SwipeToDismiss listener may often be used to delete an item say from a database or a cloud store, if the deletion in the backend is successful then the swipe to dismiss in the front end makes sense, but if in the backend, the delete operation fails for some reason, is it possible to bring the item back in the front end, perhaps a simpe callback that will be triggered where the item is restored and the user can do something about it?

from ultimaterecyclerview.

cymcsg avatar cymcsg commented on July 19, 2024

@Zeliret OK. As I thought you mean more than the default method so I want to know more about this.Now I see what you mean. I'll add this method in next version.Thank you.

from ultimaterecyclerview.

Zeliret avatar Zeliret commented on July 19, 2024

@cymcsg Thank you! I'll look forward to it.

from ultimaterecyclerview.

cymcsg avatar cymcsg commented on July 19, 2024

@slidenerd Good idea! I'll try to achieve the effect but maybe a little longer time. So if you like you can help to implement.

from ultimaterecyclerview.

cymcsg avatar cymcsg commented on July 19, 2024

Thank you for giving these useful advise.
But I wonder why do you deleted them.

2015-03-19 22:45 GMT+08:00 Artem Shalaev [email protected]:

Hi @cymcsg https://github.com/cymcsg! A few additions from me:

  1. Proxy method for addOnItemTouchListener. It is a little bit ugly to
    use myList.mRecyclerView.addOnItemTouchListener =)
  2. Helper methods for the UltimateViewAdapter for example:

public abstract class SimpleAdapter extends UltimateViewAdapter {
protected final ArrayList items = new ArrayList<>();

public void add(final T item) {
    int index = items.size();
    items.add(item);
    notifyItemInserted(index);
}

public void remove(final int position) {
    items.remove(position);
    notifyItemRemoved(position);
}

public void remove(final T item) {
    int position = items.indexOf(item);
    remove(position);
}

public void replace(final T[] newItems) {
    clear();
    items.addAll(Arrays.asList(newItems));
    notifyItemRangeInserted(0, newItems.length);
}

public void clear() {
    int count = items.size();
    items.clear();
    notifyItemRangeRemoved(0, count);
}

public T get(final int position) {
    return items.get(position);
}

@Override
public int getAdapterItemCount() {
    return items.size();
}

}


Reply to this email directly or view it on GitHub
#3 (comment)
.

from ultimaterecyclerview.

Zeliret avatar Zeliret commented on July 19, 2024

@cymcsg Well I wasn't sure enough about second part of my suggestion. Your adapter already has insert, remove and so on method. But if you think that my post was useful I am glad to hear it =) Thank you =)

from ultimaterecyclerview.

jjhesk avatar jjhesk commented on July 19, 2024

@cymcsg lets add this on the 0.4 milestone

from ultimaterecyclerview.

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.