From dc074a370aef9aa9a0f51271b9493ac633a9ad4a Mon Sep 17 00:00:00 2001 From: Cheon Jaeung Date: Fri, 21 Nov 2025 20:45:36 +0900 Subject: [PATCH] Fix isPartiallyVisible was returns false when child is larger than parent If the child view is larger then parent container and child's start and end is out of bounds, The ViewBoundsHelper.isPartiallyVisible was returns false. It is incorrect. In this situation, the function should return true because event if child view start and end is invisible, the child view is partially visible. This commit fix this bug. --- .../com/cheonjaeung/simplecarousel/android/ViewBoundsHelper.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/simplecarousel/src/main/java/com/cheonjaeung/simplecarousel/android/ViewBoundsHelper.kt b/simplecarousel/src/main/java/com/cheonjaeung/simplecarousel/android/ViewBoundsHelper.kt index 43d424e..ba9bd85 100644 --- a/simplecarousel/src/main/java/com/cheonjaeung/simplecarousel/android/ViewBoundsHelper.kt +++ b/simplecarousel/src/main/java/com/cheonjaeung/simplecarousel/android/ViewBoundsHelper.kt @@ -95,8 +95,7 @@ class ViewBoundsHelper(private val parentInfoCallback: ParentInfoCallback) { parentStart: Int, parentEnd: Int ): Boolean { - if (childEnd < parentStart || childStart > parentEnd) return false - return childStart > parentStart || childEnd < parentEnd + return childEnd > parentStart && childStart < parentEnd } private fun isCompletelyVisible(