Search in sources :

Example 31 with CardView

use of it.gmariotti.cardslib.library.view.CardView in project cardslib by gabrielemariotti.

the class BirthDayCardFragment method init2.

private void init2() {
    GoogleNowBirthCard card2 = new GoogleNowBirthCard(getActivity());
    card2.setId("myId2");
    card2.USE_VIGNETTE = 1;
    //Set card in the cardView
    CardView cardView2 = (CardView) getActivity().findViewById(R.id.carddemo_cardBirth2);
    cardView2.setCard(card2);
}
Also used : GoogleNowBirthCard(it.gmariotti.cardslib.demo.cards.GoogleNowBirthCard) CardView(it.gmariotti.cardslib.library.view.CardView)

Example 32 with CardView

use of it.gmariotti.cardslib.library.view.CardView in project cardslib by gabrielemariotti.

the class CardExpandFragment 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
    CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_example_card_expand1);
    cardView.setCard(card);
}
Also used : CardExpand(it.gmariotti.cardslib.library.internal.CardExpand) CardHeader(it.gmariotti.cardslib.library.internal.CardHeader) CardView(it.gmariotti.cardslib.library.view.CardView) Card(it.gmariotti.cardslib.library.internal.Card) CustomCard(it.gmariotti.cardslib.demo.cards.CustomCard)

Example 33 with CardView

use of it.gmariotti.cardslib.library.view.CardView in project cardslib by gabrielemariotti.

the class CardExpandFragment method init_custom_card_expand_inside.

/**
     * This method builds a card with a collpse/expand section inside
     */
private void init_custom_card_expand_inside() {
    //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_expand_area_inside));
    //Add Header to card
    card.addCardHeader(header);
    //This provides a simple (and useless) expand area
    CardExpandInside expand = new CardExpandInside(getActivity());
    card.addCardExpand(expand);
    //Set card in the cardView
    CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_example_card_expand5);
    ViewToClickToExpand viewToClickToExpand = ViewToClickToExpand.builder().highlightView(false).setupView(cardView);
    card.setViewToClickToExpand(viewToClickToExpand);
    card.setOnExpandAnimatorEndListener(new Card.OnExpandAnimatorEndListener() {

        @Override
        public void onExpandEnd(Card card) {
        /*
                if (mScrollView!=null){
                    mScrollView.post(new Runnable() {
                        public void run() {
                            mScrollView.scrollTo(0, mScrollView.getBottom());
                        }
                    });
                }*/
        }
    });
    cardView.setCard(card);
}
Also used : ViewToClickToExpand(it.gmariotti.cardslib.library.internal.ViewToClickToExpand) CardHeader(it.gmariotti.cardslib.library.internal.CardHeader) CardView(it.gmariotti.cardslib.library.view.CardView) Card(it.gmariotti.cardslib.library.internal.Card) CustomCard(it.gmariotti.cardslib.demo.cards.CustomCard)

Example 34 with CardView

use of it.gmariotti.cardslib.library.view.CardView in project cardslib by gabrielemariotti.

the class CardExpandFragment method init_custom_card_expand_clicking_image.

/**
     * This method builds a custom card with expand/collapse action clickable in all card view
     */
private void init_custom_card_expand_clicking_image() {
    //Create a Card
    Card card = new Card(getActivity());
    //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);
    CustomThumbnail thumb = new CustomThumbnail(getActivity());
    thumb.setDrawableResource(R.drawable.ic_smile);
    card.addCardThumbnail(thumb);
    //Set card in the cardView
    CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_example_card_expand4);
    cardView.setCard(card);
}
Also used : CardExpand(it.gmariotti.cardslib.library.internal.CardExpand) CardView(it.gmariotti.cardslib.library.view.CardView) Card(it.gmariotti.cardslib.library.internal.Card) CustomCard(it.gmariotti.cardslib.demo.cards.CustomCard)

Example 35 with CardView

use of it.gmariotti.cardslib.library.view.CardView in project cardslib by gabrielemariotti.

the class CardExpandFragment method init_custom_card_expand.

/**
     * This method builds a custom card with expand/collapse action clickable in all card view
     */
private void init_custom_card_expand() {
    //Create a Card
    CustomCard card = new CustomCard(getActivity());
    //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_expand2);
    ViewToClickToExpand viewToClickToExpand = ViewToClickToExpand.builder().setupView(cardView);
    card.setViewToClickToExpand(viewToClickToExpand);
    cardView.setCard(card);
}
Also used : ViewToClickToExpand(it.gmariotti.cardslib.library.internal.ViewToClickToExpand) CustomCard(it.gmariotti.cardslib.demo.cards.CustomCard) CardExpand(it.gmariotti.cardslib.library.internal.CardExpand) CardView(it.gmariotti.cardslib.library.view.CardView)

Aggregations

CardView (it.gmariotti.cardslib.library.view.CardView)40 Card (it.gmariotti.cardslib.library.internal.Card)31 CardHeader (it.gmariotti.cardslib.library.internal.CardHeader)20 CustomCard (it.gmariotti.cardslib.demo.cards.CustomCard)12 CustomExpandCard (it.gmariotti.cardslib.demo.cards.CustomExpandCard)11 CustomHeaderInnerCard (it.gmariotti.cardslib.demo.cards.CustomHeaderInnerCard)11 BaseCard (it.gmariotti.cardslib.library.internal.base.BaseCard)11 View (android.view.View)9 ScrollView (android.widget.ScrollView)7 CardExpand (it.gmariotti.cardslib.library.internal.CardExpand)6 TextView (android.widget.TextView)4 CustomThumbCard (it.gmariotti.cardslib.demo.cards.CustomThumbCard)4 CardThumbnail (it.gmariotti.cardslib.library.internal.CardThumbnail)4 MenuItem (android.view.MenuItem)3 ViewToClickToExpand (it.gmariotti.cardslib.library.internal.ViewToClickToExpand)3 LayoutInflater (android.view.LayoutInflater)2 PopupMenu (android.widget.PopupMenu)2 Crouton (de.keyboardsurfer.android.widget.crouton.Crouton)2 GoogleNowBirthCard (it.gmariotti.cardslib.demo.cards.GoogleNowBirthCard)2 MayKnowCard (it.gmariotti.cardslib.demo.cards.MayKnowCard)2