Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gap between Cards in CardListView #157

Closed
daidai123 opened this issue May 6, 2014 · 7 comments
Closed

Gap between Cards in CardListView #157

daidai123 opened this issue May 6, 2014 · 7 comments

Comments

@daidai123
Copy link

I want to remove space between cards in cardlistview. I am try to using cardslistview.setDivideHight(0), but it still contains space between cards. Can you instruct me what is the correct way to get ride off the space between cards?

@AkshayChordiya
Copy link

@gabrielemariotti
I too need this would be awesome I guess.

@gabrielemariotti
Copy link
Owner

It is quite simple:

Best option:
With built-in layouts you can override this values in your dimens.xml

     <!-- List -->
    <dimen name="list_card_padding_left">0dp</dimen>
    <dimen name="list_card_padding_right">0dp</dimen>
    <dimen name="list_card_padding_bottom">0dp</dimen>
    <dimen name="list_card_padding_top">0dp</dimen>

The default layouts have this style (check @layout/list_card_layout or @layout/list_card_thumbnail_layout)

<it.gmariotti.cardslib.library.view.CardView
    style="@style/list_card.base"/>

This style contains this values:

 <style name="list_card">
        <item name="android:paddingLeft">@dimen/list_card_padding_left</item>
        <item name="android:paddingRight">@dimen/list_card_padding_right</item>
        <item name="android:paddingBottom">@dimen/list_card_padding_bottom</item>
        <item name="android:paddingTop">@dimen/list_card_padding_top</item>
    </style>

Other options

  • override list_card style
  • use your custom layout or style

@AkshayChordiya
Copy link

@gabrielemariotti
It works close the issue

@daidai123
Copy link
Author

@gabrielemariotti
Thanks for your quick answer!

@h4ck3rviv3k
Copy link

@gabrielemariotti Thanks for this trick but still there is divider is showing between cards, could you please let me know how we can remove that too. Thanks

@VishalSheth4
Copy link

<android.support.v7.widget.CardView
    android:id="@+id/card_view"
    android:layout_width="fill_parent"
    android:layout_height="100dp"
    android:layout_gravity="center"
    card_view:cardPreventCornerOverlap="false"
    card_view:cardElevation="0dp"
    card_view:cardMaxElevation="0dp">

@akibraza91
Copy link

its not working for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants