I need to implement two fingers tap.
two fingers tap.
For example, I have a listView with several elements that already have a click listener for each row and the listener's touch. Now I have to do something if the user put two fingers on the line.
How can i do this?
Any suggestion is appreciated.
I believe the gesture API only supports one touch.
Basically, you should override ` onTouchEvent and play with e.getPointerCount () and check the time between ACTION_POINTER_DOWN and ACTION_POINTER_UP. You will probably also think of a case where two touches do not actually appear at the same time or leave the screen at the same time.
try it
Android multi-touch support
or
http://www.rbgrn.net/content/367-source-code-to-multitouch-visible-test
android imageView: adjust scaling and scaling options
This can help you.
Not sure what you mean by two fingers. If you mean a double tap (one finger, 2 taps), I recommend the following:
http://mobile.tutsplus.com/tutorials/android/android-gesture/
But if you refer to 2 different finger presses once, I would not recommend 2 fingers to do this, because this contradicts the recommendations for Android development. If something is recommended, do a long press, which can be easily implemented by overriding the onLongClick () method.
But if you really don't want to listen to me because you think I'm stupid. You, in fact, will need to implement your own multi touch gesture. Here is one example:
http://www.zdnet.com/blog/burnette/how-to-use-multi-touch-in-android-2-part-2-building-the-touch-example/1763
FYI, please keep in mind which version of Android you want to support.
Source: https://habr.com/ru/post/1436375/More articles:Visual Studio 2012 IDE Complaint about namespaces after update - visual-studio-2012Error creating user SalesForce LICENSE_LIMIT_EXCEEDED: License limit exceeded - soapIstream_iterator initialization initialization waiting for input - c ++Can I get a pointer to the current function? - cbson_ext fails on ubuntu - bsonPlacing a border around a series of points in ggplot2 - rEssential iOS6 Xcode 4.5 Backgrounds - iphonejQuery setTimeout on Append - jqueryHow can I detect opening / closing of a laptop cover using Python under Windows? - pythonWhy can't I combine counters in the body of SimpleResult? - scalaAll Articles