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


Java CardView类代码示例

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


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

示例1: changeOverflowIconSelection

import it.gmariotti.cardslib.library.view.CardView; //导入依赖的package包/类
/**
 * Internal method to change the state of overflow icon on the view and on the model
 *
 * @param selected
 */
protected void changeOverflowIconSelection(boolean selected){

    if (mCard==null) return;

    //Change the value on the card and inside
    CardHeader header = mCard.getCardHeader();
    if (header!=null){
        this.selected=selected;
        header.setOverflowSelected(selected);
    }

    //Change the imageButton state
    CardView cardView = mCard.getCardView();
    if (cardView!=null){
        if (cardView.getInternalHeaderLayout()!=null && cardView.getInternalHeaderLayout().getImageButtonOverflow()!=null)
            cardView.getInternalHeaderLayout().getImageButtonOverflow().setSelected(selected);
    }
}
 
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:24,代码来源:BaseOverflowAnimation.java

示例2: getVisibleViewsForCards

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

示例3: setItemChecked

import it.gmariotti.cardslib.library.view.CardView; //导入依赖的package包/类
/**
 * Set card checked state and update the internal state
 *
 * @param card      CardView object whose state is to be updated
 * @param value     Checked or not
 */
public void setItemChecked(CardView card, boolean value) {
    int id = Integer.parseInt(card.getCard().getId());

    card.setSelected(value);
    card.setActivated(value);

    // update the array containing ids of checked cards
    if (value) {
        mCheckedIds.put(id, true);
    } else {
        mCheckedIds.delete(id);
    }

    // To force redrawing the actionbar view and show updated number of
    // selected items
    if (mMultiChoiceCallback != null && mMultiChoiceCallback.isActionModeActive()) {
        mMultiChoiceCallback.getActionMode().invalidate();
    }
}
 
开发者ID:vishesh,项目名称:sealnote,代码行数:26,代码来源:StaggeredGridAdapter.java

示例4: initCardMayKnow

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

    //Create a Card
    MayKnowCard card= new MayKnowCard(getActivity());
    card.setShadow(false);

    //Set card in the cardView
    CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_MayKnow);
    cardView.setCard(card);

    MayKnowCard card2 = new MayKnowCard(getActivity());
    card2.addCardHeader(null);
    card2.setShadow(true);
    CardView mayView2 = (CardView) getActivity().findViewById(R.id.carddemo_MayKnow2);
    mayView2.setCard(card2);

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

示例5: init_custom_card_expand

import it.gmariotti.cardslib.library.view.CardView; //导入依赖的package包/类
/**
 * This method builds a custom card with expand/collapse action clickable in all card view
 */
private void init_custom_card_expand() {

    //Create a Card
    CustomCard card = new CustomCard(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);


    //Set card in the cardView
    CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_example_card_expand2);
    ViewToClickToExpand viewToClickToExpand =
            ViewToClickToExpand.builder()
                    .setupView(cardView);
    card.setViewToClickToExpand(viewToClickToExpand);
    cardView.setCard(card);
}
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:24,代码来源:CardExpandFragment.java

示例6: init_custom_card_expand_clicking_text

import it.gmariotti.cardslib.library.view.CardView; //导入依赖的package包/类
/**
 * This method builds a custom card with expand/collapse action clickable in all card view
 */
private void init_custom_card_expand_clicking_text() {

    //Create a Card
    CustomCard2 card = new CustomCard2(getActivity());
    card.setTitle("Click here to expand/collapse");

    //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);


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

示例7: init_custom_card_expand_clicking_image

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

示例8: init_simple_card

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

示例9: init_card_inner_layout

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

示例10: init_card_without_shadow

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

示例11: init_card_custom_shadow_layout

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

示例12: init_standard_header_without_buttons

import it.gmariotti.cardslib.library.view.CardView; //导入依赖的package包/类
/**
 * This method builds a standard header without buttons
 */
private void init_standard_header_without_buttons() {

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

示例13: init_header_with_custom_inner_layout

import it.gmariotti.cardslib.library.view.CardView; //导入依赖的package包/类
/**
 * This method builds a header with custom inner layout
 */
private void init_header_with_custom_inner_layout() {

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

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

    //Add Header to card
    card.addCardHeader(header);

    //Set card in the cardView
    CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_header_inner);

    cardView.setCard(card);
}
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:20,代码来源:HeaderFragment.java

示例14: init_header_with_custom_layout

import it.gmariotti.cardslib.library.view.CardView; //导入依赖的package包/类
/**
 * This method builds a header with full custom layout
 */
private void init_header_with_custom_layout() {

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

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

    //Add Header to card
    card.addCardHeader(header);

    //Set card in the cardView
    CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_header_layout);

    cardView.setCard(card);
}
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:20,代码来源:HeaderFragment.java

示例15: setupInnerViewElements

import it.gmariotti.cardslib.library.view.CardView; //导入依赖的package包/类
@Override
public void setupInnerViewElements(ViewGroup parent, View view) {

    TextView title = (TextView) view.findViewById(R.id.carddemo_mayknow_main_inner_title);
    TextView subtitle = (TextView) view.findViewById(R.id.carddemo_mayknow_main_inner_subtitle);
    TextView add = (TextView) view.findViewById(R.id.carddemo_mayknow_main_inner_button);

    title.setText(getContext().getString(R.string.may_know_card_inner_title));
    subtitle.setText(getContext().getString(R.string.may_know_card_inner_subtitle));
    add.setClickable(true);

    CardView cardView = getCardView();
    CardThumbnailView thumb = cardView.getInternalThumbnailLayout();
    if (thumb != null) {
        ViewGroup.LayoutParams lp = thumb.getLayoutParams();
        if (lp instanceof ViewGroup.MarginLayoutParams) {
            ((ViewGroup.MarginLayoutParams) lp).setMargins(25, 0, 0, 5);
        }
    }


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


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