drag

ViewDragHelper: how to use it?

怎甘沉沦 提交于 2019-11-30 12:02:57
问题 In the Google IO 2013, Google has announced a new version of the Support Library, which includes ViewDragHelper class. I saw the docs, but I couldn't find any sample of usage for this class. For example, a very typical situation: I have a custom view, which extends from FrameLayout and allows to drag some of the View s inside. For example, let it be a Button . I override onTouchEvent() and onInterceptTouchEvent() within my custom view, and if the button of the rect contains the touch

Dragging UIView under finger [duplicate]

隐身守侯 提交于 2019-11-30 09:10:40
This question already has an answer here: How do you make an image follow your finger in objective-c? [closed] 3 answers I want to tap on a UIView and drag and have that view follow my finger, simple enough. But the easiest way of doing this is by setting the objects center to where the tap happened (Which is not what I want), I want it to move as if you grabbed the object wherever you tapped it. There was a very useful way of doing this and it was reference in one of the iTunes U videos. The script didn't use deltaX, deltaY for dragging the image underneath where you tapped on it instead of

(iPhone) how to implement draggable pins using OS 4.0 MapKit?

半腔热情 提交于 2019-11-30 07:06:11
Can anyone provide any sample code/instructions for implementing draggable pins in OS 4.0 using the MapKit framework? Sure thing buddy (yes I'm talking to myself), In your custom annotation add: @property (nonatomic, readwrite, assign) CLLocationCoordinate2D coordinate; This satisfies the requirement of implementing setCoordinate, as mentioned inhttp://developer.apple.com/iphone/library/documentation/MapKit/Reference/MKAnnotationView_Class/Reference/Reference.html#//apple_ref/occ/instp/MKAnnotationView/draggable In your MapView delegate add: - (void)mapView:(MKMapView *)mapView annotationView:

Android Google Maps: disable dragging in MapFragment

☆樱花仙子☆ 提交于 2019-11-30 05:34:27
Can I disable drag functionality when the user tries to drag the map with his fingers without disturbing the Zoom in and Zoom out? Any one please suggest an idea of doing this! Thanks for your Precious help!! I think here's what you're looking for: Inside Google Maps Android v2 Scroll (pan) gestures A user can scroll (pan) around the map by dragging the map with their finger. You can disable scrolling by calling UiSettings.setScrollGesturesEnabled(boolean). madhu sudhan You can disable dragging in MapFragment using: googleMap.getUiSettings().setScrollGesturesEnabled(false); for disable

ViewDragHelper: how to use it?

眉间皱痕 提交于 2019-11-30 03:35:26
In the Google IO 2013, Google has announced a new version of the Support Library, which includes ViewDragHelper class. I saw the docs, but I couldn't find any sample of usage for this class. For example, a very typical situation: I have a custom view, which extends from FrameLayout and allows to drag some of the View s inside. For example, let it be a Button . I override onTouchEvent() and onInterceptTouchEvent() within my custom view, and if the button of the rect contains the touch coordinates and this is not a simple click, then I start to drag. So, what I must do with ViewDragHelper to get

Creating OnDragListener for Google Map v2 Fragment

情到浓时终转凉″ 提交于 2019-11-30 02:06:46
I’m trying to setup an onDrag Listener for a google map fragment, but can’t get the drag event to fire. Since the map doesn't support drag events directly, I'm trying to implement a drag listener for the View. I know about the onMarkerDrag event, but that does me no good since I'm not trying to move markers around. The reason for trapping map drag events is twofold: First to detect if the user has panned the map. If they haven't, I like to keep their location on the screen, and animate to their location if it's not on the map. If they have panned the map, I assume they know what they want to

Imageview issue with zoom in and out,drag with maximum and minimum levels

家住魔仙堡 提交于 2019-11-29 23:54:34
问题 I had implemented an image view with the zoom and drag functionalities.I am using matrix for the zoom and drag functionality.But my problem is that I cant set my minimum and maximum zoom level and the drag space limit.can any on e tell me how I can do that. private float spacing(MotionEvent event) { float x = event.getX(0) - event.getX(1); float y = event.getY(0) - event.getY(1); return FloatMath.sqrt(x * x + y * y); } private void midPoint(PointF point, MotionEvent event) { float x = event

JavaScript Drag & Select functionality done right

≡放荡痞女 提交于 2019-11-29 21:55:45
I'm trying to write a drag & select functionality using HTML & JavaScript. By that I mean that there will be a set of objects with arbitrary absolute positions. I want to be able drag the cursor over the area where they are laid out. Think of it as an RTS strategy (selecting units) or alternatively any vector graphics editor (selecting objects for moving them around and editing). First of all I'm aware of things that come up in the first few pages of Google & SO. Therefore I'm by no means asking for googling those things for me and posting here some random links. Most of the solutions that I

Drag an image only horizontally or vertically in android?

好久不见. 提交于 2019-11-29 18:29:24
I want to control the dragging way of the image in android. It should be moved only in one direction. How can i control it? First, put a ScrollView inside a HorizontalScrollView , and the ImageView inside the innermost ScrollView. Hierarchy will look like this: LinearLayout (ROOT) | +-- ScrollView (V) | +-- LinearLayout (1) | +-- HorizontalScrollView (H) | +-- LinearLayout (2) | +-- ImageView And let me explain: (V) scrolls in vertical direction only. (H) scrolls in horizontal direction only. (1) and (2) are linear layouts used immediately following any ScrollViews. Because, a ScrollView can

Create a window using the WS_EX_NOACTIVATE flag ,but it can't be dragged until I release the mouse

一笑奈何 提交于 2019-11-29 16:14:03
I have created a window using the WS_EX_NOACTIVATE flag and it works great as far as not taking focus when you click the window. However when I drag the window or try to resize it, it doesn't redraw the window as your are moving and resizing it, only at the very end once you release the mouse button. Is there a way around this? I would like to see the window as I am resizing it. I have searched many documents, but I still don't find the resolution... It's a Windows bug. You need to call SetWindowPos(hwnd, 0, x, y, width, height, 0) on WM_MOVING . The coordinates to set are given to you in