Skip to content

Android

Adaptive layouts and Views

Edge-to-edge scaffolds, adaptive navigation for phones, tablets and foldables, and adopting Stance step by step in View-based apps.

Adaptive layouts

  • StanceScaffold draws edge to edge and passes system bar, cutout and keyboard insets to content.
  • StanceAdaptiveNavigation shows a bottom bar on compact widths, a rail on medium widths and a permanent drawer on expanded widths. Selection is kept when the window changes.
  • StanceAdaptiveGrid fits as many columns as the window allows.
  • rememberStanceWindowWidth() returns compact, medium or expanded, using the Android thresholds of 600dp and 840dp.
  • Predictive back works with the standard BackHandler and navigation APIs.

View interoperability

Adopt Stance one screen region at a time in View-based apps.

kotlin
// Host any Stance content in a ComposeView.
binding.composeContainer.setStanceContent {
    StanceBadge("Live", tone = StanceTone.Success)
}
xml
<!-- Or use a Stance view in XML. -->
<com.bindshq.stance.interop.StanceButtonView
    android:id="@+id/save"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

Accessibility

  • Every component sets roles, states and labels for TalkBack.
  • Touch targets are at least 48dp, even when the visual is smaller.
  • Text scales with the system font size, tested at 200%.
  • Focus is visible for keyboards and D-pads.
  • Errors and status messages are live regions, and swipe actions are also exposed as accessibility actions.