Multitouch for all Views

Here is the new Version of my implementation of the MultiTouchActivity.

screenshot2

 

Features:

  • forwards all MotionEvents to the underlying View
  • Included Move Events
  • Sends MouseUp to View if the pointer is out of the View
  • sends MoveEvents  to a View if the Pointer is outside of the View (but registered to view with MouseDown) if you add the View to the moveOutsideEnabledViews  with addMoveOutsideEnabledViews(View);. (see the TestButton)

Further informations:

Download Example App:

logo-app Multitouch for all Views
Pascal Welsch
Gratis   star-off-dark-imgstar-off-dark-imgstar-off-dark-imgstar-off-dark-imgstar-off-dark-img
pulsante-android-market
pulsante-appbrain
qrcode-app

Get full Project Source here:

Have a quick look at the Code here:

Activity with multitouch for Buttons

I wrote an Activity which enables multitouch support. There you can touch two Views on the Activity at once.

Only the MOVE event doesn’t work very well. UP and DOWN works perfect.
Download Zip: here

package de.passsy.test;
package de.passsy.test;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;

public class MultitouchtestActivity extends MultiTouchActivity {
    /** Called when the activity is first created. */

    private Button btn1;
    private Button btn2;
    private Button btn3;
    private Button btn4;

    @Override
    public void onCreate(Bundle savedInstanceState) {
	this.requestWindowFeature(Window.FEATURE_NO_TITLE);
	this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
	this.getWindow().clearFlags(
		WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);

	super.onCreate(savedInstanceState);
	setContentView(R.layout.main);
	btn1 = (Button) findViewById(R.id.button1);
	btn1.setOnTouchListener(this);
	btn2 = (Button) findViewById(R.id.button2);
	btn2.setOnTouchListener(this);
	btn3 = (Button) findViewById(R.id.button3);
	btn3.setOnTouchListener(this);
	btn4 = (Button) findViewById(R.id.button4);
	btn4.setOnTouchListener(this);
    }
}