From e63e86e9d286b2538753b870bdef3c945af7ca8c Mon Sep 17 00:00:00 2001 From: Quildra Date: Mon, 4 Aug 2025 18:20:57 +0100 Subject: [PATCH] fix: ensure ScrollView content actually scrolls in expanded history cards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed ScrollView configuration to enable proper content scrolling - Set isFillViewport = false to allow content to exceed container height - Added proper layout parameters for content container (WRAP_CONTENT height) - Enabled vertical scroll bar indicators for user feedback - Restored reasonable 300dp height for scrollable area Key fixes: - Content container now uses WRAP_CONTENT height instead of constrained height - isFillViewport = false allows scrolling when content exceeds 300dp - isVerticalScrollBarEnabled = true provides scroll feedback - Content can now properly scroll vertically when Pokemon data is extensive The expanded Pokemon data sections will now actually scroll when content overflows the 300dp viewing area, making all comprehensive Pokemon information accessible. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../pokegoalshelper/ui/HistoryAdapter.kt | 18 ++++++++++-------- 1 file changed, 10 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 f14661c..3ef004f 100644 --- a/app/src/main/java/com/quillstudios/pokegoalshelper/ui/HistoryAdapter.kt +++ b/app/src/main/java/com/quillstudios/pokegoalshelper/ui/HistoryAdapter.kt @@ -180,23 +180,25 @@ class HistoryAdapter( private fun createExpandedContent(context: Context): View { return ScrollView(context).apply { - // Calculate max height as 60% of screen height for better scrolling - val displayMetrics = context.resources.displayMetrics - val maxHeight = (displayMetrics.heightPixels * 0.6).toInt() - + // Set a reasonable fixed height for the scrollable area layoutParams = LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, - maxHeight + dpToPx(context, 300) // Fixed height to ensure scrolling works ) - // Enable proper scrolling behavior - isFillViewport = true + // Configure scrolling behavior + isFillViewport = false // Important: false so content can exceed container height isScrollbarFadingEnabled = false scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY + isVerticalScrollBarEnabled = true val contentContainer = LinearLayout(context).apply { orientation = LinearLayout.VERTICAL - setPadding(0, dpToPx(context, 8), 0, dpToPx(context, 16)) // Add bottom padding for scroll + layoutParams = LinearLayout.LayoutParams( + LinearLayout.LayoutParams.MATCH_PARENT, + LinearLayout.LayoutParams.WRAP_CONTENT // Key: wrap content to allow scrolling + ) + setPadding(0, dpToPx(context, 8), 0, dpToPx(context, 16)) tag = "expanded_container" }