0

I want after swiped RecyclerView item to get my custom layout on the background. And I found a solution to which leads a lot of links. But I have problems using it.

Reference to the solution - https://stackoverflow.com/a/35667044/8013212

If you do exactly the same as in the example, then everything works. But in the example the clipBackground is aligned on the left side, and I need to center. Any attempts to change the alignment of the clipBackground cause it to stop displaying. Please tell me how to align the clipBackground in the center?

kulikovman
  • 333
  • 4
  • 8

2 Answers2

0

It's all about the way the layout is rendered. It uses not the coordinates, but the boundaries of the drawing, where 0/0 is the upper-left corner of the screen.

In the solution, clipBackground is placed on the right and drawn from the same location. Changing the alignment and the drawing side, when using backgroundView.setRight (0), causes the background layout to be placed outside the screen, or its width remains 0.

kulikovman
  • 333
  • 4
  • 8
0

I recently solved a similar problem. Here is a link to the video and source code: https://github.com/vvv2008/ListViewer

  • 1
    Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline. – Shashanth Mar 17 '18 at 07:10