use of it.gmariotti.cardslib.library.view.CardView in project cardslib by gabrielemariotti.
the class MiscCardFragment method initCircleCard.
private void initCircleCard() {
Card card = new Card(getActivity());
card.setTitle("Title");
card.setBackgroundResourceId(R.color.demo_card_background_color1);
CardThumbnailCircle thumb = new CardThumbnailCircle(getActivity());
card.addCardThumbnail(thumb);
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_circleleft);
cardView.setCard(card);
}
use of it.gmariotti.cardslib.library.view.CardView in project cardslib by gabrielemariotti.
the class ShadowFragment method init_card_without_shadow.
/**
* This method builds a card without shadow
*/
private void init_card_without_shadow() {
//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));
card.addCardHeader(header);
//Hidden shadow
card.setShadow(false);
//Set card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_shadow_no);
cardView.setCard(card);
}
use of it.gmariotti.cardslib.library.view.CardView in project cardslib by gabrielemariotti.
the class ShadowFragment method init_card_custom_shadow_layout.
/**
* This methods builds a card with a custom shadow layout (compound view)
* <b>WARNING</b>
* See https://github.com/gabrielemariotti/cardslib/tree/master/SHADOW.md for more information.
* You can quickly modify your shadow with your style and drawable files without modifying shadow layout.
*/
private void init_card_custom_shadow_layout() {
//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));
card.addCardHeader(header);
//Set card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_shadow_layout);
cardView.setCard(card);
}
use of it.gmariotti.cardslib.library.view.CardView in project cardslib by gabrielemariotti.
the class ThumbnailFragment method init_card_thumb_custom_source.
/**
* This method builds a card with a custom source thumbnail
*/
private void init_card_thumb_custom_source() {
//Create a Card
Card card = new GplayCardCustomSource(getActivity());
//Set card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_thumb_customsource);
cardView.setCard(card);
}
use of it.gmariotti.cardslib.library.view.CardView in project cardslib by gabrielemariotti.
the class ThumbnailFragment method init_card_thumb_resourceURL.
/**
* This method builds a card with a thumbnail with a resource URL
*/
private void init_card_thumb_resourceURL() {
//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));
card.addCardHeader(header);
//Create thumbnail
CardThumbnail thumb = new CardThumbnail(getActivity());
//Set URL resource
thumb.setUrlResource("https://lh5.googleusercontent.com/-N8bz9q4Kz0I/AAAAAAAAAAI/AAAAAAAAAAs/Icl2bQMyK7c/s265-c-k-no/photo.jpg");
//Error Resource ID
thumb.setErrorResource(R.drawable.ic_error_loadingorangesmall);
//Add thumbnail to a card
card.addCardThumbnail(thumb);
//Set card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_thumb_url);
cardView.setCard(card);
}
Aggregations