gesture

Undoing and Redoing NSView Object Move Made by NSPanGestureRecognizer

二次信任 提交于 2020-01-16 08:36:32
问题 I am working on a sample desktop application to test the UndoManager class, which I don't often get to use. Anyway, the following is the idea. I create two NSView sub view objects (red & blue). They are added to an IBOutlet-connected NSView object (panView). I add the pan gesture ( NSPanGestureRecognizer ) to these two sub view objects. The applications calls the undo manager when the user moves either sub view object. The following is my entire code from top to bottom. import Cocoa class

How to set the orientation of the views underneath the Gesture Overlay to “none”

独自空忆成欢 提交于 2020-01-16 04:09:29
问题 I am trying to set the orientation of the views underneath the GestureOverlay to none. At this point I am able to set the orientation to either vertical or horizontal. However, for my application I dont want either, this needs to be set to none. In the article for gestures API, it says the following: orientation: indicates the scroll orientation of the views underneath. In this case the list scrolls vertically, which means that any horizontal gestures (like action_delete) can immediately be

EditText not capturing ViewFlipper flings?

試著忘記壹切 提交于 2020-01-11 06:21:12
问题 This is maddening. I have the following XML layout: <FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/shadow" android:focusable="true" android:focusableInTouchMode="true"> <ViewFlipper android:id="@+id/flipper" android:layout_width="fill_parent" android:layout_height="fill_parent"> <EditText android:id="@+id/reviews" style="@style/DescriptionArea" android:layout_width="fill_parent" android:layout_height="wrap_content" android

How to add gesture detector to a ViewPager

断了今生、忘了曾经 提交于 2020-01-06 19:59:59
问题 What I want to do: Image will be slidable by viewpager but people can zoomIn or zoomOut by gesture detector. Problem: I can slide image using viewpager but don't know to how to add gesture detector in my Viewpager. Code: Activity: public class ImageSlider extends AppCompatActivity { private ViewPager viewPager; CustomSwipeAdpater customSwipeAdpater; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_image_slider)

Saving Image from UIImageView after manipulating Gestures

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-06 03:36:06
问题 I'm trying to save the image after manipulating it with move, pinch and rotate gestoures. All I get is the real image no matter what I tried, I tried with UIGraphicsBeginImageContextWithOptions on the UIView container and on the UIIMageView without success. Hope someone can help on this one. Thanks, Itay 回答1: You could try with this: UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0.0); CGContextConcatCTM(UIGraphicsGetCurrentContext(), imageView.transform); [imageView.layer

Is it possible to have gestures with trackpads?

烂漫一生 提交于 2020-01-04 04:43:26
问题 On a Macbook Pro in Chrome, sliding two fingers across the screen allows you to move backwards and forwards. How do I go about disabling this, and creating custom gestures in jQuery or Javascript? All I really need to know is how do you detect when two fingers are on the trackpad, which I assume is the best way to do this. You can do it on mobile with e.touches! 回答1: Touchpads do not trigger touch-related events (but usually control the mouse pointer instead. This cannot be affected by a

iOS: disable pan gesture when objects overlap

最后都变了- 提交于 2020-01-03 06:51:23
问题 I have a few objects moved by using Pan Gesture . Now I want the object to stop moving permanently when either: It overlaps a particular (stationary, not able to be moved) object, or It enters a certain range of locations. I've tried to stop it when the two objects overlap using removeGestureRecogniser but it didn't work. - (IBAction)cowimagemove:(UIPanGestureRecognizer *)recognizer { if (cowimage.center.x==stayimage.center.x) { [self removeGestureRecogniser]; } else { CGPoint translation =

swipe left, right, up and down depending on velocity or other variables

杀马特。学长 韩版系。学妹 提交于 2020-01-02 05:55:57
问题 i've got a class extended from simple on gesture and i'm working with the onfling method: class MyGestureListener extends GestureDetector.SimpleOnGestureListener{ @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { // TODO Auto-generated method stub float e1_X = e1.getX(); float e1_Y = e1.getY(); float e2_X = e1.getX(); float e2_Y = e2.getY(); if(velocityX > 0 && velocityX > velocityY){ text.setText("Swipe left"); }else if(velocityX < 0 &&

Flutter Zoomable Widget

99封情书 提交于 2020-01-01 19:55:00
问题 What I want to build is a widget that can make its child widget zoomable similar to the zoomable behavior. Gestures I want to cover are Pinch To Zoom Double Tap to Zoom Tap to get the local Position of the widget Here is my widget plan: ZoomableWidget( child: // My custom Widget which should be zoomable. ) Here is my current progress: import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:vector_math/vector_math_64.dart'; class ZoomableWidget extends

Flutter Zoomable Widget

自作多情 提交于 2020-01-01 19:54:09
问题 What I want to build is a widget that can make its child widget zoomable similar to the zoomable behavior. Gestures I want to cover are Pinch To Zoom Double Tap to Zoom Tap to get the local Position of the widget Here is my widget plan: ZoomableWidget( child: // My custom Widget which should be zoomable. ) Here is my current progress: import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:vector_math/vector_math_64.dart'; class ZoomableWidget extends