Skip to content
dexafree edited this page Apr 3, 2015 · 6 revisions

BasicButtonsCard

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

BasicButtonsCard card = new BasicButtonsCard(context);
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();
    }
});
Clone this wiki locally