~/talk

Building an adaptive layout with SlidingPaneLayout

Talkat Google I/O 2022 · 2022-05-11..05-12· [android]
links:none on file
slides:none on file

Shows how to convert a single-activity app into a responsive list‑detail layout using SlidingPaneLayout, replacing FrameLayout root with SlidingPaneLayout and adding a FragmentContainerView as the detail pane. Uses fixed widths 550dp and 300dp so 550dp + 300dp = 850dp to hit the breakpoint, sets layout_weight=1 on the detail pane, implements a custom OnBackPressedCallback plus panel slide listener to close the pane on Back, and sets lockMode=LOCKED to disable swipe gestures. Uses the resizable emulator for testing.

AI-written summary · about

  1. 0:00Intro
  2. 0:45Demo
  3. 4:04Code
  4. 7:53Layout Weight
  5. 11:48Back Navigation
  6. 12:18Custom Callback
  7. 13:33Enabling SlidingPaneLayout
  8. 14:30Monitoring SlidingPaneLayout
  9. 16:08Init Block
  10. 20:30Outro
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.