-
Notifications
You must be signed in to change notification settings - Fork 378
BasicListCard
dexafree edited this page Jan 3, 2015
·
7 revisions
BasicListCard is a Card that allows you to show a checkable list inside the card.
It also shows a title and a description.
For title and description, you only need to call the setTitle(String title)
and setDescription(String description)
methods
Card card = new BasicListCard();
card.setTitle("Your title");
card.setDescription("Your description");
For adding items to the list, you can add them one by one, or add them at the same call:
card.addItem("Task 1");
card.addAllItems("Task 2", "Task 3");
In order to provide the simple check implementation (check-uncheck), you can use the following listener:
card.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
boolean checked = card.isItemChecked(card.getItems().get(position));
card.setItemChecked(position, !checked);
}
});