Search in sources :

Example 1 with Crouton

use of de.keyboardsurfer.android.widget.crouton.Crouton in project cardslib by gabrielemariotti.

the class CroutonFragment method crouton2.

/**
 * This method builds another crouton card
 */
private void crouton2() {
    LayoutInflater mInflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View view = mInflater.inflate(R.layout.carddemo_extras_crouton_card, null);
    // Card View
    CardView cardView = (CardView) view.findViewById(R.id.carddemo_card_crouton_id);
    // Card
    Card card = new Card(getActivity());
    card.setTitle("Crouton Card");
    // Add a CardThumbnail
    CardThumbnail thumb = new CardThumbnail(getActivity());
    thumb.setDrawableResource(R.drawable.ic_action_halt);
    card.addCardThumbnail(thumb);
    cardView.setCard(card);
    // Make the crouton view
    final Crouton crouton;
    crouton = Crouton.make(getActivity(), view);
    crouton.show();
}
Also used : Crouton(de.keyboardsurfer.android.widget.crouton.Crouton) LayoutInflater(android.view.LayoutInflater) CardView(it.gmariotti.cardslib.library.view.CardView) View(android.view.View) CardView(it.gmariotti.cardslib.library.view.CardView) CardThumbnail(it.gmariotti.cardslib.library.internal.CardThumbnail) Card(it.gmariotti.cardslib.library.internal.Card)

Example 2 with Crouton

use of de.keyboardsurfer.android.widget.crouton.Crouton in project cardslib by gabrielemariotti.

the class CroutonFragment method crouton1.

/**
 * This method builds a crouton card
 */
private void crouton1() {
    LayoutInflater mInflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View view = mInflater.inflate(R.layout.carddemo_extras_crouton_card, null);
    // CardView
    CardView cardView = (CardView) view.findViewById(R.id.carddemo_card_crouton_id);
    // Card
    Card card = new Card(getActivity());
    card.setTitle("Crouton Card");
    card.setBackgroundResourceId(R.color.demoextra_card_background_color2);
    // Add a cardThumbnail
    CardThumbnail thumb = new CardThumbnail(getActivity());
    thumb.setDrawableResource(R.drawable.ic_action_bulb);
    card.addCardThumbnail(thumb);
    cardView.setCard(card);
    // Make the crouton view
    final Crouton crouton;
    crouton = Crouton.make(getActivity(), view);
    crouton.show();
}
Also used : Crouton(de.keyboardsurfer.android.widget.crouton.Crouton) LayoutInflater(android.view.LayoutInflater) CardView(it.gmariotti.cardslib.library.view.CardView) View(android.view.View) CardView(it.gmariotti.cardslib.library.view.CardView) CardThumbnail(it.gmariotti.cardslib.library.internal.CardThumbnail) Card(it.gmariotti.cardslib.library.internal.Card)

Example 3 with Crouton

use of de.keyboardsurfer.android.widget.crouton.Crouton in project Crouton by keyboardsurfer.

the class CroutonFragment method showCustomViewCrouton.

private void showCustomViewCrouton() {
    View view = getLayoutInflater(null).inflate(R.layout.crouton_custom_view, null);
    final Crouton crouton;
    if (displayOnTop.isChecked()) {
        crouton = Crouton.make(getActivity(), view);
    } else {
        crouton = Crouton.make(getActivity(), view, R.id.alternate_view_group);
    }
    crouton.show();
}
Also used : Crouton(de.keyboardsurfer.android.widget.crouton.Crouton) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 4 with Crouton

use of de.keyboardsurfer.android.widget.crouton.Crouton in project Crouton by keyboardsurfer.

the class CroutonFragment method showCrouton.

private void showCrouton(String croutonText, Style croutonStyle, Configuration configuration) {
    final boolean infinite = INFINITE == croutonStyle;
    if (infinite) {
        croutonText = getString(R.string.infinity_text);
    }
    final Crouton crouton;
    if (displayOnTop.isChecked()) {
        crouton = Crouton.makeText(getActivity(), croutonText, croutonStyle);
    } else {
        crouton = Crouton.makeText(getActivity(), croutonText, croutonStyle, R.id.alternate_view_group);
    }
    if (infinite) {
        infiniteCrouton = crouton;
    }
    crouton.setOnClickListener(this).setConfiguration(infinite ? CONFIGURATION_INFINITE : configuration).show();
}
Also used : Crouton(de.keyboardsurfer.android.widget.crouton.Crouton)

Aggregations

Crouton (de.keyboardsurfer.android.widget.crouton.Crouton)4 View (android.view.View)3 LayoutInflater (android.view.LayoutInflater)2 Card (it.gmariotti.cardslib.library.internal.Card)2 CardThumbnail (it.gmariotti.cardslib.library.internal.CardThumbnail)2 CardView (it.gmariotti.cardslib.library.view.CardView)2 AdapterView (android.widget.AdapterView)1