[android-developers] Re: Scrolling with Multiple ListViews

2008-11-20 Thread Casey Link

On Thu, Nov 20, 2008 at 2:52 PM, Andrew Burgess <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I'm completely stumped on this one.  I have three different lists that need
> to be displayed on the screen.  It's completely possible that the lists will
> extend past the bottom edge of the screen, so I would need scrolling.
>
> I've tried using a ScrollView with a LinearLayout child, and putting my
> ListViews in the LinearView, but all of the ListViews lock to a fixed height
> with scroll bars.  Using other kinds of Layouts means no scrolling.
>
> Does anyone have any suggestions, or will I need to programmatically add the
> list items to some layout and hope for the best?


I had the same problem, and I solved it by rolling a custom ListView
adapter, that let me insert multiple ListAdapter's into one ListView
with separating headers. This gives the appearance of multiple lists
that scroll as one. Like the Settings app.

See:
http://www.jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/

Casey Link

--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Scrolling with Multiple ListViews

2008-11-20 Thread Andrew Stadler


I think that the point Romain is making is that scrolling things (be they 
ListView or Scrollview) should not be *embedded* within each other.  The 
framework was not intended to support this, as it creates all sorts of UI 
issues.

Strictly speaking, you *could* put two independent scrolling things in any 
given layout, but with limited screen real estate, we haven't found this to 
be a particularly useful UI pattern.

On Nov 20, 2008 12:05 PM, "Andrew Burgess" <[EMAIL PROTECTED]> wrote:

So essentially multiple ListViews on a single screen are a pretty big 
no-no.  Fair enough, I'll try something else.  Thanks for the response.

On Thu, Nov 20, 2008 at 3:01 PM, Romain Guy <[EMAIL PROTECTED]> wrote: > 
> > Hi, > > ListView i...
Andrew Burgess

--~--~-~--~~~---~--~~ You received this 
message because you are su...


--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Scrolling with Multiple ListViews

2008-11-20 Thread Romain Guy

You can put multiple ListView on the same screen if they all fit
together on screen. But I would find that UI design questionable :)

On Thu, Nov 20, 2008 at 12:05 PM, Andrew Burgess <[EMAIL PROTECTED]> wrote:
> So essentially multiple ListViews on a single screen are a pretty big
> no-no.  Fair enough, I'll try something else.  Thanks for the response.
>
> On Thu, Nov 20, 2008 at 3:01 PM, Romain Guy <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> ListView is a virtualized component, it displays only as many items as
>> it needs, which is why you cannot put it in inside a ScrollView. The
>> only way to make it work is to give a fixed height to the ListView
>> yourself. This is however a very bad idea to put a scrollable widget
>> inside a scrollable widget. If you do this, touch scroll will become
>> very weird: when the user tries to scroll the ListView inside the
>> ScrollView, what should scroll? The ListView or the ScrollView? It
>> also makes keyboard navigation incredibly difficult for the user: to
>> scroll the ScrollView he would have to scroll through the entire
>> ListView first.
>>
>> You should really NOT do this, this will not work correctly.
>>
>> On Thu, Nov 20, 2008 at 11:52 AM, Andrew Burgess <[EMAIL PROTECTED]>
>> wrote:
>> > Hello all,
>> >
>> > I'm completely stumped on this one.  I have three different lists that
>> > need
>> > to be displayed on the screen.  It's completely possible that the lists
>> > will
>> > extend past the bottom edge of the screen, so I would need scrolling.
>> >
>> > I've tried using a ScrollView with a LinearLayout child, and putting my
>> > ListViews in the LinearView, but all of the ListViews lock to a fixed
>> > height
>> > with scroll bars.  Using other kinds of Layouts means no scrolling.
>> >
>> > Does anyone have any suggestions, or will I need to programmatically add
>> > the
>> > list items to some layout and hope for the best?
>> >
>> > --
>> > Andrew Burgess
>> >
>> > >
>> >
>>
>>
>>
>> --
>> Romain Guy
>> www.curious-creature.org
>>
>>
>
>
>
> --
> Andrew Burgess
>
> >
>



-- 
Romain Guy
www.curious-creature.org

--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Scrolling with Multiple ListViews

2008-11-20 Thread Andrew Burgess
So essentially multiple ListViews on a single screen are a pretty big
no-no.  Fair enough, I'll try something else.  Thanks for the response.

On Thu, Nov 20, 2008 at 3:01 PM, Romain Guy <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> ListView is a virtualized component, it displays only as many items as
> it needs, which is why you cannot put it in inside a ScrollView. The
> only way to make it work is to give a fixed height to the ListView
> yourself. This is however a very bad idea to put a scrollable widget
> inside a scrollable widget. If you do this, touch scroll will become
> very weird: when the user tries to scroll the ListView inside the
> ScrollView, what should scroll? The ListView or the ScrollView? It
> also makes keyboard navigation incredibly difficult for the user: to
> scroll the ScrollView he would have to scroll through the entire
> ListView first.
>
> You should really NOT do this, this will not work correctly.
>
> On Thu, Nov 20, 2008 at 11:52 AM, Andrew Burgess <[EMAIL PROTECTED]>
> wrote:
> > Hello all,
> >
> > I'm completely stumped on this one.  I have three different lists that
> need
> > to be displayed on the screen.  It's completely possible that the lists
> will
> > extend past the bottom edge of the screen, so I would need scrolling.
> >
> > I've tried using a ScrollView with a LinearLayout child, and putting my
> > ListViews in the LinearView, but all of the ListViews lock to a fixed
> height
> > with scroll bars.  Using other kinds of Layouts means no scrolling.
> >
> > Does anyone have any suggestions, or will I need to programmatically add
> the
> > list items to some layout and hope for the best?
> >
> > --
> > Andrew Burgess
> >
> > >
> >
>
>
>
> --
> Romain Guy
> www.curious-creature.org
>
> >
>


-- 
Andrew Burgess

--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Scrolling with Multiple ListViews

2008-11-20 Thread Romain Guy

Hi,

ListView is a virtualized component, it displays only as many items as
it needs, which is why you cannot put it in inside a ScrollView. The
only way to make it work is to give a fixed height to the ListView
yourself. This is however a very bad idea to put a scrollable widget
inside a scrollable widget. If you do this, touch scroll will become
very weird: when the user tries to scroll the ListView inside the
ScrollView, what should scroll? The ListView or the ScrollView? It
also makes keyboard navigation incredibly difficult for the user: to
scroll the ScrollView he would have to scroll through the entire
ListView first.

You should really NOT do this, this will not work correctly.

On Thu, Nov 20, 2008 at 11:52 AM, Andrew Burgess <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I'm completely stumped on this one.  I have three different lists that need
> to be displayed on the screen.  It's completely possible that the lists will
> extend past the bottom edge of the screen, so I would need scrolling.
>
> I've tried using a ScrollView with a LinearLayout child, and putting my
> ListViews in the LinearView, but all of the ListViews lock to a fixed height
> with scroll bars.  Using other kinds of Layouts means no scrolling.
>
> Does anyone have any suggestions, or will I need to programmatically add the
> list items to some layout and hope for the best?
>
> --
> Andrew Burgess
>
> >
>



-- 
Romain Guy
www.curious-creature.org

--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---