@ -179,24 +179,22 @@ class HistoryAdapter(
private fun createExpandedContent ( context : Context ) : View
private fun createExpandedContent ( context : Context ) : View
{
{
return ScrollView ( context ) . apply {
return androidx . core . widget . Nested ScrollView( context ) . apply {
// Set a reasonable fixed height for the scrollable area
// Set a reasonable fixed height for the scrollable area
layoutParams = LinearLayout . LayoutParams (
layoutParams = LinearLayout . LayoutParams (
LinearLayout . LayoutParams . MATCH_PARENT ,
LinearLayout . LayoutParams . MATCH_PARENT ,
dpToPx ( context , 300 ) // Fixed height to ensure scrolling works
dpToPx ( context , 300 ) // Fixed height to ensure scrolling works
)
)
// Configure scrolling behavior
// Configure scrolling behavior optimized for nested scrolling
isFillViewport = false // Important: false so content can exceed container height
isFillViewport = false
isScrollbarFadingEnabled = false
isNestedScrollingEnabled = true
scrollBarStyle = View . SCROLLBARS_INSIDE_OVERLAY
isVerticalScrollBarEnabled = true
val contentContainer = LinearLayout ( context ) . apply {
val contentContainer = LinearLayout ( context ) . apply {
orientation = LinearLayout . VERTICAL
orientation = LinearLayout . VERTICAL
layoutParams = LinearLayout . LayoutParams (
layoutParams = LinearLayout . LayoutParams (
LinearLayout . LayoutParams . MATCH_PARENT ,
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 ) )
setPadding ( 0 , dpToPx ( context , 8 ) , 0 , dpToPx ( context , 16 ) )
tag = " expanded_container "
tag = " expanded_container "
@ -229,7 +227,7 @@ class HistoryAdapter(
{
{
private val cardContainer = itemView as LinearLayout
private val cardContainer = itemView as LinearLayout
private val collapsedContent = itemView . findViewWithTag < LinearLayout > ( " collapsed_content " )
private val collapsedContent = itemView . findViewWithTag < LinearLayout > ( " collapsed_content " )
private val expandedContent = itemView . findViewWithTag < ScrollView > ( " expanded_content " )
private val expandedContent = itemView . findViewWithTag < androidx . core . widget . Nested ScrollView> ( " expanded_content " )
private val expandedContainer = expandedContent . findViewWithTag < LinearLayout > ( " expanded_container " )
private val expandedContainer = expandedContent . findViewWithTag < LinearLayout > ( " expanded_container " )
// Collapsed content views
// Collapsed content views