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