[android-developers] Re: ListView: invisible dividers still take up space. Is it a bug or a feature?
I can't speak for the original designers' and coders' intent, but it may be they intended to put a space there so that when an item is selected, they can put a yellow rectangle around it, which, they do. Yusuf Saib Android ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Jul 30, 4:30 am, "brian.schim...@googlemail.com" wrote: > I'm using a ListView with a custom ListAdapter and a custom Drawable > as divider. > > My list contains active elements and passive ones as well. By default, > the ListView draws a divider only between two active items. This is > exactly what I want it to do, expect that ListView leaves > "dividerHeight" pixles free space above and under eacht inactive item. > Because my ListView has no background-graphic (which is on purpose and > can't be changed) I see slices of the underlying Views through my > list. > > If you have any dificulties imagining what this means, have a look > athttp://brianschimmel.de/divider.jpg > > I'm rather sure this is a Bug, but maybe it's the intended behaviour. > I wanted to hear your opinion (as well as a workaround, if there is > any) before filing a bug at b.android.com I can even imagine a reason > for the behaviour as it is: If you wanted to make list items active/ > inactive at runtime, the current implementation does not change the > positioning of the items, while the behaviour I proposes would do. But > I'm not sure if activatin/inactivating items is a real need. > > I'm thinking about not using the build in divider feature at all and > inserting a special "divider item" between each two active items > manually. I think this will fix it, too, but I'd rather like another > solution. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: ListView: invisible dividers still take up space. Is it a bug or a feature?
> I'm rather sure this is a Bug, but maybe it's the intended behaviour. This is not a bug. Just set the dividerHeight to 0. -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: ListView: invisible dividers still take up space. Is it a bug or a feature?
Hi Romain, I think you just got me wrong. If I wanted to have no dividers at all, I would set dividerHeight to 0, of course. Indeed, I want to have dividers between enabled items, but no dividers next to disabled ones. The code in ListView.dispatchDraw() already has code for this: if (bottom < listBottom && (areAllItemsSelectable || (adapter.isEnabled(first + i) && (i == count - 1 || adapter.isEnabled(first + i + 1) { bounds.top = bottom; bounds.bottom = bottom + dividerHeight; drawDivider(canvas, bounds, i); } but the code related to the layout of the children seems to ignore the presence of disabled items. It's reserving space for dividers that will not be drawn by dispatchDraw. Maybe this is intended as well. But anyway, I wish it was intended (and implemented) the other way ;) I think I can't help that with dividerHeight, because it is a global property that affects all dividers at once. with best regards, Brian Schimmel On 30 Jul., 17:57, Romain Guy wrote: > > I'm rather sure this is a Bug, but maybe it's the intended behaviour. > > This is not a bug. Just set the dividerHeight to 0. > > -- > Romain Guy > Android framework engineer > romain...@android.com > > Note: please don't send private questions to me, as I don't have time > to provide private support. All such questions should be posted on > public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: ListView: invisible dividers still take up space. Is it a bug or a feature?
> but the code related to the layout of the children seems to ignore the > presence of disabled items. It's reserving space for dividers that > will not be drawn by dispatchDraw. > > Maybe this is intended as well. But anyway, I wish it was intended > (and implemented) the other way ;) This is the intended behavior. -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---