当前位置: 首页>>代码示例>>Java>>正文


Java Card类代码示例

本文整理汇总了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);
}
 
开发者ID:thomashaertel,项目名称:android-billing,代码行数:19,代码来源:PurchaseFragment.java

示例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();
}
 
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:25,代码来源:CardView.java

示例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;
}
 
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:31,代码来源:CardView.java

示例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();
}
 
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:25,代码来源:BaseCardOverlayAnimation.java

示例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;
}
 
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:22,代码来源:BaseDismissAnimation.java

示例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();

}
 
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:25,代码来源:BaseDismissAnimation.java

示例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();
}
 
开发者ID:madjidtaha,项目名称:handy,代码行数:21,代码来源:GridGplayFragment.java

示例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);
		}
	}
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:25,代码来源:CardsDetailFragment.java

示例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);
}
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:23,代码来源:CardExpandFragment.java

示例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);
        }
    }
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:19,代码来源:GridBaseFragment.java

示例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);
}
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:24,代码来源:CardFragment.java

示例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);
}
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:24,代码来源:ShadowFragment.java

示例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);
}
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:24,代码来源:ShadowFragment.java

示例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);
        }
    }
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:17,代码来源:ListExpandCardFragment.java

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


        }
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:23,代码来源:ListGplayCardCABFragment.java


注:本文中的it.gmariotti.cardslib.library.internal.Card类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。