dexafree / MaterialList

An Android library aimed to get the beautiful CardViews that Google shows at its official design specifications
1.61k stars 380 forks source link

Version 3.1.1 or 3.1.0 doesn't result in successful builds. #106

Open nicknagi opened 8 years ago

nicknagi commented 8 years ago

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.

FHellmann commented 8 years ago

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() {...})
//...
nicknagi commented 8 years ago

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.

FHellmann commented 8 years ago

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();
sirvon commented 8 years ago

can you show this new pattern in a full sample....this new code just made the library super confusing bc no documentation....

sirvon commented 8 years ago

nm...I see in new code being implemented in the sample app. thx @FHellmann

nicknagi commented 8 years ago

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 ?

nicknagi commented 8 years ago

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.