gesture-recognition

Android Swipe to left or right?

三世轮回 提交于 2019-11-29 10:26:14
问题 How can I detect in a ListView that someone swiped to the left or the right? 回答1: You'll be wanting this excellent tutorial (site died, here's a new link: http://jsharkey.org/blog/2008/09/15/crossing-things-off-lists-in-android-09-sdk/). Essentially, you're going to create a transparent view in front of the ListView which consumes horizontal motionevents and passes non-horizontal motionevents back down to the ListView. 回答2: gestures recognition wont be supported on 1.5 for which you might

Detect Gesture with Phone sleeping [closed]

末鹿安然 提交于 2019-11-29 05:22:37
I am developing an SOS android app. I want to detect a gesture (for example several touches on screen) if the phone is in mode sleep/standby, and start a send of help request (for example send a sms). How can I detect this gesture? Someone that can help me? Thank you ---SOLUTION---- I found the solution here and this is my code: 1)in the main activity getApplicationContext().startService(new Intent(this, UpdateService.class)); 2)I create a service public class UpdateService extends Service { @Override public void onCreate() { super.onCreate(); // register receiver that handles screen on and

Hidden Markov Model Training for Dynamic Gestures?

雨燕双飞 提交于 2019-11-29 04:13:00
问题 I know there is a lot of material related to hidden markov model and I have also read all the questions and answers related to this topic. I understand how it works and how it can be trained, however I am not able to solve the following problem I am having when trying to train it for a simple dynamic gesture. I am using HMM implementation for OpenCV I have looked into previously asked questions and answer here. Which has really helped me in understanding and using markov models. I have total

Current state of OpenCV hand gesture recognition?

陌路散爱 提交于 2019-11-29 02:29:16
问题 What is the current state of hand gesture recognition in OpenCV? I have seen great examples of being able to detect hand gestures (e.g. https://www.andol.me/1661/) but recognising gestures and performing some action (e.g. manipulating on-screen objects) seems much harder. Does anyone know of any examples? Thanks! 回答1: I think the only support in OpenCV for hand gesture recognition is exactly what Luca Del Tongo demonstrated in the video you linked to, namely cvConvexityDefects(). You might

Android - Gesture Detection (Swipe up/down) on particular view

假如想象 提交于 2019-11-28 22:55:31
I am trying to implement the OnGestureListener in Android. I have three TextViews in my layout. What i am trying to achieve is to set Gesture Listener for two of the textViews . Here is the layout - <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/rlMain" android:layout_width="wrap_content" android:layout_height="wrap_content" > <TextView android:id="@+id/tvOne" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_marginBottom="10dp" android:layout_marginTop="5dp" android:gravity

How to do Gesture Recognition using Accelerometers

微笑、不失礼 提交于 2019-11-28 16:15:16
My goal is to recognize simple gestures from accelerometers mounted on a sun spot. A gesture could be as simple as rotating the device or moving the device in several different motions. The device currently only has accelerometers but we are considering adding gyroscopes if it would make it easier/more accurate. Does anyone have recommendations for how to do this? Any available libraries in Java? Sample projects you recommend I check out? Papers you recommend? The sun spot is a Java platform to help you make quick prototypes of systems. It is programmed using Java and can relay commands back

android: swipe left or right to slide views

独自空忆成欢 提交于 2019-11-28 01:26:22
问题 I have a list view. On click of an item a detailed view for the item is open. This layout has many widgets like text view, ImageView Buttons etc. Now I want to slide this detail view of the items to show the detail view of next item in the list. Similarly previous item for left to right. I am not able to implement the view sliding I have done how to get the prev / next items in the list. But the actual sliding is the issue I tried gesturedetector like in Android: Swipe left to right and right

How to correctly subclass UIGestureRecognizer

人盡茶涼 提交于 2019-11-27 23:21:59
I have gone through the documentation: https://web.archive.org/web/20130309051214/http://developer.apple.com/library/ios/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/GestureRecognizer_basics/GestureRecognizer_basics.html#//apple_ref/doc/uid/TP40009541-CH2-SW2 I am trying to implement the check mark example shown in the documentation and I can't because the compiler shows a bunch of warnings about the [super touchesMoved:touches withEvent:event] call, which is recommended by the documentation. Where's the full example to learn how to correctly subclass for implementing a custom

Implementing pinch zoom and drag using Android's build in gesture listener and scale listener

廉价感情. 提交于 2019-11-27 17:38:15
I am trying to implement pinch zoom and drag using Android's gesture listener and scale listener. The problem is that when I perform pinch zoom, the image (which I am trying to zoom) bounces to a particular location. Also the zoom position is not centered. The following code demonstrates what I am trying to achieve. Any idea why the image is jumping (and how to correct it) ? public class CustomView extends View { Bitmap image; int screenHeight; int screenWidth; Paint paint; GestureDetector gestures; ScaleGestureDetector scaleGesture; float scale = 1.0f; float horizontalOffset, verticalOffset;

how detect swipe gesture direction?

谁都会走 提交于 2019-11-27 12:26:20
i need to detect direction of my swipe gesture and i've got problem with it. gesture is working, but i don't know how to detect direction. ... swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(detectSwipe:)]; [swipeGesture setNumberOfTouchesRequired:1]; [swipeGesture setDirection:UISwipeGestureRecognizerDirectionDown | UISwipeGestureRecognizerDirectionUp]; [appView addGestureRecognizer:swipeGesture]; -(void)detectSwipe:(UISwipeGestureRecognizer *)recognizer { switch (recognizer.direction) { case UISwipeGestureRecognizerDirectionUp: NSLog(@"smth1"); break;