Swipe background color corner radius
amatkivskiy opened this issue ยท 2 comments
Hi @ernestoyaquello
First of all thanks a lot for this wonderful library ๐
I've just started using it so I might miss something but I am using MaterialCardView for the list item layout - swipe background comes without corner radius on it ๐
It can be easily demonstrated in your sample app if you set the corner radius to 20dp
(in list_item_vertical_list_cardview.xml
) for example.
I've made a quick demo video on this:
In my code, I need to set the corner radius to 0dp
to avoid such an issue ๐
Can you please help with this?
There are two ways to set a background that will appear when you swipe an item:
- You define a colour and an icon and let the library draw the background for you as a rectangle (for this, you need to set properties such as
behindSwipedItemBackgroundColor
,behindSwipedItemIconDrawableId
,behindSwipedItemIconMargin
, etc). - You define a custom layout that will be used as the background (by setting properties such as
behindSwipedItemLayoutId
andbehindSwipedItemSecondaryLayoutId
).
When using a CardView
, just use a custom layout with whatever corner radius you want. Take a look at the layout behind_swiped_grid_list.xml
of the sample project if you want a reference.
I hope that helps!
Thanks @ernestoyaquello I will try later ๐