Search in sources :

Example 1 with TopColoredCard

use of it.gmariotti.cardslib.library.cards.topcolored.TopColoredCard in project cardslib by gabrielemariotti.

the class NativeTopColoredCardFragment method init_BlackTopColoredCard.

/**
     * Builds a Material HalfColored Card
     */
private void init_BlackTopColoredCard() {
    TopColoredCard card = TopColoredCard.with(getActivity()).setColorResId(R.color.carddemo_blackcolored_color).setTitleOverColor(R.string.carddemo_match).setupSubLayoutId(R.layout.carddemo_native_blackcolored_simple_title).setupInnerElements(new TopColoredCard.OnSetupInnerElements() {

        @Override
        public void setupInnerViewElementsSecondHalf(View secondHalfView) {
            TextView mSimpleTitleView = (TextView) secondHalfView.findViewById(R.id.carddemo_blackcolored_simple_title);
            if (mSimpleTitleView != null) {
                mSimpleTitleView.setText("It is just an example!");
            }
        }
    }).build();
    //Set card in the CardViewNative
    CardViewNative cardView = (CardViewNative) getActivity().findViewById(R.id.carddemo_blackcolored);
    cardView.setCard(card);
}
Also used : TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) TopColoredCard(it.gmariotti.cardslib.library.cards.topcolored.TopColoredCard) CardViewNative(it.gmariotti.cardslib.library.view.CardViewNative)

Example 2 with TopColoredCard

use of it.gmariotti.cardslib.library.cards.topcolored.TopColoredCard in project cardslib by gabrielemariotti.

the class NativeTopColoredCardFragment method init_HalfColoredCard.

/**
     * Builds a Material HalfColored Card
     */
private void init_HalfColoredCard() {
    TopColoredCard card = TopColoredCard.with(getActivity()).setColorResId(R.color.carddemo_halfcolored_color).setTitleOverColor("22 mins to Ancona").setSubTitleOverColor("Light traffic on SS16").setupSubLayoutId(R.layout.carddemo_native_halfcolored_simple_title).setupInnerElements(new TopColoredCard.OnSetupInnerElements() {

        @Override
        public void setupInnerViewElementsSecondHalf(View secondHalfView) {
            TextView mSimpleTitleView = (TextView) secondHalfView.findViewById(R.id.carddemo_halfcolored_simple_title);
            if (mSimpleTitleView != null) {
                mSimpleTitleView.setText("It is just an example!");
            }
        }
    }).build();
    //Set card in the CardViewNative
    CardViewNative cardView = (CardViewNative) getActivity().findViewById(R.id.carddemo_halfcolored);
    cardView.setCard(card);
}
Also used : TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) TopColoredCard(it.gmariotti.cardslib.library.cards.topcolored.TopColoredCard) CardViewNative(it.gmariotti.cardslib.library.view.CardViewNative)

Aggregations

View (android.view.View)2 TextView (android.widget.TextView)2 TopColoredCard (it.gmariotti.cardslib.library.cards.topcolored.TopColoredCard)2 CardViewNative (it.gmariotti.cardslib.library.view.CardViewNative)2