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


Java Card.setTitle方法代码示例

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


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

示例1: init_simple_card

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

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

示例2: 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

示例3: crouton1

import it.gmariotti.cardslib.library.internal.Card; //导入方法依赖的package包/类
/**
 * This method builds a simple 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)view.findViewById(R.id.carddemo_card_crouton_id);

    Card card = new Card(getActivity());
    card.setTitle("Crouton Card");
    card.setBackgroundResourceId(R.color.demoextra_card_background_color2);

    CardThumbnail thumb = new CardThumbnail(getActivity());
    thumb.setDrawableResource(R.drawable.ic_action_bulb);
    card.addCardThumbnail(thumb);

    cardView.setCard(card);

    final Crouton crouton;
    crouton = Crouton.make(getActivity(), view);
    crouton.show();

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

示例4: initCircleCard

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

        Card card = new Card(getActivity());
        card.setTitle("Title");
        card.setBackgroundResourceId(R.color.demo_card_background_color1);
        CardThumbnailCircle thumb = new CardThumbnailCircle(getActivity());
        card.addCardThumbnail(thumb);

        CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_circleleft);
        cardView.setCard(card);

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

示例5: init_cab

import it.gmariotti.cardslib.library.internal.Card; //导入方法依赖的package包/类
/**
 * Card with a CAB
 */
private void init_cab(){

    //Create a Card
    mCardCab = new Card(getActivity());

    //Create a CardHeader
    CardHeader header = new CardHeader(getActivity());

    //Set the header title
    header.setTitle(getString(R.string.demo_title_cab1));

    mCardCab.addCardHeader(header);

    //Set the card inner text
    mCardCab.setTitle(getString(R.string.demo_card_basetitle));

    //Set onClick listener
    mCardCab.setOnLongClickListener(new Card.OnLongCardClickListener() {
        @Override
        public boolean onLongClick(Card card, View view) {
            if (mActionMode != null) {
                view.setActivated(false);
                mActionMode.finish();
                return false;
            }
            // Start the CAB using the ActionMode.Callback defined above
            mActionMode = getActivity().startActionMode(mActionModeCallback);
            view.setActivated(true);
            return true;
        }
    });

    //Set card in the cardView
    cardViewCab = (CardView) getActivity().findViewById(R.id.carddemo_example_card_cab);
    cardViewCab.setCard(mCardCab);
}
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:40,代码来源:CardFragment.java

示例6: onCreateView

import it.gmariotti.cardslib.library.internal.Card; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.todo, container, false);

    Computer c0 = new Computer();
    Computer c1 = new Computer("MacBook Pro", "Marcus Gabilheri", false, "Out of disk space");
    Computer c2 = new Computer("Dell Dimension", "Old Person", true, "Too old");
    Computer c3 = new Computer("MacBook", "Hali Deubler", false, "Windows installed");
    Computer c4 = new Computer("MacBook Pro", "Ryan Dawkins", false, "Arch exploded");
    Computer c5 = new Computer("Lenovo Y500", "Aaron Weaver", false, "No retinas");

    ArrayList<Computer> computers = new ArrayList<Computer>(10);
    computers.add(c0);
    computers.add(c1);
    computers.add(c2);
    computers.add(c3);
    computers.add(c4);
    computers.add(c5);

    mCcomputerList = (CardListView) view.findViewById(R.id.computers_list);
    mCardsList = new ArrayList<Card>();
    for(int i = 0; i < computers.size(); i++) {
        // get current computer in list
        Computer temp = computers.get(i);

        //create card to display the computer
        Card card = new Card(getActivity());

        //create and add the header for the card from the owner name
        CardHeader header = new CardHeader(getActivity());
        card.addCardHeader(header);
        header.setTitle(temp.getOwnerName());

        //set the content of the card to the model name and problem with the computer
        card.setTitle("Model:" + "\n    " + temp.getModelName() + "\n\nProblem:" + "\n    " + temp.getProblem());
        card.setShadow(true);

        // select drawable based on whether or not the computer is a desktop
        CardThumbnail thumb = new CardThumbnail(getActivity());
        if (temp.isDesktop()) {
            thumb.setDrawableResource(R.drawable.ic_desktop);
        } else {
            thumb.setDrawableResource(R.drawable.ic_laptop);
        }
        card.addCardThumbnail(thumb);
        mCardsList.add(card);
    }

    mCardAdapter = new CardArrayAdapter(getActivity(), mCardsList);
    mCardAdapter.setEnableUndo(true);
    mCcomputerList.setAdapter(mCardAdapter);

    return view;
}
 
开发者ID:kylealanr,项目名称:IT_POS_Check_In,代码行数:55,代码来源:ToDo.java

示例7: crouton2

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

    LayoutInflater mInflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View view = mInflater.inflate(R.layout.carddemo_extras_crouton_card, null);

    CardView cardView= (CardView)view.findViewById(R.id.carddemo_card_crouton_id);

    Card card = new Card(getActivity());
    card.setTitle("Crouton Card");

    CardThumbnail thumb = new CardThumbnail(getActivity());
    thumb.setDrawableResource(R.drawable.ic_action_halt);
    card.addCardThumbnail(thumb);

    cardView.setCard(card);

    final Crouton crouton;
    crouton = Crouton.make(getActivity(), view);
    crouton.show();

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


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