use of it.gmariotti.cardslib.library.view.CardView in project cardslib by gabrielemariotti.
the class HeaderFragment method init_standard_header_with_custom_other_button_programmatically.
/**
* This method builds a standard header with other button visible which drawable is defined programmatically
*/
private void init_standard_header_with_custom_other_button_programmatically() {
//Create a Card
Card card = new Card(getActivity());
//Create a CardHeader
CardHeader header = new CardHeader(getActivity());
//Set the header title
header.setTitle(getString(R.string.demo_header_basetitle));
//Set visible the expand/collapse button
header.setOtherButtonVisible(true);
//Add a callback
header.setOtherButtonClickListener(new CardHeader.OnClickCardHeaderOtherButtonListener() {
@Override
public void onButtonItemClick(Card card, View view) {
Toast.makeText(getActivity(), "Click on Other Button", Toast.LENGTH_LONG).show();
}
});
//Use this code to set your drawable
header.setOtherButtonDrawable(R.drawable.card_menu_button_other_add);
//Add Header to card
card.addCardHeader(header);
//Set card in the CardView
final CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_header_other_button_programmatically);
cardView.setCard(card);
}
use of it.gmariotti.cardslib.library.view.CardView in project cardslib by gabrielemariotti.
the class CardFragment method init_custom_card.
/**
* This method builds a custom card
*/
private void init_custom_card() {
//Create a Card
Card card = new CustomCard(getActivity());
//Set card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_example_card3);
cardView.setCard(card);
}
use of it.gmariotti.cardslib.library.view.CardView in project cardslib by gabrielemariotti.
the class CardWithListFragment method initCard.
/**
* This method builds a simple card
*/
private void initCard() {
//Create a Card
card = new GoogleNowWeatherCard(getActivity());
card.init();
//Set card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_weathercard);
cardView.setCard(card);
//Card
card2 = new GoogleNowStockCardwithList(getActivity());
card2.init();
//Set card in the cardView
CardView cardView2 = (CardView) getActivity().findViewById(R.id.carddemo_stockcard);
cardView2.setCard(card2);
}
use of it.gmariotti.cardslib.library.view.CardView in project cardslib by gabrielemariotti.
the class BirthDayCardFragment method init3.
private void init3() {
GoogleNowBirthCard card3 = new GoogleNowBirthCard(getActivity());
card3.setId("myId3");
card3.USE_VIGNETTE = 2;
//Set card in the cardView
CardView cardView3 = (CardView) getActivity().findViewById(R.id.carddemo_cardBirth3);
cardView3.setCard(card3);
}
use of it.gmariotti.cardslib.library.view.CardView in project cardslib by gabrielemariotti.
the class CardExpandFragment method init_custom_card_expand_clicking_text.
/**
* This method builds a custom card with expand/collapse action clickable in all card view
*/
private void init_custom_card_expand_clicking_text() {
//Create a Card
CustomCard2 card = new CustomCard2(getActivity());
card.setTitle("Click here to expand/collapse");
//This provides a simple (and useless) expand area
CardExpand expand = new CardExpand(getActivity());
//Set inner title in Expand Area
expand.setTitle(getString(R.string.demo_expand_customtitle3));
card.addCardExpand(expand);
//Set card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_example_card_expand3);
cardView.setCard(card);
}
Aggregations