Re: [android-developers] Re: Adding separators to a ListView

2010-11-26 Thread Mark Murphy
BTW, support for MergeAdapter is best on the [cw-android] Google Group: http://groups.google.com/group/cw-android I try not to clutter up the main lists with CommonsWare-specific stuff. Besides, I'm more likely to notice the question. :-) On Fri, Nov 26, 2010 at 8:14 AM, Neilz wrote: > For each

Re: [android-developers] Re: Adding separators to a ListView

2010-11-19 Thread Kostya Vasilyev
Ok, here it is: http://kmansoft.wordpress.com/2010/11/16/adding-group-headers-to-listview/ -- Kostya 15.11.2010 21:48, Neilz пишет: Yes please Kostya, and thanks for your input :-) On Nov 15, 5:50 pm, Kostya Vasilyev wrote: Since this came up before, and generally *seems* useful, should I p

Re: [android-developers] Re: Adding separators to a ListView

2010-11-18 Thread Kostya Vasilyev
Neil, If your data is sitting in an in-memory collection, you can still use my pattern, and in fact it's even easier. Derive your adapter from BaseAdapter, override getViewTypeCount, getItemViewType, and getView. Make a small change to isNewGroup, and get the previous data item from the in

Re: [android-developers] Re: Adding separators to a ListView

2010-11-17 Thread george barber
what is it with this links did you know at the moment im at school! lol On Mon, Nov 15, 2010 at 3:10 PM, Thierry Legras wrote: > Hi, > > I found something that highlights Kostya solution including a trick to > avoir header to appear selected: > > http://thebogles.com/blog/2010/02/section-headers

Re: [android-developers] Re: Adding separators to a ListView

2010-11-16 Thread Kostya Vasilyev
This won't work right - you still want to get clicks on the data portion of a layout that starts a new group. -- Kostya Vasilyev -- http://kmansoft.wordpress.com 17.11.2010 1:18 пользователь "Streets Of Boston" написал: Add these methods to your list-view's adapter: @Override public boolean ar

Re: [android-developers] Re: Adding separators to a ListView

2010-11-16 Thread Kostya Vasilyev
Yes, there is special code to ignore clicks on group headers and still get list item clicks - see the bottom of my blog post. As for my solution being similar to someone else's - I haven't seen the other blog before, and I think it is missing a crucial piece, the group start test method. But then

Re: [android-developers] Re: Adding separators to a ListView

2010-11-15 Thread Mark Murphy
On Mon, Nov 15, 2010 at 12:50 PM, Kostya Vasilyev wrote: > Since this came up before, and generally *seems* useful, should I post the > entire recipe somewhere? (i.e. my blog)? Sounds cool by me! -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commons

Re: [android-developers] Re: Adding separators to a ListView

2010-11-15 Thread Kostya Vasilyev
Since this came up before, and generally *seems* useful, should I post the entire recipe somewhere? (i.e. my blog)? 15.11.2010 20:32, Neilz пишет: Maybe I can shuffle the order of your long list ;-) Yes and yes, though probably not easily. You might consider Kostya's approach. Creating a Curs

Re: [android-developers] Re: Adding separators to a ListView

2010-11-15 Thread Kostya Vasilyev
Sure. This is my list view activity, including the adapter: http://pastebin.com/MrD03Uv9 This is the "plain" list item layout: http://pastebin.com/6fKWEkfc And this is the layout that starts a new group, with the header: http://pastebin.com/QMB12kWD The code in the list adapter probably cha

Re: [android-developers] Re: Adding separators to a ListView

2010-11-15 Thread Mark Murphy
On Mon, Nov 15, 2010 at 8:12 AM, Neilz wrote: > It seems to me that you must have your list content already separated > before adding them to the ListView. So, you add one Array, then you > add a different View, then you add another Array. That's what MergeAdapter does. As I hinted at earlier in

Re: [android-developers] Re: Adding separators to a ListView

2010-11-15 Thread Thierry Legras
Could you please share the way you grab the previous row from within setViewValue? :) 2010/11/15 Kostya Vasilyev > Ok, so I had a cursor-based ListView laying around, and decided to try and > practice what I preach :) > > Got it working in just a few minutes, actually. > > The second screenshot

Re: [android-developers] Re: Adding separators to a ListView

2010-11-15 Thread Kostya Vasilyev
Ok, so I had a cursor-based ListView laying around, and decided to try and practice what I preach :) Got it working in just a few minutes, actually. The second screenshot shows that there aren't any issues with trackpad based selection highlighting, at least on my Motorola Milestone. To prev

Re: [android-developers] Re: Adding separators to a ListView

2010-11-15 Thread Thierry Legras
Hi, I found something that highlights Kostya solution including a trick to avoir header to appear selected: http://thebogles.com/blog/2010/02/section-headers-for-android-listviews/ This seems straightforward to follow ... except that i can't get previous record. Unfortunately the isHeaderVisible