RecyclerView scale center item

Tram Ho

1) Place the problem

Suppose the customer has a list of images and requests that this list be displayed on the screen and the center item is scaled more than the next item in the following manner:

2) Solution

There are many ways to do the above, in this article I will guide you to use RecyclerView to solve this problem.

As we can see, the item in the middle will be the largest (the center) and away from the center the item will be smaller.

Thus the size of the items will be inversely proportional to the distance between that item and the recyclerView’s center

item_empty.xml (Since we need a space at the beginning and end to display the first and last scale item)

So we have already solved the above problem ^^

Share the news now

Source : Viblo