Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>EDIT:</p> <p>The solution I talk about below had one major flaw, it didn't allow for the pinned headers to respond to touch events. This was a major concern for me as I needed each header to be a button that had its own unique response. I worked on this issue and after a lot of tweaking and changes I got a system that is closer to what I was looking for. It no longer pins view on the bottom but will allow for the headers to accept touch events whether pinned or in the list. If you want to try it out, the discussion and sample project are located here:</p> <p><a href="https://groups.google.com/d/msg/android-developers/VMr3CA_H798/G23oRmpfLKgJ" rel="nofollow noreferrer">https://groups.google.com/d/msg/android-developers/VMr3CA_H798/G23oRmpfLKgJ</a></p> <p>ORIGINAL:</p> <p>After more searching and a little tweaking I found a solution that will work for me. I ended up using some stuff that was buried in the Android source code and tweaked it a little to work with the data structures I need...</p> <ul> <li><a href="http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.3_r2.1/com/android/common/widget/CompositeCursorAdapter.java" rel="nofollow noreferrer">CompositeCursorAdapter</a> - Extends BaseAdapter and creates the interface for the header interaction</li> <li><a href="http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.3_r2.1/com/android/contacts/common/list/PinnedHeaderListAdapter.java" rel="nofollow noreferrer">PinnedHeaderListAdapter</a> - Extends CompositeCursorAdapter and implements the interface for the PinnedHeaderListView</li> <li><a href="http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.2.2_r1/com/android/contacts/widget/PinnedHeaderListView.java" rel="nofollow noreferrer">PinnedHeaderListView</a> - Extends ListView and handles all of the header tracking and drawing</li> </ul> <p>In the CompositeCursorAdapter I just removed the Partition class and replaced it with the data structure I needed. Those updates caused some updated in PinnedHeaderListAdapter. I also had to create another adapter extending PinnedHeaderListAdapter that handled all of the final method implementations of PinnedHeaderListAdapter and CompositeCursorAdapter. Using this I ended up with a list that looked like this...</p> <p><img src="https://i.stack.imgur.com/F2ukw.png" alt="One pinned header"> <img src="https://i.stack.imgur.com/T39we.png" alt="Stacked pinned headers"></p> <p>If anyone needs more details, comment below and I'll try to answer any questions or post code as needed</p>
    singulars
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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