title: How to implement Android listview opening gesture
body: <p>This is an open question about Android ListViews, Gestures and Animations.
  I'm really not familiar with the gestures in Android, so I'm just looking for ideas and grey matter on this.</p>
  <p>Here's two screenshot and <a href="http://www.iclarified.com/entry/index.php?enid=19961" rel="nofollow noreferrer">a video</a> examples of the effect on what I'm trying to cogitate. Consider taking a look at the video, it's really worth it.</p>
  <p><img src="https://i.stack.imgur.com/0FEOC.png" alt="enter image description here" /></p>
  <p><img src="https://i.stack.imgur.com/NlCF8.png" alt="enter image description here" /></p>
  <p>The screenshots are from an iOS open source project found <a href="https://github.com/mystcolor/JTGestureBasedTableViewDemo" rel="nofollow noreferrer">here</a>.</p>
  <p>The question is, how would you implement a &quot;listview opening&quot; gesture like the one I see more and more often in iPhone/iPad apps, but for Android ?</p>
  <p><em><strong>Edit 1, idea 1:</strong></em></p>
  <p>Okay first idea, AFAIK the Pinch gesture is somehow like a dragging gesture, so I guess we can get the X and Y coordinates of the two fingers on the screen?</p>
  <p>Next, <a href="https://stackoverflow.com/a/8095819/410712">the answer to this question</a> may help, the basic idea is:</p>
  <blockquote>
  <p>Get the index position of the first visible item in the list</p>
  <p>Get the index position of the last visible item in the list</p>
  <p>Iterate from the first index to the last with the getChildAt <strong>function</strong></p>
  <p>For each child, call the getLocationOnScreen <strong>method</strong> to get coordinates of the current iterated item</p>
  </blockquote>
  <p>After that, some comparison between the pinch gesture coordinates and each item coordinates might be done inside the loop to get the two items between which the new row must me inserted.</p>
  <p>Performances considerations appart I think it could work, but maybe there's a simpler way to get those two items(?).</p>
  <p>Who's next? :)</p>
  <p><em><strong>Update:</strong></em></p>
  <p>Thanks for the tip @rhlnair, I take this occasion to tell everybody that I started to work on this on my spare time and you are more then welcome to help on this.</p>
  <p>The project is at <a href="https://github.com/arnaudbos/Android-GestureListView" rel="nofollow noreferrer">https://github.com/arnaudbos/Android-GestureListView</a>. I started two different implementations on two different branches, and would enjoy anybody to create a new branch.</p>
  <p>I have something really encouraging in branch &quot;attemp-via-scale-gesture-detector&quot; but some side effects from the ListView.</p>
  <p>Come on folks!</p>