item-decoration

How to apply ItemDecoration from left and right side both to RecyclerView item?

只谈情不闲聊 提交于 2021-01-27 07:34:52
问题 I have been trying to achieve this for so long. What I want is to overlap the selected RecyclerView item from left and right as shown in the picture below. I'm able to achieve left or right by ItemDecoration like below: class OverlapDecoration(private val overlapWidth:Int) : RecyclerView.ItemDecoration() { private val overLapValue = -40 val TAG = OverlapDecoration::class.java.simpleName override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State?) {

How to apply ItemDecoration from left and right side both to RecyclerView item?

不想你离开。 提交于 2021-01-27 07:32:13
问题 I have been trying to achieve this for so long. What I want is to overlap the selected RecyclerView item from left and right as shown in the picture below. I'm able to achieve left or right by ItemDecoration like below: class OverlapDecoration(private val overlapWidth:Int) : RecyclerView.ItemDecoration() { private val overLapValue = -40 val TAG = OverlapDecoration::class.java.simpleName override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State?) {

How to apply ItemDecoration from left and right side both to RecyclerView item?

给你一囗甜甜゛ 提交于 2021-01-27 07:31:23
问题 I have been trying to achieve this for so long. What I want is to overlap the selected RecyclerView item from left and right as shown in the picture below. I'm able to achieve left or right by ItemDecoration like below: class OverlapDecoration(private val overlapWidth:Int) : RecyclerView.ItemDecoration() { private val overLapValue = -40 val TAG = OverlapDecoration::class.java.simpleName override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State?) {