Search in sources :

Example 36 with CardView

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

the class CardFragment 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
    CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_card_id);
    cardView.setCard(card);
}
Also used : 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 37 with CardView

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

the class MiscCardFragment method initCardSuggested.

/**
     * This method builds a suggested card example
     */
private void initCardSuggested() {
    SuggestedCard card = new SuggestedCard(getActivity());
    CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_suggested);
    cardView.setCard(card);
}
Also used : SuggestedCard(it.gmariotti.cardslib.demo.cards.SuggestedCard) CardView(it.gmariotti.cardslib.library.view.CardView)

Example 38 with CardView

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

the class MiscCardFragment method initCardMayKnow.

/**
     * This method builds a simple card
     */
private void initCardMayKnow() {
    //Create a Card
    MayKnowCard card = new MayKnowCard(getActivity());
    card.setShadow(false);
    //Set card in the cardView
    CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_MayKnow);
    cardView.setCard(card);
    MayKnowCard card2 = new MayKnowCard(getActivity());
    card2.addCardHeader(null);
    card2.setShadow(true);
    CardView mayView2 = (CardView) getActivity().findViewById(R.id.carddemo_MayKnow2);
    mayView2.setCard(card2);
}
Also used : MayKnowCard(it.gmariotti.cardslib.demo.cards.MayKnowCard) CardView(it.gmariotti.cardslib.library.view.CardView)

Example 39 with CardView

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

the class ThumbnailFragment method init_card_thumb_resourceId.

/**
     * This method builds a card with a thumbnail with a resource ID
     */
private void init_card_thumb_resourceId() {
    //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));
    //Add header to a card
    card.addCardHeader(header);
    //Create thumbnail
    CardThumbnail thumb = new CardThumbnail(getActivity());
    //Set ID resource
    thumb.setDrawableResource(R.drawable.carddemo_ic_gmaps_large);
    //Add thumbnail to a card
    card.addCardThumbnail(thumb);
    //Set card in the cardView
    CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_thumb_id);
    cardView.setCard(card);
}
Also used : CardHeader(it.gmariotti.cardslib.library.internal.CardHeader) CardView(it.gmariotti.cardslib.library.view.CardView) CardThumbnail(it.gmariotti.cardslib.library.internal.CardThumbnail) CustomThumbCard(it.gmariotti.cardslib.demo.cards.CustomThumbCard) Card(it.gmariotti.cardslib.library.internal.Card)

Example 40 with CardView

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

the class ThumbnailFragment method init_card_thumb_resourceURL_style.

/**
     * This method builds a card with a thumbnail with a resource URL with a custom style
     */
private void init_card_thumb_resourceURL_style() {
    //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
    CustomThumbCard thumb = new CustomThumbCard(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_style);
    cardView.setCard(card);
}
Also used : CustomThumbCard(it.gmariotti.cardslib.demo.cards.CustomThumbCard) CardHeader(it.gmariotti.cardslib.library.internal.CardHeader) CardView(it.gmariotti.cardslib.library.view.CardView) CustomThumbCard(it.gmariotti.cardslib.demo.cards.CustomThumbCard) Card(it.gmariotti.cardslib.library.internal.Card)

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