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

Fix margin/gap inconsistency between 5.0 and pre-5.0 #415

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chenxiaolong
Copy link

On pre-5.0, CardView (appcompat v7) adds a margin to draw the shadow. cardslib also adds a 6dp margin to the cards in ListViews and RecyclerViews, which results in large gaps between cards on pre-5.0 (see screenshots).

CardView has a card_view:cardUseCompatPadding attribute, which makes the 5.0 and pre-5.0 behavior match if set to true.

With this commit, ListView and RecyclerView now behave identically on <=4.4 and 5.0. (Also fixes shadows on the sides of cards on 5.0).

Platform Before After
4.4 ListView
4.4 RecyclerView
5.0 ListView
5.0 RecyclerView

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

Successfully merging this pull request may close these issues.

1 participant