Search in sources :

Example 16 with CardViewNative

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

the class NativeCardExpandFragment 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
    CardViewNative cardView = (CardViewNative) getActivity().findViewById(R.id.carddemo_example_card_expand3);
    cardView.setCard(card);
}
Also used : CardExpand(it.gmariotti.cardslib.library.internal.CardExpand) CardViewNative(it.gmariotti.cardslib.library.view.CardViewNative)

Example 17 with CardViewNative

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

the class NativeCardWithListFragment method initCard.

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

Example 18 with CardViewNative

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

the class NativeGPlayCardFragment method initCardGooglePlay.

/**
     * This method builds a simple card
     */
private void initCardGooglePlay() {
    //Create a Card
    GplayCard card = new GplayCard(getActivity());
    //Set card in the cardView
    CardViewNative cardView = (CardViewNative) getActivity().findViewById(R.id.carddemo_Gplay1);
    cardView.setCard(card);
    //Create a Card
    GplayCard card2 = new GplayCard(getActivity());
    //Set card in the cardView
    CardViewNative cardView2 = (CardViewNative) getActivity().findViewById(R.id.carddemo_Gplay2);
    cardView2.setCard(card2);
    if (Utils.isTablet(getActivity())) {
        //Create a Card
        GplayCard card3 = new GplayCard(getActivity());
        //Set card in the cardView
        CardViewNative cardView3 = (CardViewNative) getActivity().findViewById(R.id.carddemo_Gplay3);
        if (cardView3 != null)
            cardView3.setCard(card3);
    }
}
Also used : GplayCard(it.gmariotti.cardslib.demo.cards.GplayCard) CardViewNative(it.gmariotti.cardslib.library.view.CardViewNative)

Example 19 with CardViewNative

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

the class NativeCardExpandFragment 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
    CardViewNative cardView = (CardViewNative) 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) CardViewNative(it.gmariotti.cardslib.library.view.CardViewNative)

Example 20 with CardViewNative

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

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

Aggregations

CardViewNative (it.gmariotti.cardslib.library.view.CardViewNative)42 Card (it.gmariotti.cardslib.library.internal.Card)31 CardHeader (it.gmariotti.cardslib.library.internal.CardHeader)20 View (android.view.View)12 BaseCard (it.gmariotti.cardslib.library.internal.base.BaseCard)12 CustomCard (it.gmariotti.cardslib.demo.cards.CustomCard)11 CustomExpandCard (it.gmariotti.cardslib.demo.cards.CustomExpandCard)11 CustomHeaderInnerCard (it.gmariotti.cardslib.demo.cards.CustomHeaderInnerCard)11 ScrollView (android.widget.ScrollView)7 TextView (android.widget.TextView)6 CardExpand (it.gmariotti.cardslib.library.internal.CardExpand)6 MenuItem (android.view.MenuItem)4 CustomThumbCard (it.gmariotti.cardslib.demo.cards.CustomThumbCard)4 ViewToClickToExpand (it.gmariotti.cardslib.library.internal.ViewToClickToExpand)3 PopupMenu (android.widget.PopupMenu)2 GoogleNowBirthCard (it.gmariotti.cardslib.demo.cards.GoogleNowBirthCard)2 MayKnowCard (it.gmariotti.cardslib.demo.cards.MayKnowCard)2 SuggestedCard (it.gmariotti.cardslib.demo.cards.SuggestedCard)2 ProgressCard (it.gmariotti.cardslib.library.cards.ProgressCard)2 BaseSupplementalAction (it.gmariotti.cardslib.library.cards.actions.BaseSupplementalAction)2