From 246dbb96a0a2354dd5d760cc538dd49ef832175a Mon Sep 17 00:00:00 2001 From: Sparrow007 Date: Tue, 31 May 2022 01:30:59 +0530 Subject: [PATCH] upate the carouselRecyclerview --- .../carouselrecyclerview/CarouselRecyclerview.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/carouselrecyclerview/src/main/java/com/jackandphantom/carouselrecyclerview/CarouselRecyclerview.kt b/carouselrecyclerview/src/main/java/com/jackandphantom/carouselrecyclerview/CarouselRecyclerview.kt index 30fc240..87c23e2 100644 --- a/carouselrecyclerview/src/main/java/com/jackandphantom/carouselrecyclerview/CarouselRecyclerview.kt +++ b/carouselrecyclerview/src/main/java/com/jackandphantom/carouselrecyclerview/CarouselRecyclerview.kt @@ -104,8 +104,9 @@ class CarouselRecyclerview(context: Context, attributeSet: AttributeSet) : Recyc val actualPos: Int = getCarouselLayoutManager().getChildActualPos(i) var order: Int = i - // The number of intervals from the middle item if (actualPos != Int.MIN_VALUE) { + + // The number of intervals from the middle item val dist = actualPos - center // [< 0] indicates that the item is located to the left of the middle item and can be drawn in order // [< 0] indicates that the item is located to the left of the middle item and can be drawn in order