From 293c0af19623481a1b971d66507fb425a787cec6 Mon Sep 17 00:00:00 2001 From: Quildra Date: Mon, 4 Aug 2025 18:25:44 +0100 Subject: [PATCH] fix: replace ScrollView with NestedScrollView for proper nested scrolling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Changed ScrollView to NestedScrollView in expanded history cards - Removed custom touch event handling as NestedScrollView handles nested scrolling natively - Fixed ScrollView reference in ViewHolder to use NestedScrollView - Enables proper scrolling within expanded Pokemon data sections 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../pokegoalshelper/ui/HistoryAdapter.kt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/quillstudios/pokegoalshelper/ui/HistoryAdapter.kt b/app/src/main/java/com/quillstudios/pokegoalshelper/ui/HistoryAdapter.kt index 3ef004f..b06668d 100644 --- a/app/src/main/java/com/quillstudios/pokegoalshelper/ui/HistoryAdapter.kt +++ b/app/src/main/java/com/quillstudios/pokegoalshelper/ui/HistoryAdapter.kt @@ -179,24 +179,22 @@ class HistoryAdapter( private fun createExpandedContent(context: Context): View { - return ScrollView(context).apply { + return androidx.core.widget.NestedScrollView(context).apply { // Set a reasonable fixed height for the scrollable area layoutParams = LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, dpToPx(context, 300) // Fixed height to ensure scrolling works ) - // Configure scrolling behavior - isFillViewport = false // Important: false so content can exceed container height - isScrollbarFadingEnabled = false - scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY - isVerticalScrollBarEnabled = true + // Configure scrolling behavior optimized for nested scrolling + isFillViewport = false + isNestedScrollingEnabled = true val contentContainer = LinearLayout(context).apply { orientation = LinearLayout.VERTICAL layoutParams = LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, - LinearLayout.LayoutParams.WRAP_CONTENT // Key: wrap content to allow scrolling + LinearLayout.LayoutParams.WRAP_CONTENT ) setPadding(0, dpToPx(context, 8), 0, dpToPx(context, 16)) tag = "expanded_container" @@ -229,7 +227,7 @@ class HistoryAdapter( { private val cardContainer = itemView as LinearLayout private val collapsedContent = itemView.findViewWithTag("collapsed_content") - private val expandedContent = itemView.findViewWithTag("expanded_content") + private val expandedContent = itemView.findViewWithTag("expanded_content") private val expandedContainer = expandedContent.findViewWithTag("expanded_container") // Collapsed content views