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();
}
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();
}
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();
}
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();
}
Aggregations