Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Touch two views at once on android

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?

like image 253
neildeadman Avatar asked Jan 27 '11 14:01

neildeadman


People also ask

How do you handle single and multi touch?

You can react to touch events in your custom views and your activities. Android supports multiple pointers, e.g. fingers which are interacting with the screen. The base class for touch support is the MotionEvent class which is passed to Views via the onTouchEvent() method. you override the onTouchEvent() method.

How do I turn off multi touch on Android?

setMultipleTouchEnabled(false); in the onCreate() method. This should disable multitouch, if it was correctly implemented in 3.14.


1 Answers

This may help (Splitting touches accross views)

like image 177
C.d. Avatar answered Oct 10 '22 00:10

C.d.