Azoft / CarouselLayoutManager

Android Carousel LayoutManager for RecyclerView
Apache License 2.0
2.56k stars 367 forks source link

How to increase alpha value to side item to center item. #91

Closed BhargaviDeviYamanuri closed 5 years ago

BhargaviDeviYamanuri commented 5 years ago

I have used this library to show the image slide show i want to add shade for left and right images which i achieved by doing customization code is below

if (-0.5 < itemPositionToCenterDiff && itemPositionToCenterDiff < 0.5) { child.setAlpha(1f); } else { child.setAlpha(0.5f); }

But i want the shade effect as increasing and decreasing smoothly. any one can help me. See the attached gif to clear understanding. animation

mig35 commented 5 years ago

@BhargaviDeviYamanuri Hi there.

You can do this by changing the code in CarouselZoomPostLayoutListener. So extend or create your own implementation and do alpha change near the translation and zoom changes.