Search in sources :

Example 11 with CardView

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

the class HeaderFragment method init_standard_header_with_custom_other_button_programmatically.

/**
     * This method builds a standard header with other button visible which drawable is defined programmatically
     */
private void init_standard_header_with_custom_other_button_programmatically() {
    //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.setOtherButtonVisible(true);
    //Add a callback
    header.setOtherButtonClickListener(new CardHeader.OnClickCardHeaderOtherButtonListener() {

        @Override
        public void onButtonItemClick(Card card, View view) {
            Toast.makeText(getActivity(), "Click on Other Button", Toast.LENGTH_LONG).show();
        }
    });
    //Use this code to set your drawable
    header.setOtherButtonDrawable(R.drawable.card_menu_button_other_add);
    //Add Header to card
    card.addCardHeader(header);
    //Set card in the CardView
    final CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_header_other_button_programmatically);
    cardView.setCard(card);
}
Also used : CardHeader(it.gmariotti.cardslib.library.internal.CardHeader) CardView(it.gmariotti.cardslib.library.view.CardView) ScrollView(android.widget.ScrollView) View(android.view.View) CardView(it.gmariotti.cardslib.library.view.CardView) BaseCard(it.gmariotti.cardslib.library.internal.base.BaseCard) CustomExpandCard(it.gmariotti.cardslib.demo.cards.CustomExpandCard) CustomHeaderInnerCard(it.gmariotti.cardslib.demo.cards.CustomHeaderInnerCard) Card(it.gmariotti.cardslib.library.internal.Card)

Example 12 with CardView

use of it.gmariotti.cardslib.library.view.CardView 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 13 with CardView

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

the class CardWithListFragment method initCard.

/**
     * This method builds a simple card
     */
private void initCard() {
    //Create a Card
    card = new GoogleNowWeatherCard(getActivity());
    card.init();
    //Set card in the cardView
    CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_weathercard);
    cardView.setCard(card);
    //Card
    card2 = new GoogleNowStockCardwithList(getActivity());
    card2.init();
    //Set card in the cardView
    CardView cardView2 = (CardView) getActivity().findViewById(R.id.carddemo_stockcard);
    cardView2.setCard(card2);
}
Also used : CardView(it.gmariotti.cardslib.library.view.CardView) GoogleNowWeatherCard(it.gmariotti.cardslib.demo.cards.GoogleNowWeatherCard) GoogleNowStockCardwithList(it.gmariotti.cardslib.demo.cards.GoogleNowStockCardwithList)

Example 14 with CardView

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

the class BirthDayCardFragment method init3.

private void init3() {
    GoogleNowBirthCard card3 = new GoogleNowBirthCard(getActivity());
    card3.setId("myId3");
    card3.USE_VIGNETTE = 2;
    //Set card in the cardView
    CardView cardView3 = (CardView) getActivity().findViewById(R.id.carddemo_cardBirth3);
    cardView3.setCard(card3);
}
Also used : GoogleNowBirthCard(it.gmariotti.cardslib.demo.cards.GoogleNowBirthCard) CardView(it.gmariotti.cardslib.library.view.CardView)

Example 15 with CardView

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

the class CardExpandFragment method init_custom_card_expand_clicking_text.

/**
     * This method builds a custom card with expand/collapse action clickable in all card view
     */
private void init_custom_card_expand_clicking_text() {
    //Create a Card
    CustomCard2 card = new CustomCard2(getActivity());
    card.setTitle("Click here to expand/collapse");
    //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_expand3);
    cardView.setCard(card);
}
Also used : 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