Search in sources :

Example 1 with CustomCard

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);
}
Also used : CustomCard(it.gmariotti.cardslib.demo.cards.CustomCard) CardView(it.gmariotti.cardslib.library.view.CardView) Card(it.gmariotti.cardslib.library.internal.Card) CustomCard(it.gmariotti.cardslib.demo.cards.CustomCard)

Example 2 with CustomCard

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);
}
Also used : CustomCard(it.gmariotti.cardslib.demo.cards.CustomCard) CardView(it.gmariotti.cardslib.library.view.CardView) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) View(android.view.View) CardView(it.gmariotti.cardslib.library.view.CardView) Card(it.gmariotti.cardslib.library.internal.Card) CustomCard(it.gmariotti.cardslib.demo.cards.CustomCard)

Example 3 with CustomCard

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);
}
Also used : CustomCard(it.gmariotti.cardslib.demo.cards.CustomCard) Card(it.gmariotti.cardslib.library.internal.Card) CustomCard(it.gmariotti.cardslib.demo.cards.CustomCard) CardViewNative(it.gmariotti.cardslib.library.view.CardViewNative)

Example 4 with CustomCard

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);
}
Also used : CustomCard(it.gmariotti.cardslib.demo.cards.CustomCard) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) View(android.view.View) Card(it.gmariotti.cardslib.library.internal.Card) CustomCard(it.gmariotti.cardslib.demo.cards.CustomCard) CardViewNative(it.gmariotti.cardslib.library.view.CardViewNative)

Example 5 with CustomCard

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);
}
Also used : CustomCard(it.gmariotti.cardslib.demo.cards.CustomCard) Card(it.gmariotti.cardslib.library.internal.Card) CustomCard(it.gmariotti.cardslib.demo.cards.CustomCard) CardViewNative(it.gmariotti.cardslib.library.view.CardViewNative)

Aggregations

CustomCard (it.gmariotti.cardslib.demo.cards.CustomCard)8 Card (it.gmariotti.cardslib.library.internal.Card)6 CardView (it.gmariotti.cardslib.library.view.CardView)4 CardViewNative (it.gmariotti.cardslib.library.view.CardViewNative)4 View (android.view.View)2 ScrollView (android.widget.ScrollView)2 TextView (android.widget.TextView)2 CardExpand (it.gmariotti.cardslib.library.internal.CardExpand)2 ViewToClickToExpand (it.gmariotti.cardslib.library.internal.ViewToClickToExpand)2