I was able to successfully add HorizontalScrollView to the ListView's
item without having to do any custom changes. I did not fully test all
the functionality but haven't seen any obvious issues so far.

In some of the previous forums it was mentioned that this is not
possible, what are the issues you are having when using the
HorizontalScrollView within a ListView ? Just want to make sure so
that I understand better if I'm missing something that will break and
haven't noticed yet.

I defined my list item to be something like this:

<LinearLayout android:id="@+id/LinearLayout01"
        android:layout_width="fill_parent"
android:layout_height="fill_parent"
        xmlns:android="http://schemas.android.com/apk/res/android";
        android:orientation="vertical">
        <TextView android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:text="Label"
                android:id="@+id/tv_connected" />
        <LinearLayout android:id="@+id/LinearLayout02"
                android:layout_width="wrap_content"
android:layout_height="wrap_content"
                android:orientation="horizontal">
                <LinearLayout android:id="@+id/LinearLayout03"
                        android:layout_width="wrap_content"
android:layout_height="wrap_content"
                        android:orientation="vertical">
                        <TextView android:text="@+id/tv_name" 
android:id="@+id/tv_name"
                                android:layout_width="wrap_content"
android:layout_height="wrap_content" />
                        <TextView android:text="@+id/tv_number" 
android:id="@+id/tv_number"
                                android:layout_width="wrap_content"
android:layout_height="wrap_content" />
                       </LinearLayout>
        </LinearLayout>
<HorizontalScrollView android:id="@+id/HorizontalScrollView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:orientation="horizontal">
<Button android:text="@+id/Button01" android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
<Button android:text="@+id/Button02" android:id="@+id/Button02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
<Button android:text="@+id/Button03" android:id="@+id/Button03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
<Button android:text="@+id/Button04" android:id="@+id/Button04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
<Button android:text="@+id/Button05" android:id="@+id/Button05"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
<Button android:text="@+id/Button06" android:id="@+id/Button06"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
<Button android:text="@+id/Button07" android:id="@+id/Button07"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
<Button android:text="@+id/Button08" android:id="@+id/Button08"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>

Thanks,
Sandy

On Jun 10, 2:29 pm, Sandy <snarr...@gmail.com> wrote:
> I was thinking more along these lines i.e. have  a bunch of buttons
> that are added to the list item and then move these items on a gesture
> by repainting the list item couple of times but I dont know if this
> will work.
>
> 1. Have a  custom list item component which has linear layout of
> buttons.
> 2. Listen to horizontal gesture events in aListVIew
> 3. Animate the list view programmatically to move the buttons on a
> horizontal gesture
>
> If you have ideas for how to make this work without using a secondlistviewor 
> horizontalscrollview , please suggest.
>
> Thanks,
> Sandy
>
> On Jun 10, 6:06 am, Mark Murphy <mmur...@commonsware.com> wrote:
>
>
>
> > Sandy wrote:
> > > Actually the link I was referring to was horizontalscrollview within a
> > > scrollview (NOT alistviewlike i mentioned below). Here it is:
>
> > >http://stackoverflow.com/questions/2646028/android-horizontalscrollvi...
>
> > > This will not work for me because the functionality I desire to have
> > > is a verticalListViewwith 100 list items and the selected item will
> > > have few buttons (around 10) which can be scrolled horizontally.
>
> > I will be stunned if a HorizontalScrollView will work in aListViewrow.
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> > _The Busy Coder's Guide to Android Development_ Version 3.1
> > Available!- Hide quoted text -
>
> - Show quoted text -

-- 
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

Reply via email to