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


Java CardArrayAdapter.setInnerViewTypeCount方法代码示例

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


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

示例1: initCards

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

        ArrayList<Card> cards = new ArrayList<Card>();
        for (int i=0;i<50;i++){

            CardExample card = new CardExample(getActivity(),"My title "+i,"Inner text "+i);
            cards.add(card);

            CardExample2 cardx = new CardExample2(this.getActivity());
            cardx.title="Application example "+i;
            cardx.secondaryTitle="A company inc..."+i;
            cardx.rating=(float)(Math.random()*(5.0));
            cardx.count=i;
            cards.add(cardx);

            MayKnowCard card2= new MayKnowCard(getActivity());
            card2.setType(2); //Very important with different inner layout
            card2.setSwipeable(true);
            cards.add(card2);

        }

        // Provide a custom adapter.
        // It is important to set the viewTypeCount
        // You have to provide in your card the type value with {@link Card#setType(int)} method.
        CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(),cards);
        mCardArrayAdapter.setInnerViewTypeCount(3);

        // An alternative is to write a own CardArrayAdapter
        // MyCardArrayAdapter mCardArrayAdapter = new MyCardArrayAdapter(getActivity(),cards);


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


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