use of it.gmariotti.cardslib.library.view.CardViewNative in project cardslib by gabrielemariotti.
the class NativeCardExpandFragment method init_standard_header_with_expandcollapse_button.
/**
* This method builds a standard header with base expand/collapse
*/
private void init_standard_header_with_expandcollapse_button() {
//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.setButtonExpandVisible(true);
//Add Header to card
card.addCardHeader(header);
//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
CardViewNative cardView = (CardViewNative) getActivity().findViewById(R.id.carddemo_example_card_expand1);
cardView.setCard(card);
}
use of it.gmariotti.cardslib.library.view.CardViewNative in project cardslib by gabrielemariotti.
the class NativeCardFragment method init_custom_card_swipe.
/**
* This method builds a custom card with a swipe action
*/
private void init_custom_card_swipe() {
//Create a Card
CustomCard card = new CustomCard(getActivity());
//Enable a swipe action
card.setSwipeable(true);
//You can set a SwipeListener.
card.setOnSwipeListener(new Card.OnSwipeListener() {
@Override
public void onSwipe(Card card) {
if (mTextViewSwipe != null)
mTextViewSwipe.setVisibility(View.GONE);
}
});
//Set card in the cardView
CardViewNative cardView = (CardViewNative) getActivity().findViewById(R.id.carddemo_example_card3_swipe);
cardView.setCard(card);
}
use of it.gmariotti.cardslib.library.view.CardViewNative in project cardslib by gabrielemariotti.
the class NativeCardFragment method init_simple_card.
/**
* This method builds a simple card
*/
private void init_simple_card() {
//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 the card inner text
card.setTitle(getString(R.string.demo_card_basetitle));
//Set card in the cardView
CardViewNative cardView = (CardViewNative) getActivity().findViewById(R.id.carddemo_card_id);
cardView.setCard(card);
}
use of it.gmariotti.cardslib.library.view.CardViewNative in project cardslib by gabrielemariotti.
the class NativeCardFragment 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
CardViewNative cardView = (CardViewNative) getActivity().findViewById(R.id.carddemo_example_card3);
cardView.setCard(card);
}
use of it.gmariotti.cardslib.library.view.CardViewNative in project cardslib by gabrielemariotti.
the class NativeCardFragment method init_card_inner_layout.
/**
* This method builds a simple card with a custom inner layout
*/
private void init_card_inner_layout() {
//Create a Card
Card card = new Card(getActivity(), R.layout.carddemo_example_inner_content);
//Create a CardHeader
CardHeader header = new CardHeader(getActivity());
//Set the header title
header.setTitle(getString(R.string.demo_header_basetitle));
card.addCardHeader(header);
//Set the card inner text
card.setTitle(getString(R.string.demo_card_basetitle));
//Set card in the cardView
CardViewNative cardView = (CardViewNative) getActivity().findViewById(R.id.carddemo_card_inner);
cardView.setCard(card);
}
Aggregations