MaterialList icon indicating copy to clipboard operation
MaterialList copied to clipboard

How to increase the spacing between cards

Open Shivam101 opened this issue 9 years ago • 6 comments

How do I increase the vertical and/or horizontal spacing between 2 cards ? I tried using divider:height in the MaterialList component, but it didn't work. How do I achieve this ?

Thanks !

Shivam101 avatar Apr 01 '15 10:04 Shivam101

Try it with through the LayoutManager of the RecyclerView. Retrieve it with getLayoutManager() and then use the .offsetChildrenHorizontal(int) or the vertical one.

FHellmann avatar Apr 01 '15 12:04 FHellmann

That doesn't seem to be working either. I have done this myList.getLayoutManager.offsetChildrenVeritical(20); But I am still getting the same result.

Shivam101 avatar Apr 07 '15 07:04 Shivam101

I did by copying @dexafree 's cards into my own app and editing XML. This you may make little modification for your own app too!

stripathi669 avatar Apr 09 '15 03:04 stripathi669

It looks like @stripathi669 's solution is the best, although it can be a little laboured doing that for every card... I will try to get a better solution

dexafree avatar Apr 09 '15 08:04 dexafree

yeah, i'd like to achieve the same thing too. By the way - on Android 4.x and 5.x the spacing is DIFFERENT.

tral avatar Apr 15 '15 21:04 tral

I created a pull request in order to set a custom divider to list. In order to modify the horizzontal padding I suggest you to copy @dexafree's card and editing yourself, as @stripathi669 already suggested.

claudiopastorini avatar Jun 27 '15 19:06 claudiopastorini