Hi friends,
in others post I wrote about Multitouch:
- Multitouch. You can touch concurrently zones in screen
-
Android send order ON/OFF to LEDs in Arduino by Bluetooth HC-05:
https://community.thunkable.com/t/multitouch-android-send-order-on-off-to-leds-in-arduino-by-bluetooth-hc-05/11813 -
Now a study of Multitouch:
Multitouch refers to the capability of a touchscreen to recognize two or more points of contact on the surface concurrently.
Two methods:
1.- onTouch and getAction.
2.- GestureDetector and ScaleGestureDetector
We use onTouch method.
Dimensions:
Factor density screen, in my device = 3
Screen.Width x 3 = 320 x 3 = 960 real pixels.
Screen.Height x 3 = 570 x 3 = 569 x 3 = 1707 real pixels.
By Design we put a total VerticalArrangement, Height and Width: Fill parent.
VerticalArrangement.Width x 3 = 320 x 3 = 960 real pixels.
VerticalArrangement.Height x 3 = 527 x 3 = 1581 real pixels.
Look, Screen.Height is higher than VerticalArrangement.Height, because clock and title bars are 14 (42 real pixels).
Handling Multi-Touch Gestures. onTouch.
ACTION_DOWN: For the first pointer that touches the screen. This starts the gesture. The pointer data for this pointer is always at index 0.
ACTION_POINTER_DOWN: For extra pointers that enter the screen beyond the first. The pointer data for this pointer is not 0.
ACTION_MOVE: A change has happened during a press gesture with first pointer.
ACTION_POINTER_UP: Sent when a non-primary pointer goes up.
ACTION_UP: Sent when the last pointer leaves the screen.
Index: A MotionEvent effectively stores information about each pointer in an array. The index of a pointer is its position within this array.
ID: Each pointer also has an ID mapping that stays persistent across touch events to allow tracking an individual pointer across the entire gesture.
Coordinates:
x,y: real pixels relatives to our View VerticalArrangement.
rawX, rawY: real pixels relatives to Screen (rawY is 47 more than y)
Pointer up and Pointer down are actual pointer coordinates (no first touch)
table: is a list of coordinates of all fingers in Screen, example:
204:1384,442:1106,488:693,943:584
xs: is a list of coordinates x
204,442,488,943
ys: is a list of coordinates y
1384,1106,693,584
http://kio4.com/appinventor/296_extension_estudio.htm
p196_multitouchestudio.aia (14.9 KB)
com.KIO4_MultitouchStudy.aix (10.8 KB)
Hola amigos, de nuevo con una extensiĂłn de Multitouch, recuerda que esto significa que puedes pulsar varias zonas de la pantalla a la vez.
En esta ocasiĂłn es un estudio de Multitiouch, pulsando en varias zonas de la pantalla obtenemos las coordenadas de los lugares tocados.
Puedes obtener más información esta página web:
http://kio4.com/appinventor/296_extension_estudio.htm
Saludos.