Skip to content

fix: Android grouped list section spacing and header bands - #65

Open
SRWieZ wants to merge 2 commits into
NativePHP:mainfrom
SRWieZ:fix/android-grouped-list-parity
Open

fix: Android grouped list section spacing and header bands#65
SRWieZ wants to merge 2 commits into
NativePHP:mainfrom
SRWieZ:fix/android-grouped-list-parity

Conversation

@SRWieZ

@SRWieZ SRWieZ commented Aug 23, 2026

Copy link
Copy Markdown
Member

What's wrong

Two things make a grouped native:list look broken on Android while the same Blade is fine on iOS:

  1. Cards stick together. Android only spaces sections using a header's top padding or a footer's bottom padding. A section with no header right after a section with no footer gets no gap at all — its card sits flush against the previous one.
  2. Section headers show as coloured bands. Android pins every grouped header and paints it with an opaque colorScheme.background so rows don't show through while pinned. On a screen whose background isn't exactly that colour, each header is a stripe across the screen. iOS inset-grouped headers don't pin and paint nothing.

What this does

Two small commits, one per fix:

  • A headerless grouped section gets the same 20dp gap a header would have given it.
  • Grouped headers scroll with their section and have no background. Plain lists (->plain()) keep their sticky, opaque header.

No PHP or iOS changes.

Before / after (Android emulator, API 36, same Blade)

@SRWieZ SRWieZ changed the title Android: space headerless grouped sections and size trailing text like iOS Android: match iOS inset-grouped list spacing, headers and trailing text Aug 23, 2026
SRWieZ added 2 commits August 23, 2026 17:47
In an inset-grouped `native:list`, Android only gets its vertical rhythm
from a section header's top padding (20dp) and a footer's bottom padding.
A section with no header that follows a section with no footer therefore
renders with zero gap — its card sits flush against the previous card —
while the same Blade on iOS is spaced by `.insetGrouped` regardless.

Emit a 20dp spacer item above any grouped section that has no header, so
the gap matches what a header would have provided. Plain (`->plain()`)
lists are untouched: flat rows stay flush, as on iOS.
In an inset-grouped list Android pinned every section header and painted
it with an opaque colorScheme.background so rows would not show through
while pinned. On a screen whose background is not that exact colour the
header rendered as a coloured band across the width (see screenshot in
the PR). iOS .insetGrouped headers never pin and draw no background; only
plain-style headers stick.

Render grouped headers as ordinary items with no background, and keep the
sticky, opaque header for plain lists.
@SRWieZ
SRWieZ force-pushed the fix/android-grouped-list-parity branch from c224ac8 to d403372 Compare August 23, 2026 16:03
@SRWieZ SRWieZ changed the title Android: match iOS inset-grouped list spacing, headers and trailing text Android: fix grouped list section spacing and header bands Aug 23, 2026
@SRWieZ SRWieZ changed the title Android: fix grouped list section spacing and header bands fix: Android grouped list section spacing and header bands Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant