MaterialList
MaterialList copied to clipboard
How to get card config (card.getConfig)?
In last version, we have: card.getConfig();
E.g, if I have my custon card, and I want add some custom code, I did:
Card c1 = new Card.Builder(getActivity())
.setTag("MY_CARD")
.withProvider(SimplePhotoCard.class)
.hideActionBar(true)
.endConfig()
.build();
mListView.add(c1);
SimplePhotoCard sp1 = (SimplePhotoCard) c1.getConfig();
sp1.setOnTouchPhotoListener(new SimplePhotoCard.OnTouchPhotoListener() {
@Override
public void onTouch(View v) {
}
});
In the new version, how can I get it?
Thanks for help.
You only need you use an object instead of a class type at the provider definition.
//...
.withProvider(new SimplePhotoCard())
//...
Thanks for quick response.
The problem is that I have other case, where I store cars in a container, and then retrieve a Card and use getConfig.
In this case, the Class was intancied in other place.
Thanks again
Now I got it. The getConfig() method was replaced by getProvider().
Ok, thanks a lot! Nice lib!