本文整理汇总了Java中it.gmariotti.cardslib.library.internal.Card类的典型用法代码示例。如果您正苦于以下问题:Java Card类的具体用法?Java Card怎么用?Java Card使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Card类属于it.gmariotti.cardslib.library.internal包,在下文中一共展示了Card类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateUi
import it.gmariotti.cardslib.library.internal.Card; //导入依赖的package包/类
@Override
public void updateUi(Inventory inventory) {
if (inventory == null)
return;
Iterator<Map.Entry<String, SkuDetails>> iter = inventory.getSkuMap().entrySet().iterator();
List<Card> cards = new ArrayList<Card>();
while (iter.hasNext()) {
SkuDetails skuDetails = iter.next().getValue();
cards.add(initCard(skuDetails, false));
}
CardArrayAdapter adapter = new CardArrayAdapter(getActivity(), cards);
cardListView.setAdapter(adapter);
}
示例2: setCard
import it.gmariotti.cardslib.library.internal.Card; //导入依赖的package包/类
/**
* Add a {@link Card}.
* It is very important to set all values and all components before launch this method.
*
* @param card {@link Card} model
*/
@Override
public void setCard(Card card){
super.setCard(card);
if (card!=null){
mCardHeader=card.getCardHeader();
mCardThumbnail=card.getCardThumbnail();
mCardExpand=card.getCardExpand();
}
//Retrieve all IDs
if (!isRecycle()){
retrieveLayoutIDs();
}
//Build UI
buildUI();
}
示例3: decodeAreaOnClickListener
import it.gmariotti.cardslib.library.internal.Card; //导入依赖的package包/类
/**
*
* @param area
* @return
*/
protected View decodeAreaOnClickListener(int area){
if (area<Card.CLICK_LISTENER_ALL_VIEW && area>Card.CLICK_LISTENER_CONTENT_VIEW)
return null;
View view = null;
switch (area){
case Card.CLICK_LISTENER_ALL_VIEW :
view=this;
break;
case Card.CLICK_LISTENER_HEADER_VIEW :
view=mInternalHeaderLayout;
break;
case Card.CLICK_LISTENER_THUMBNAIL_VIEW:
view=mInternalThumbnailLayout;
break;
case Card.CLICK_LISTENER_CONTENT_VIEW:
view=mInternalContentLayout;
break;
default:
break;
}
return view;
}
示例4: doAnimation
import it.gmariotti.cardslib.library.internal.Card; //导入依赖的package包/类
@Override
public void doAnimation(final Card card, View imageOverflow) {
//Store selected values
super.doAnimation(card, imageOverflow);
if (card == null || card.getCardView() == null) return;
//animation duration
//final int mShortAnimationDuration = getAnimationDuration();
final CardInfoToAnimate infoAnimation = setCardToAnimate(card);
if (infoAnimation == null) return;
if (!selected) {
doOverFirstAnimation(card,infoAnimation, imageOverflow);
} else {
//TODO More Cards
doOverOtherAnimation(card,infoAnimation, imageOverflow);
}
//Update icon and model status
toggleOverflowIcon();
}
示例5: getVisibleViewsForCards
import it.gmariotti.cardslib.library.internal.Card; //导入依赖的package包/类
/**
* Returns the visible view for the cards
*
* @param cardsCopy
* @return
*/
private List<CardView> getVisibleViewsForCards(List<Card> cardsCopy) {
List<CardView> originalViews = new ArrayList<CardView>();
for (Card card:cardsCopy){
originalViews.add(card.getCardView());
}
/*List<CardView> views = new ArrayList<CardView>();
for (int i = 0; i < mCardListView.getChildCount(); i++) {
View child = mCardListView.getChildAt(i);
if (cardsCopy.contains(views)){
views.add((CardView) child);
}
}*/
return originalViews;
}
示例6: onDismiss
import it.gmariotti.cardslib.library.internal.Card; //导入依赖的package包/类
@Override
public void onDismiss(ListView listView, int[] reverseSortedPositions) {
int[] itemPositions=new int[reverseSortedPositions.length];
String[] itemIds=new String[reverseSortedPositions.length];
int i=0;
//Remove cards and notifyDataSetChanged
for (int position : reverseSortedPositions) {
Card card = mBaseAdapter.getItem(position);
if (card!=null){
itemPositions[i]=position;
itemIds[i]=card.getId();
i++;
mBaseAdapter.remove(card);
//TODO CHANGE
if (card.getOnSwipeListener() != null){
card.getOnSwipeListener().onSwipe(card);
}
}
}
mBaseAdapter.notifyDataSetChanged();
}
示例7: onActivityCreated
import it.gmariotti.cardslib.library.internal.Card; //导入依赖的package包/类
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
myHandler = new Handler();
pokemonVectorImage = new int[Pokedex.pokemonNumber];
String packageName = getActivity().getPackageName();
// load images in array
for (int imageIndex = 0; imageIndex < pokemonVectorImage.length; imageIndex++) {
resId = getActivity().getResources().getIdentifier("pokemon_vector_" + (imageIndex + 1), "drawable", packageName);
pokemonVectorImage[imageIndex] = resId;
}
// initialize cards with their infos if the json has already been loaded once
cards = new ArrayList<Card>();
initCards();
}
示例8: initCards
import it.gmariotti.cardslib.library.internal.Card; //导入依赖的package包/类
private void initCards() {
// Init an array of Cards
ArrayList<Card> cardsChart = new ArrayList<Card>();
Card card = init_info_card(tmp.getFull(), tmp.getStatus(), tmp.getDue_date());
cardsChart.add(card);
card = init_fulfilled_card();
cardsChart.add(card);
card = init_proof_card();
cardsChart.add(card);
card = init_chart_detail_card();
cardsChart.add(card);
/*for (int i = 0; i < 5; i++) {
card = init_chart_card();
cardsChart.add(card);
}*/
CardArrayAdapter mCardArrayAdapterGrades = new CardArrayAdapter(getActivity(), cardsChart);
CardListView listView = (CardListView) getActivity().findViewById(R.id.card_list);
if (listView != null) {
listView.setAdapter(mCardArrayAdapterGrades);
}
}
示例9: init_custom_card_expand_clicking_image
import it.gmariotti.cardslib.library.internal.Card; //导入依赖的package包/类
/**
* 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
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_example_card_expand4);
cardView.setCard(card);
}
示例10: initCards
import it.gmariotti.cardslib.library.internal.Card; //导入依赖的package包/类
private void initCards() {
ArrayList<Card> cards = new ArrayList<Card>();
for (int i=0;i<200;i++){
GdriveGridCard card = new GdriveGridCard(getActivity());
card.headerTitle="Folder "+i;
card.init();
cards.add(card);
}
CardGridArrayAdapter mCardArrayAdapter = new CardGridArrayAdapter(getActivity(),cards);
CardGridView gridView = (CardGridView) getActivity().findViewById(R.id.carddemo_grid_base);
if (gridView!=null){
gridView.setAdapter(mCardArrayAdapter);
}
}
示例11: init_card_inner_layout
import it.gmariotti.cardslib.library.internal.Card; //导入依赖的package包/类
/**
* 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
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_card_inner);
cardView.setCard(card);
}
示例12: init_card_without_shadow
import it.gmariotti.cardslib.library.internal.Card; //导入依赖的package包/类
/**
* This method builds a card without shadow
*/
private void init_card_without_shadow() {
//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);
//Hidden shadow
card.setShadow(false);
//Set card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_shadow_no);
cardView.setCard(card);
}
示例13: init_card_custom_shadow_layout
import it.gmariotti.cardslib.library.internal.Card; //导入依赖的package包/类
/**
* This methods builds a card with a custom shadow layout (compound view)
* <b>WARNING</b>
* See https://github.com/gabrielemariotti/cardslib/tree/master/SHADOW.md for more information.
* You can quickly modify your shadow with your style and drawable files without modifying shadow layout.
*/
private void init_card_custom_shadow_layout() {
//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 card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_shadow_layout);
cardView.setCard(card);
}
示例14: initCards
import it.gmariotti.cardslib.library.internal.Card; //导入依赖的package包/类
private void initCards() {
//Init an array of Cards
ArrayList<Card> cards = new ArrayList<Card>();
for (int i=0;i<200;i++){
Card card = init_standard_header_with_expandcollapse_button_custom_area("Header "+i,i);
cards.add(card);
}
CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(),cards);
CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_list_expand);
if (listView!=null){
listView.setAdapter(mCardArrayAdapter);
}
}
示例15: init
import it.gmariotti.cardslib.library.internal.Card; //导入依赖的package包/类
private void init() {
//Add thumbnail
CardThumbnail cardThumbnail = new CardThumbnail(mContext);
if (resourceIdThumbnail == 0)
cardThumbnail.setDrawableResource(R.drawable.ic_std_launcher);
else {
cardThumbnail.setDrawableResource(resourceIdThumbnail);
}
addCardThumbnail(cardThumbnail);
setOnClickListener(new OnCardClickListener() {
@Override
public void onClick(Card card, View view) {
Toast.makeText(mContext, "Click Listener",Toast.LENGTH_SHORT).show();
}
});
}