Skip to content

Bind app structure: TopAppBar family, TabRow family, Snackbar, Badge, ListItem #13

@jonathanpeppers

Description

@jonathanpeppers

Why

The Compose app-structure components — what most apps build their
chrome out of — are entirely missing:

  • TopAppBar, CenterAlignedTopAppBar, MediumTopAppBar,
    LargeTopAppBar (androidx.compose.material3.AppBarKt)
  • TabRow, ScrollableTabRow, PrimaryTabRow, SecondaryTabRow,
    Tab, LeadingIconTab (androidx.compose.material3.TabRowKt +
    TabKt)
  • Snackbar, SnackbarHost, SnackbarHostState
    (androidx.compose.material3.SnackbarKt) — also needed by Scaffold's
    snackbarHost slot in Bind Scaffold and use it in the sample #12
  • Badge, BadgedBox (androidx.compose.material3.BadgeKt)
  • ListItem (androidx.compose.material3.ListItemKt)

What

Bind each via the same shape as the existing facades. Most of these
have stripped overloads (color-bearing @JvmInline value class params),
so they'll need raw-JNI bridges + declarative [ComposeDefaults]
attributes. Verify mangled names with javap against
Xamarin.AndroidX.Compose.Material3Android 1.4.0.3.

State holder: Snackbar needs SnackbarHostState. Check whether
SnackbarHostState is plain enough to use the bound C# constructor or
needs the same JNI-bridge treatment as DatePickerState /
TimePickerState from PR #9.

Sample

Wrap the per-tab content in a Scaffold (depends on #12) with:

  • A CenterAlignedTopAppBar showing the current tab name as title
  • The existing NavigationBar as bottomBar
  • Replace the home-grown NavigationBar tab switcher with the proper
    TabRow + Tab API on at least one tab to demonstrate it
  • Add a Snackbar triggered by a button on the Buttons tab

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions