gesture

Can't get touch event detected on a view and click event detected on a parent view

混江龙づ霸主 提交于 2019-12-08 08:37:35
问题 I've got a layout 'layout_base' that fills the screen and a child view 'home'. I set an OnClickListener on the 'layout_base' to do some action (close a popup if it's open), and an OnTouchListener on 'home' to do some other action (translate on fling). My issue is that I can only get the action done if I return true in the onTouch method of the 'home' touch listener. If I return false , onFling is not called. Why? From the doc I've read that this only mean that the event is consumed, i.e. from

Swift - Rotate gesture and rotation increments of 90 degrees

老子叫甜甜 提交于 2019-12-08 08:37:12
问题 I have a rotateView setup with a UIRotationGestureRecognizer . Works as intended, however I would like to only rotate in notches/increments of 90 degrees. The default behavior allows you to be very granular and precise with the rotation. I want it to be the opposite, of only 4 possible positions. The code I have below is as close I could get, however the problem I am facing is the rotation only happens once, and only to one direction (rotates to the right, even if I 2-fingers rotate to the

Image zoom activity for android

徘徊边缘 提交于 2019-12-08 08:32:54
问题 I'm trying to implement the double tap and the pinch to zoom activity. I wrote some code for the first one but it seem not to work (i can use only the android emulator for eclipse for now. So I'm not sure if my result is the right one) Anyway I'm not able to understand what am I doing wrong. I'm surely forgetting something. This is my code: public class ImageZoomView extends View implements OnGestureListener { private static final int SCALING_FACTOR = 50; private final int LANDSCAPE = 1;

Android wear activity onKeyDown is not getting called

风流意气都作罢 提交于 2019-12-08 04:40:30
This is not a duplicate but a specific case to Android wear. I am trying to make Android wear app do something when certain gestures are performed. But I realized that the onKeyDown() event is not called at all. Any help or info I this regard is useful. Here is my simple code snippet. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_gesture_ema); Log.d(TAG, "Inside on create"); //Show prompt window on top always getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED + WindowManager.LayoutParams

Custom gesture detector

醉酒当歌 提交于 2019-12-08 02:56:43
问题 I need to create some customs gesture to enable some particular settings on my app. For example I need to create a L gesture like in the photo There's a way to save gesture and then retrive when one of them are performed? 回答1: There is an app installed on emulators called GestureBuilder, which allows you to save and record custom Gestures. If you don't want to run it in your emulator, you can also find it in the included SDK documents, just import it and run it on your device. See this

How to imlement ZoomPinch Gesture in Fragment

旧巷老猫 提交于 2019-12-08 02:56:08
问题 i had used ScaleGestureDetector. I used this code but it doesnt work in fragment and also it doesnt shows any error Please anyone can help me with this thanx in advance but when i use the same code in activity it works perfectly public class Fragment2 extends Fragment { ImageView imgZoom; Matrix matrix = new Matrix(); float scale = 1f; ScaleGestureDetector SGD; // Keep all Images in array Integer[] mThumbIds = { R.drawable. car1, R.drawable.car2, R.drawable.car3, R.drawable.car4, R.drawable

Kinect Grip Gesture for Click

自作多情 提交于 2019-12-08 01:46:43
问题 I'm using kinect V2.0. I need to perform click using grip gesture. Is there a way to handle the Grip gesture in V2.0 like AddHandPointerGripHandler in V1.8. 回答1: In Microsoft Kinect SDK v2.0, the Body class includes two properties: Body.HandRightState Body.HandLeftState Both these properties are instances of the HandState enumeration, which specifies if the hand is: Closed (and you can detect this to trigger the Grip gesture); Lasso (which means that the hand is closed in a fist, except for a

In Flutter, how can a positioned Widget feel taps outside of its parent Stack area?

你。 提交于 2019-12-08 01:03:47
问题 A Stack contains MyWidget inside of a Positioned . Stack( overflow: Overflow.visible, children: [ Positioned( top: 0.0, left: 0.0, child: MyWidget(), )], ); Since overflow is Overflow.visible and MyWidget is larger than the Stack , it displays outside of the Stack , which is what I want. However, I can't tap in the area of MyWidget which is outside of the Stack area. It simply ignores the tap there. How can I make sure MyWidget accepts gestures there? 回答1: This behavior occurs because the

Swift - Rotate gesture and rotation increments of 90 degrees

只谈情不闲聊 提交于 2019-12-07 23:58:36
I have a rotateView setup with a UIRotationGestureRecognizer . Works as intended, however I would like to only rotate in notches/increments of 90 degrees. The default behavior allows you to be very granular and precise with the rotation. I want it to be the opposite, of only 4 possible positions. The code I have below is as close I could get, however the problem I am facing is the rotation only happens once, and only to one direction (rotates to the right, even if I 2-fingers rotate to the left). My code func rotatedView(recognizer:UIRotationGestureRecognizer){ let pi = CGFloat(M_PI)

Can we implement Magnification gesture using our own apps?

我只是一个虾纸丫 提交于 2019-12-07 08:40:51
问题 I need to implement Magnification Gesture using my android application. Some or all of this information applies only to Nexus 7 devices running Android 4.2. Check more about Magnification Gesture. I need to apply percentage level of zoom in and zoom out using my android applicatoin. Is it possible to do or not ? I have searched but nothing find related to this. EDIT Can we perform same effect zoom in - zoom out bellow Android 4.2 ? 来源: https://stackoverflow.com/questions/23843299/can-we