-
Notifications
You must be signed in to change notification settings - Fork 377
BasicButtonsCard
dexafree edited this page Jan 3, 2015
·
6 revisions
BasicButtonsCard is a simple Card that shows a title, a description, and offers two buttons.
For title and description, you only need to call the setTitle(String title) and setDescription(String description) methods
Card card = new BasicButtonsCard();
card.setTitle("Your title");
card.setDescription("Your description");The text shown in both buttons can also be set, just by calling BasicButtonsCard.setLeftButtonText(String text) (or its right equivalent).
card.setLeftButtonText("LEFT");
card.setRightButtonText("RIGHT");You can also define behaviours for the button pressing. You only need to call BasicImageButtonsCard.setOnLeftButtonPressedListener(OnButtonPressListener) (or its equivalent for the right button) and define its behaviour.
Example:
card.setOnRightButtonPressedListener(new OnButtonPressListener() {
@Override
public void onButtonPressedListener(TextView textView) {
Toast.makeText( mContext,
"You have pressed the right button",
Toast.LENGTH_SHORT
).show();
}
});