Giter Site home page Giter Site logo

xaverkapeller / sortedlistadapter Goto Github PK

View Code? Open in Web Editor NEW
51.0 4.0 14.0 110 KB

The RecyclerView.Adapter that makes your life easy!

Home Page: https://wrdlbrnft.github.io/SortedListAdapter/

License: MIT License

Java 100.00%
android android-library recyclerview recyclerview-adapter recyclerview-item-animation

sortedlistadapter's People

Contributors

wrdlbrnft avatar xaverkapeller 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

Watchers

 avatar  avatar  avatar  avatar

sortedlistadapter's Issues

Native ads support

Hello.
Is there any way to support different viewTypes that doesn't extends Model like AdExpressViewHolder ?
The problem is that in your implementation onCreateViewHolder must return something that extend Model class
ViewHolder<? extends ExampleModel> onCreateViewHolder
Is it possible in my situation ?

@Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        final View v = inflater.inflate(viewType, parent, false);
        if (viewType == VIEW_TYPE_COLLAPSED) {
            return new CollapsedVH(v, this);
        } else if (viewType == VIEW_TYPE_EXPANDED) {
            return new ExpandedVH(v, this);
        } else if (viewType == VIEW_TYPE_AD_EXPRESS) {
            return new AdExpressViewHolder(v);
        } else return null;
    }

License Request

I'm interested in using SortedListAdapter for a project but I didn't see any licensing information.

Duplicates appear when calling replaceAll

I'm attempting to use SortedListAdapter, and everything seems to be working great, except that occasionally when I call replaceAll with items that should satisfy isSameModelAs == true, a duplicate entry will appear for a moment before being removed.

Is this intended, and is there a way to modify this behaviour? I am currently checking against a unique id field (a MAC address) in my implmentation of isSameModelAs

Bind to diffrent R.layout.example.xml

Hi!
I'm not familiar with DataBinding. How can i bind to diffrent xml layouts? Normally i can change the layout xml in the onCreateViewHolder function:
inflater.inflate(R.layout.example, parent, false);
How can i change the ViewType and the ViewHolder based on the Model.getName() function or other criteria? I'm very open for good suggestions.
Thx for your help.

How to implement swipe to delete in SortedListAdapter

I am a big fan of your sortedListAdapter, I have implemented search and databinding and I am very pleased with the results. I would now like to implement swipe to delete, but I am unsure of how to do it, can you help me?

Adapter not replacing list

final List filteredModelList = filter(contacts, query);
mAdapter.edit()
.replaceAll(filteredModelList)
.commit();
It is not replacing the filtered list, I dont have any log information, it was working previously, I already debuged the filteredList has the values filtered but the replaceAll is not working, do you know if its working with API level 26?

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.