10

Here is my layout:

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" >

    <SeekBar 
        android:id="@+id/seekBar1" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        />
    <TextView 
        android:id="@+id/textView1" 
        android:layout_width="fill_parent" 
        android:layout_height="60dip">
        </TextView>
    <SeekBar 
        android:id="@+id/seekBar2" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        />
</LinearLayout>

I want to be able to move the two SeekBars (which I will be using as sliders) at the same time, each with a different finger but at the same time.

How would I achieve this?

5
  • Not an answer, but I wanted to point out it's only necessary to define your schema once. In your XML you have three declarations of xmlns:android. Jan 27, 2011 at 14:35
  • Well the big problem I see in that usage of multitouch is the same like why the two-finger-pong is not functional on the most android devices, the majority of them have only limited multi-touch capabilities for pinch-and-zoom but nothing other...you have to keep that in mind when developing on an htc-device --- not an answer either. Video with demonstration: youtube.com/watch?v=7rOgFX1-EwE
    – Jaro
    Jan 27, 2011 at 14:36
  • 1
    @kcoppock: haha, yeah cheers for pointing that out. I first added the SeekBar and then copied the second and added a LinearLayout which left me with the three! Editing now... :P Jan 27, 2011 at 14:40
  • Haha okay, makes sense :P Doesn't hurt anything, anyway. Jan 27, 2011 at 14:41
  • I don't get where the problem is.. if the device is multitouch you can simply attach 2 difference listener (or the same listener that do a switch on the view id) to handle touches on the seekbars.
    – StErMi
    Jan 7, 2012 at 13:01

5 Answers 5

3
+50

This may help (Splitting touches accross views)

2

You would have to handle touch events yourself. With the multi-pointers (e.g multi-touch) API it's very easy. Just override the onTouchEvent() method or register an OnTouchListener on your buttons.

But Remember multitouch support only in 2.0 or higher version

For more info you can refer This question already asked

2

Instantiate your Views inside Fragments. Done!

You can see this behavior in action by simultaneously scrolling an email list and an email in the Gmail application on a Honeycomb or Ice Cream Sandwich device.

1

By default it's probably not possible. You have to define your own view type. Without looking too much on how events are handled. If touch events comes from the parent view. I'd try to override a LinearLayout and give it the capability to handle multi touch point. That way you can add as many scroll bar and it will works with the limit of touch point your screen can handle.

0

Try changing the minimumSdk to '11' it worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.