gesture

GenericMotion - Action Down not firing

纵饮孤独 提交于 2019-12-25 04:11:39
问题 I want to trace the whole movement of a finger that started by touching my ImageView. I found that GenericMotion event should be the correct one to use. What am I supposed to do (or to avoid) to get Actions Down, Move and Up in GenericMotion event? I get only HoverEnter, HoverMove and HoverExit actions, even if I start with touching the center of my ImageView. Android: OnTouch, MotionEvent.ACTION_MOVE is not recognized? Here I learned that without handling Down action I can't get the

Smooth move and pinch of UIImageView

流过昼夜 提交于 2019-12-25 01:45:57
问题 I have an image view that I want to be able to move around, and pinch to stretch it. It's all working, but it's kinda jumpy when I start to do any pinch movements. The position will jump back and forth between the two fingers. - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { startLocation = [[touches anyObject] locationInView:mouth_handle]; if([touches count] == 2) { NSArray *twoTouches = [touches allObjects]; UITouch *first = [twoTouches objectAtIndex:0]; UITouch *second =

does winrt have a gesture builder

≡放荡痞女 提交于 2019-12-25 01:35:23
问题 In the android world there is a cool utility called Gesture Builder that allows you to associate a pre-recorded gesture with a command. For example, they can do an X on the screen and it would close the app, or draw a heart and have the app send a valentine email. Is there a similar feature with WinRT? 回答1: I don't think there is anything built in, but you could try $1, N$ - One Dollar and N Dollar Recognizers: http://depts.washington.edu/aimgroup/proj/dollar/ http://depts.washington.edu

Is there a way to change rotation of gesture events?

佐手、 提交于 2019-12-24 11:16:32
问题 I need to trigger gesture events in Mac OS X. I found this question: Is there a way to trigger gesture events on Mac OS X? It works for me, but if I want to change rotation? For example, - (void)rotateWithEvent:(NSEvent *)event { NSLog(@"ROTATE: %f", [event rotation]); } -(IBAction)button:(id)sender { ... CGEventSourceRef eventSource = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState); CGEventRef event = CGEventCreate(eventSource); CGEventSetType(event, NSEventTypeRotate);

Android: Nullpointer Exception in addOnGesturePerformedListener

自古美人都是妖i 提交于 2019-12-24 10:57:54
问题 public class TestActivity extends Activity implements OnGesturePerformedListener { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mLibrary = GestureLibraries.fromRawResource(this, R.raw.gestures); GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.gestureOverlayView1); gestures.addOnGesturePerformedListener(TestActivity.this); } My main.xml

react native scrollview horizontal swipe left or right on tap

随声附和 提交于 2019-12-24 09:39:08
问题 I am showing pictures gallery in full screen mode. I am using scrollview in horizontal for scrolling the pictures. Right now I can scroll the pictures by swiping left or right and I using the pagingEnabled enabled props. But I want to add more gesture, where when user tap on left or right ( a distance from the edge) , it will automatically mapping the swapping gesture. How can I do this? 回答1: Get a ref to the <ScrollView> then to scrollToEnd() or use scrollTo methods - https://facebook.github

Android Custom View - Optimizing Redrawing while Fling

两盒软妹~` 提交于 2019-12-24 07:07:28
问题 I have a custom view that represents something like a photo-collage. I need to support the following: Fling Zoom In Zoom Out Here's what I currently do: onDraw: Look out for the number of images to be drawn. Look out for the images to be drawn and their locations and angles If the image had been downloaded (from the server), draw it. Otherwise, draw some default image. onTouch: action = DOWN: Record X,Y action = MOVE: Record X,Y; get the delta; record "new origins" and invalidate the UI. This

iphone development - UIRotationGestureRecognizer (Clockwise & counter Clockwise detection)?

試著忘記壹切 提交于 2019-12-24 03:49:30
问题 Is there a way to detect if the rotation done by the user is in clockwise or counter clockwise direct??? I searched for that but couldn't find an answer ! My code looks like this: UIGestureRecognizer *recognizer; recognizer = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(spin)]; [self.rotating addGestureRecognizer:recognizer]; [recognizer release]; 回答1: the rotation property will tell you the rotation in radians. A negative value would indicate the rotation is

How to disable UISwipeGestureRecognizer when load a new view?

空扰寡人 提交于 2019-12-24 01:18:25
问题 in my viewDidLoad I set UISwipeGestureRecognizer *swipeRecognizerU = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeUpDetected:)]; swipeRecognizerU.direction = UISwipeGestureRecognizerDirectionUp; [self.view addGestureRecognizer:swipeRecognizerU]; when I load a new view through popup I need to disable that gesture // show popup view -(IBAction)showPopup:(id)sender { MJDetailViewController *detailViewController = [[MJDetailViewController alloc] initWithNibName:@

How to detect double taps on ListView items in Android?

怎甘沉沦 提交于 2019-12-23 20:03:49
问题 i want to do some thing like instagram app when user double tab on photo it make like and while he just tab one time it open as full screen 回答1: I think this answers to Your question as well. Check this link: how to implement double click in android 回答2: If you don't need to prevent single click to be fired, you can do much more simple: @Override public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) { long currTime = System.currentTimeMillis(); if (currTime -