Note that there are some explanatory texts on larger screens.

plurals
  1. POSwipe to switch tabs on Android, like the YouTube/Google Music apps
    primarykey
    data
    text
    <p>In their latest versions of their apps, Google has implemented a pretty cool way of swiping between tabs versus clicking tab headers. I was wondering if someone has more concrete ideas of how this is done.</p> <p>Here are some thoughts - feel free to critique:</p> <p>My initial thought is that this isn't a standard <code>TabActivity</code> which hosts child activities. Infact, I don't even think it's a custom <code>ActivityGroup</code> either. The row of tabs scrolls when swiped, but doesn't cause the active tab to switch.</p> <p>Swiping the main content of the tab exhibits interesting behavior. I suspect there is a GestureListener attached to main content area. As tabs are swiped, rows from the adjacent tab become visible. This seems to suggest that this is a horizontally scrollable group of <code>ListView</code>s. It's almost like a horizontally scrollable HTML div, where all content already exists but comes into view when swiped. I'm not really sure how rendering of the rows is handled though (traditionally, rows are built and displayed when scrolling a list up/down not left/right). So maybe it's a custom <code>ListView</code> implementation too? When not scrolling side-to-side, it behaves as you would expect a regular <code>ListView</code> to, including fast-scrolling and glow effect when pulled down.</p> <p>The row of tabs is probably a <code>ScrollView</code>, as evidenced by the glow effect when swiped to the edges. The row of the tab contents isn't.</p> <p>I'm trying to build a mental model of the different pieces that comprise this really nifty piece of UI. Any insights are much appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload