Search in sources :

Example 1 with CardView

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

the class MiscCardFragment method initCircleCard.

private void initCircleCard() {
    Card card = new Card(getActivity());
    card.setTitle("Title");
    card.setBackgroundResourceId(R.color.demo_card_background_color1);
    CardThumbnailCircle thumb = new CardThumbnailCircle(getActivity());
    card.addCardThumbnail(thumb);
    CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_circleleft);
    cardView.setCard(card);
}
Also used : CardView(it.gmariotti.cardslib.library.view.CardView) SuggestedCard(it.gmariotti.cardslib.demo.cards.SuggestedCard) Card(it.gmariotti.cardslib.library.internal.Card) MayKnowCard(it.gmariotti.cardslib.demo.cards.MayKnowCard)

Example 2 with CardView

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

the class ShadowFragment method init_card_without_shadow.

/**
     * This method builds a card without shadow
     */
private void init_card_without_shadow() {
    //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);
    //Hidden shadow
    card.setShadow(false);
    //Set card in the cardView
    CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_shadow_no);
    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)

Example 3 with CardView

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

the class ShadowFragment method init_card_custom_shadow_layout.

/**
     * This methods builds a card with a custom shadow layout (compound view)
     * <b>WARNING</b>
     * See https://github.com/gabrielemariotti/cardslib/tree/master/SHADOW.md for more information.
     * You can quickly modify your shadow with your style and drawable files without modifying shadow layout.
     */
private void init_card_custom_shadow_layout() {
    //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 card in the cardView
    CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_shadow_layout);
    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)

Example 4 with CardView

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

the class ThumbnailFragment method init_card_thumb_custom_source.

/**
     * This method builds a card with a custom source thumbnail
     */
private void init_card_thumb_custom_source() {
    //Create a Card
    Card card = new GplayCardCustomSource(getActivity());
    //Set card in the cardView
    CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_thumb_customsource);
    cardView.setCard(card);
}
Also used : GplayCardCustomSource(it.gmariotti.cardslib.demo.cards.GplayCardCustomSource) CardView(it.gmariotti.cardslib.library.view.CardView) CustomThumbCard(it.gmariotti.cardslib.demo.cards.CustomThumbCard) Card(it.gmariotti.cardslib.library.internal.Card)

Example 5 with CardView

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

the class ThumbnailFragment method init_card_thumb_resourceURL.

/**
     * This method builds a card with a thumbnail with a resource URL
     */
private void init_card_thumb_resourceURL() {
    //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
    CardThumbnail thumb = new CardThumbnail(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_url);
    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)

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