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


Java CardArrayAdapter类代码示例

本文整理汇总了Java中it.gmariotti.cardslib.library.internal.CardArrayAdapter的典型用法代码示例。如果您正苦于以下问题:Java CardArrayAdapter类的具体用法?Java CardArrayAdapter怎么用?Java CardArrayAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CardArrayAdapter类属于it.gmariotti.cardslib.library.internal包,在下文中一共展示了CardArrayAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateUi

import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的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: SectionedCardAdapter

import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
/**
 *
 * @param context             context
 * @param sectionResourceId   layout used by sections
 * @param cardArrayAdapter    cardArrayAdapter
 */
public SectionedCardAdapter(Context context, int sectionResourceId, CardArrayAdapter cardArrayAdapter) {
    mLayoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    mBaseAdapter = cardArrayAdapter;
    mSectionResourceId = sectionResourceId;

    mBaseAdapter.registerDataSetObserver(new DataSetObserver() {
        @Override
        public void onChanged() {
            mValid = !mBaseAdapter.isEmpty();
            notifyDataSetChanged();
        }

        @Override
        public void onInvalidated() {
            mValid = false;
            notifyDataSetInvalidated();
        }
    });
}
 
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:26,代码来源:SectionedCardAdapter.java

示例3: initCards

import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
private void initCards() {

		// Init an array of Cards
		ArrayList<Card> cardsChart = new ArrayList<Card>();
		Card card = init_chart_card();
		cardsChart.add(card);
		JsonObjResult tmp;
		for (int i = 0; i < Application.listaPostow.size(); i++) {
			tmp = Application.listaPostow.get(i);
			card = init_info_card(tmp.getBrief(), tmp.getStatus(), i, tmp.getDue_date());
			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,代码行数:20,代码来源:CardsPartyFragment.java

示例4: initCards

import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的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

示例5: initCards

import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的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

示例6: initCard

import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
/**
 * This method builds a simple card
 */
private void initCard() {

    //Init an array of Cards
    ArrayList<Card> cards = new ArrayList<Card>();
    for (int i = 0; i < 200; i++) {
        PicassoCard card = new PicassoCard(this.getActivity());
        card.setTitle("A simple card loaded with Picasso " + i);
        card.setSecondaryTitle("Simple text..." + i);
        card.setCount(i);
        cards.add(card);
    }

    CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(), cards);

    CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_extra_list_picasso);
    if (listView != null) {
        listView.setAdapter(mCardArrayAdapter);
    }

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

示例7: initCard

import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
/**
 * This method builds a simple card
 */
private void initCard() {

    //Init an array of Cards
    ArrayList<Card> cards = new ArrayList<Card>();
    for (int i = 0; i < 200; i++) {
        IonCard card = new IonCard(this.getActivity());
        card.setTitle("A simple card loaded with Ion " + i);
        card.setSecondaryTitle("Simple text..." + i);
        card.setCount(i);
        cards.add(card);
    }

    CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(), cards);

    CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_extra_list_picasso);
    if (listView != null) {
        listView.setAdapter(mCardArrayAdapter);
    }

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

示例8: initCard

import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
/**
 * This method builds a simple card
 */
private void initCard() {

    //Init an array of Cards
    ArrayList<Card> cards = new ArrayList<Card>();
    for (int i = 0; i < 200; i++) {
        UniversalImageLoaderCard card = new UniversalImageLoaderCard(this.getActivity(),options);
        card.setTitle("A simple card loaded with Universal-Image-Loader " + i);
        card.setSecondaryTitle("Simple text..." + i);
        card.setCount(i);
        cards.add(card);
    }

    CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(), cards);

    CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_extra_list_picasso);
    if (listView != null) {
        listView.setAdapter(mCardArrayAdapter);
    }

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

示例9: onCreateView

import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    this.container = container;

    View rootView = inflater.inflate(R.layout.fragment_reported_taxis, container, false);

    ArrayList<Card> cards = new ArrayList<Card>();
    cards.addAll(loadReportedTaxis());

    CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(rootView.getContext(), cards);
    CardListView listView = (CardListView) rootView.findViewById(R.id.reported_list);
    if (listView != null) {
        listView.setAdapter(mCardArrayAdapter);
    }

    dismissAnimation = (SwipeDismissAnimation) new SwipeDismissAnimation(getActivity()).setup(mCardArrayAdapter);

    FloatingActionButton floatingActionButton = (FloatingActionButton) rootView.findViewById(R.id.reportFab);
    floatingActionButton.attachToListView(listView);
    // floatingActionButton.setOnClickListener();

    return rootView;
}
 
开发者ID:mSobhy90,项目名称:TaxiFareCalculator,代码行数:24,代码来源:ReportedTaxisFragment.java

示例10: getMessageUndo

import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
@Override
public String getMessageUndo(CardArrayAdapter cardArrayAdapter, String[] itemIds, int[] itemPositions) {
    if (cardArrayAdapter!=null && cardArrayAdapter.getContext()!=null) {
        Resources res = cardArrayAdapter.getContext().getResources();
        if (res!=null)
            return res.getQuantityString(R.plurals.list_card_undo_items, itemPositions.length, itemPositions.length);
    }
    return null;
}
 
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:10,代码来源:UndoBarController.java

示例11: setAdapter

import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
/**
 * Set the adapter. You can provide a {@link CardArrayAdapter}, or a {@link it.gmariotti.cardslib.library.internal.CardCursorAdapter}
 * or a generic adapter.
 * Pay attention: your generic adapter has to call {@link CardArrayAdapter#getView} method
 *
 * @param adapter
 */
@Override
public void setAdapter(ListAdapter adapter) {
    if (adapter instanceof CardArrayAdapter){
        setAdapter((CardArrayAdapter)adapter);
    }else if (adapter instanceof CardCursorAdapter){
        setAdapter((CardCursorAdapter)adapter);
    }else {
        Log.w(TAG,"You are using a generic adapter. Pay attention: your adapter has to call cardArrayAdapter#getView method" );
        super.setAdapter(adapter);
    }
}
 
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:19,代码来源:CardListView.java

示例12: setExternalAdapter

import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
/**
 * You can use this method, if you are using external adapters.
 * Pay attention. The generic adapter#getView() method has to call the cardArrayAdapter#getView() method to work.
 *
 * @param adapter {@link ListAdapter} generic adapter
 * @param cardArrayAdapter    {@link CardArrayAdapter} cardArrayAdapter
 */
public void setExternalAdapter(ListAdapter adapter, CardArrayAdapter cardArrayAdapter) {

    setAdapter(adapter);

    mAdapter=cardArrayAdapter;
    mAdapter.setCardListView(this);
    mAdapter.setRowLayoutId(list_card_layout_resourceID);
}
 
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:16,代码来源:CardListView.java

示例13: setupCardListView

import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
/**
 * Retrieves the cardListView
 */
private void setupCardListView() {

    if (mBaseAdapter != null) {
        if (mBaseAdapter instanceof CardArrayAdapter) {
            mCardListView = ((CardArrayAdapter) mBaseAdapter).getCardListView();
        }
    }

    if (mCardListView == null) {
        throw new IllegalStateException("BaseDismissAnimation works with a CardListView");
    }
}
 
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:16,代码来源:BaseDismissAnimation.java

示例14: initCards

import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
private void initCards() {

        //Init an array of Cards
        ArrayList<Card> cards = new ArrayList<Card>();

        for (int i=0;i<100;i++){
            GooglePlaySmallCard card = new GooglePlaySmallCard(this.getActivity());
            card.setTitle("Application example " + i);
            card.setSecondaryTitle("A company inc..." + i);
            card.setRating((float) (Math.random() * (5.0)));
            card.setId("" + i);

            //Only for test, change some icons
            if ((i > 10 && i < 15) || (i > 35 && i < 45)) {
                card.setResourceIdThumbnail(R.drawable.ic_launcher);
            }

            card.init();
            cards.add(card);
        }

        mCardArrayAdapter = new CardArrayAdapter(getActivity(),cards);

        //Enable undo controller!
        mCardArrayAdapter.setEnableUndo(true);

        //CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_list_gplaycard);
        if (mListView!=null){
            mListView.setAdapter(mCardArrayAdapter);
        }
    }
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:32,代码来源:ListGplayUndoCardFragment2.java

示例15: initCards

import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
private void initCards() {

        //Init an array of Cards
        ArrayList<Card> cards = new ArrayList<Card>();
        for (int i = 0; i < 5; i++) {
            ColorCard card = new ColorCard(this.getActivity());
            card.setTitle("A simple colored card " + i);
            card.setCount(i);
            switch (i) {
                case 0:
                    card.setBackgroundResourceId(R.drawable.demo_card_selector_color5);
                    break;
                case 1:
                    card.setBackgroundResourceId(R.drawable.demo_card_selector_color4);
                    break;
                case 2:
                    card.setBackgroundResourceId(R.drawable.demo_card_selector_color3);
                    break;
                case 3:
                    card.setBackgroundResourceId(R.drawable.demo_card_selector_color2);
                    break;
                case 4:
                    card.setBackgroundResourceId(R.drawable.demo_card_selector_color1);
                    break;
            }

            cards.add(card);
        }

        CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(), cards);

        CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_list_colors);
        if (listView != null) {
            listView.setAdapter(mCardArrayAdapter);
        }
    }
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:37,代码来源:ListColorFragment.java


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