MaterialList
MaterialList copied to clipboard
Version 3.1.1 or 3.1.0 doesn't result in successful builds.
Error:(31, 38) error: cannot find symbol class OnButtonClickListener Error:(32, 47) error: cannot find symbol class BasicImageButtonsCardProvider Error:(241, 22) error: cannot find symbol method clearAll() Error:(245, 22) error: cannot find symbol method clearAll() Error:(363, 27) error: cannot find symbol class BasicImageButtonsCardProvider Error:(366, 43) error: cannot find symbol class BasicImageButtonsCardProvider Error:(373, 63) error: cannot find symbol class OnButtonClickListener Error:(384, 64) error: cannot find symbol class OnButtonClickListener Error:(427, 23) error: cannot find symbol class BasicImageButtonsCardProvider Error:(430, 39) error: cannot find symbol class BasicImageButtonsCardProvider Error:(437, 59) error: cannot find symbol class OnButtonClickListener Error:(450, 60) error: cannot find symbol class OnButtonClickListener
These are the list of errors that I get.
There have been some changes since 3.0.0. The special Providers are no longer accessable. They are all merged together in one single one called CardProvider (or ListCardProvider). If you want to add actions to some view components of your card you can do this with
//...
.withProvider(new CardProvider())
.addAction(R.id.textView, new OnActionClickListener() {...})
//...
So how can I simply use the BasicImageButtonsCard template in my card ? How can I add cards in my recyclerview ? How to I use the clearall() method ? All these things are throwing out an error.
You can use it this way:
MaterialListView listView = (MaterialListView) findViewById(R.id.materialListView);
Card card = new Card.Builder(getContext())
.withProvider(new CardProvider())
.setLayout(R.layout.material_basic_buttons_card)
.addAction(R.id.right_text_button, new TextViewAction(getContext())
.setText("Action")
.setListener(new OnActionClickListener() {...}))
.endConfig()
.build();
// Add card
listView.getAdapter().add(card);
// Remove all cards
listView.getAdapter().clearAll();
can you show this new pattern in a full sample....this new code just made the library super confusing bc no documentation....
nm...I see in new code being implemented in the sample app. thx @FHellmann
Thanks for the help @FHellmann... most of the stuff is working now. The only problem that i have is that when the textViewAction is pressed the card records it as a Short Click as well at the same time. So two events are happening at the same time when only the button press should be recorded. Is this an error on my side ?
Also animations are not working using the recyclerview animations library when I use mListview.clearAll() and then adding cards. It only works for the first time when adding some cards.