Search in sources :

Example 21 with CardViewNative

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

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

Example 22 with CardViewNative

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

the class NativeCardFragment method init_custom_card_swipe.

/**
     * This method builds a custom card with a swipe action
     */
private void init_custom_card_swipe() {
    //Create a Card
    CustomCard card = new CustomCard(getActivity());
    //Enable a swipe action
    card.setSwipeable(true);
    //You can set a SwipeListener.
    card.setOnSwipeListener(new Card.OnSwipeListener() {

        @Override
        public void onSwipe(Card card) {
            if (mTextViewSwipe != null)
                mTextViewSwipe.setVisibility(View.GONE);
        }
    });
    //Set card in the cardView
    CardViewNative cardView = (CardViewNative) getActivity().findViewById(R.id.carddemo_example_card3_swipe);
    cardView.setCard(card);
}
Also used : CustomCard(it.gmariotti.cardslib.demo.cards.CustomCard) Card(it.gmariotti.cardslib.library.internal.Card) CustomCard(it.gmariotti.cardslib.demo.cards.CustomCard) CardViewNative(it.gmariotti.cardslib.library.view.CardViewNative)

Example 23 with CardViewNative

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

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

Example 24 with CardViewNative

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

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

Example 25 with CardViewNative

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

the class NativeCardFragment method init_card_inner_layout.

/**
     * This method builds a simple card with a custom inner layout
     */
private void init_card_inner_layout() {
    //Create a Card
    Card card = new Card(getActivity(), R.layout.carddemo_example_inner_content);
    //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
    CardViewNative cardView = (CardViewNative) getActivity().findViewById(R.id.carddemo_card_inner);
    cardView.setCard(card);
}
Also used : CardHeader(it.gmariotti.cardslib.library.internal.CardHeader) 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