MaterialList
MaterialList copied to clipboard
How to increase the spacing between cards
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 !
Try it with through the LayoutManager of the RecyclerView. Retrieve it with getLayoutManager() and then use the .offsetChildrenHorizontal(int) or the vertical one.
That doesn't seem to be working either. I have done this myList.getLayoutManager.offsetChildrenVeritical(20); But I am still getting the same result.
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!
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
yeah, i'd like to achieve the same thing too. By the way - on Android 4.x and 5.x the spacing is DIFFERENT.
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.