Jintin / MixAdapter

Compose multiple Adapter for RecyclerView in Android
https://jitpack.io/#jintin/MixAdapter
MIT License
19 stars 2 forks source link

Added Custom Adapter but Recycler doesn't show #1

Closed zipitup closed 6 years ago

zipitup commented 6 years ago
mAdapter = new AddOrderAdapter(mQuery);
mAdapter2 = new AddOrderAdapter(mQuery2);

MixAdapter<RecyclerView.ViewHolder> adapter = new MixAdapter<>();
adapter.addAdapter(mAdapter);
adapter.addAdapter(mAdapter2);

mAddOrderRecycler.setLayoutManager(new LinearLayoutManager(this));
mAddOrderRecycler.setAdapter(adapter);

I did this but recyclerview shows up empty. How do I check what's wrong?

Jintin commented 6 years ago

You can debug the size of adapter first. check getItemCount both on MixAdapter and AddOrderAdapter

zipitup commented 6 years ago

I get 0 of AddOrderAdapter.itemcount. But if I made it to a single adapter (remove MixAdapter) - the count is still 0. But the recyclerview shows up fine.

        mAddOrderRecycler.setLayoutManager(new LinearLayoutManager(this));
        mAddOrderRecycler.setAdapter(mAdapter);

        int itemCount = mAdapter.getItemCount();
        Log.d(TAG, String.valueOf(itemCount));
zipitup commented 6 years ago

https://stackoverflow.com/questions/37937497/getitemcount-on-adapter-is-returning-0

I just read this. I'm using Firebase's Firestore, that's probably why.

Does the plugin work with Firebase?

Jintin commented 6 years ago

Sorry. I think currently not support, maybe I'll find out how to integrate with it in the future.