本文整理汇总了Java中it.gmariotti.cardslib.library.view.CardView类的典型用法代码示例。如果您正苦于以下问题:Java CardView类的具体用法?Java CardView怎么用?Java CardView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CardView类属于it.gmariotti.cardslib.library.view包,在下文中一共展示了CardView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: crouton1
import it.gmariotti.cardslib.library.view.CardView; //导入依赖的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
示例17: setupSwipeableAnimation
import it.gmariotti.cardslib.library.view.CardView; //导入依赖的package包/类
/**
* Sets SwipeAnimation on List
*
* @param card {@link it.gmariotti.cardslib.library.internal.Card}
* @param cardView {@link it.gmariotti.cardslib.library.view.CardView}
*/
protected void setupSwipeableAnimation(final Card card, CardView cardView) {
cardView.setOnTouchListener(null);
/*
if (card.isSwipeable()){
if (mOnTouchListener == null){
mOnTouchListener = new SwipeDismissListViewTouchListener(mCardListView, mCallback);
// Setting this scroll listener is required to ensure that during
// ListView scrolling, we don't look for swipes.
mCardListView.setOnScrollListener(mOnTouchListener.makeScrollListener());
}
cardView.setOnTouchListener(mOnTouchListener);
}else{
//prevent issue with recycle view
cardView.setOnTouchListener(null);
}*/
}
开发者ID:tajchert,项目名称:CEEHack,代码行数:26,代码来源:CardCursorAdapter.java
示例18: setupSwipeableAnimation
import it.gmariotti.cardslib.library.view.CardView; //导入依赖的package包/类
/**
* Removes SwipeAnimation on Grid
*
* @param card {@link Card}
* @param cardView {@link CardView}
*/
protected void setupSwipeableAnimation(final Card card, CardView cardView) {
cardView.setOnTouchListener(null);
/*if (card.isSwipeable()){
if (mOnTouchListener == null){
mOnTouchListener = new SwipeDismissListViewTouchListener(mCardGridView, mCallback);
// Setting this scroll listener is required to ensure that during
// ListView scrolling, we don't look for swipes.
mCardGridView.setOnScrollListener(mOnTouchListener.makeScrollListener());
}
cardView.setOnTouchListener(mOnTouchListener);
}else{
//prevent issue with recycle view
cardView.setOnTouchListener(null);
}*/
}
开发者ID:tajchert,项目名称:CEEHack,代码行数:25,代码来源:CardGridArrayAdapter.java
示例19: setupSwipeableAnimation
import it.gmariotti.cardslib.library.view.CardView; //导入依赖的package包/类
/**
* Sets SwipeAnimation on List
*
* @param card {@link Card}
* @param cardView {@link it.gmariotti.cardslib.library.view.CardView}
*/
protected void setupSwipeableAnimation(final Card card, CardView cardView) {
cardView.setOnTouchListener(null);
/*
if (card.isSwipeable()){
if (mOnTouchListener == null){
mOnTouchListener = new SwipeDismissListViewTouchListener(mCardListView, mCallback);
// Setting this scroll listener is required to ensure that during
// ListView scrolling, we don't look for swipes.
mCardListView.setOnScrollListener(mOnTouchListener.makeScrollListener());
}
cardView.setOnTouchListener(mOnTouchListener);
}else{
//prevent issue with recycle view
cardView.setOnTouchListener(null);
}*/
}
开发者ID:tajchert,项目名称:CEEHack,代码行数:26,代码来源:CardGridCursorAdapter.java
示例20: onCreate
import it.gmariotti.cardslib.library.view.CardView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_set_unknown_environment_password);
passphraseCardView = (CardView) findViewById(R.id.card_passphrase);
listPreferredItemHeight = (int) getListPreferredItemHeight();
textViewNormalColor = Color.argb(0, 0, 0, 0);
textViewTouchedColor = getResources().getColor(R.color.text_view_touched);
marginTopLayoutParams = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
marginTopLayoutParams.topMargin = convertDipToPx(8);
doneButton = (Button) findViewById(R.id.button_confirm);
resetButton = (Button) findViewById(R.id.button_reset);
setUpPassphraseElements();
initPassphraseElements();
setUpButtons();
getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, convertDipToPx(expandedHeight));
}
开发者ID:aravindsagar,项目名称:SmartLockScreen,代码行数:24,代码来源:SetUnknownEnvironmentPassword.java
注:本文中的it.gmariotti.cardslib.library.view.CardView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论