use of it.gmariotti.cardslib.demo.cards.CustomCard 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.demo.cards.CustomCard in project cardslib by gabrielemariotti.
the class CardFragment method init_custom_card_clickable.
/**
* This method builds a custom card clickable
*/
private void init_custom_card_clickable() {
// Create a Card
CustomCard card = new CustomCard(getActivity());
// Set onClick listener
card.setOnClickListener(new Card.OnCardClickListener() {
@Override
public void onClick(Card card, View view) {
Toast.makeText(getActivity(), "Clickable card", Toast.LENGTH_LONG).show();
}
});
// Set card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_example_card3_clickable);
cardView.setCard(card);
}
use of it.gmariotti.cardslib.demo.cards.CustomCard 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.demo.cards.CustomCard in project cardslib by gabrielemariotti.
the class NativeCardFragment method init_custom_card_clickable.
/**
* This method builds a custom card clickable
*/
private void init_custom_card_clickable() {
// Create a Card
CustomCard card = new CustomCard(getActivity());
// Set onClick listener
card.setOnClickListener(new Card.OnCardClickListener() {
@Override
public void onClick(Card card, View view) {
Toast.makeText(getActivity(), "Clickable card", Toast.LENGTH_LONG).show();
}
});
// Set card in the cardView
CardViewNative cardView = (CardViewNative) getActivity().findViewById(R.id.carddemo_example_card3_clickable);
cardView.setCard(card);
}
use of it.gmariotti.cardslib.demo.cards.CustomCard 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);
}
Aggregations