Browse Source

fix: improve scrolling behavior for expanded history cards

- Increased ScrollView max height from 300dp to 60% of screen height
- Added proper scrolling configuration with isFillViewport and scroll bar settings
- Enhanced bottom padding for better scroll experience
- Enabled visible scroll indicators for better user feedback

Changes:
- Dynamic height calculation based on screen size for better adaptability
- isFillViewport = true for proper scroll behavior when content is smaller
- isScrollbarFadingEnabled = false for persistent scroll indicators
- scrollBarStyle = SCROLLBARS_INSIDE_OVERLAY for better visibility
- Increased bottom padding to 16dp for comfortable scrolling

The expanded Pokemon cards can now properly scroll when data exceeds the visible area, ensuring all comprehensive Pokemon information is accessible.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
feature/pgh-1-results-display-history
Quildra 5 months ago
parent
commit
6319f0f9d9
  1. 13
      app/src/main/java/com/quillstudios/pokegoalshelper/ui/HistoryAdapter.kt

13
app/src/main/java/com/quillstudios/pokegoalshelper/ui/HistoryAdapter.kt

@ -180,14 +180,23 @@ 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()
layoutParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
dpToPx(context, 300) // Max height for expanded content
maxHeight
)
// Enable proper scrolling behavior
isFillViewport = true
isScrollbarFadingEnabled = false
scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY
val contentContainer = LinearLayout(context).apply {
orientation = LinearLayout.VERTICAL
setPadding(0, dpToPx(context, 8), 0, 0)
setPadding(0, dpToPx(context, 8), 0, dpToPx(context, 16)) // Add bottom padding for scroll
tag = "expanded_container"
}

Loading…
Cancel
Save