drag-and-drop

How do I restrict drag and drop along the y axis only in android?

三世轮回 提交于 2019-12-09 17:33:10
问题 I'm trying to restrict drag and drop motion to only the Y-axis so that a user can only take a view and drag it up or down--not left or right. I've got two views (ids of textView and dropZone) right now. One (textView) has a touch listener set to it and another (dropZone) has a drag listener set on it. Here's the layout xml (activity_main.xml): <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match

Dragging and Dropping a File onto a .sh file

 ̄綄美尐妖づ 提交于 2019-12-09 17:10:26
问题 I have a fairly good amount of knowledge with Batch. I'm trying to port a batch script over to Mac/UNIX, but my batch file has a drag-and-drop thing to it. Through countless Google searches, I have came up with nothing. They all say that you can drag-and-drop into a Terminal Window - not good for no-input-required scripts. Here is the code for Batch I have: cd %USERPROFILE% 7za x %* -o%USERPROFILE%\Desktop\Temp 7za a %1 %USERPROFILE%\Desktop\Temp\* cd %USERPROFILE%\Desktop rmdir /q /s Temp\

JQuery Sortable Grid Functionality without Identical Dimensions

只谈情不闲聊 提交于 2019-12-09 15:16:33
问题 I am looking to create a sortable (via drag and drop) grid, similar to what JQuery's Sortable grid does ( http://jqueryui.com/demos/sortable/#display-grid ). However, Sortable requires that you use only divs with identical dimensions. For my purposes, each block is allowed to be different widths and heights. The functionality I am looking for is the snap-to-grid capabilities while "shoving" the other elements out of the way. Draggable does everything except for preventing them from

:hover sticks to element on drag and drop

随声附和 提交于 2019-12-09 14:51:23
问题 I have simple ol-li construction and want to add drag'n'drop to it. Additionaly I want to highlight hover item and dragover item in different colors. But it is an unusual bug in WebKit. Capture last item. Drag it to the top. Drop it to the first item. And last element capture the hover pseudoclass! Why? How can I prevent it? This is an example: http://jsfiddle.net/zFk2V/3/ var lis = document.querySelectorAll("li"), ol = document.querySelector("ol"), dragged = false, dragover = false; ol

Reorder elements of ListView by dragging [duplicate]

最后都变了- 提交于 2019-12-09 13:48:15
问题 This question already has an answer here : Bauerca drag-sort-listview simple example (1 answer) Closed 4 years ago . I see it done a lot lately on android: I can drag an item in a listView to another position in the list. But I can't seem to find any example code. Does anyone have some example code they don't mind sharing. I have been reading http://developer.android.com/guide/topics/ui/drag-drop.html, but I am not making much progress. Complication So I find what seems to be a simple way to

Zoom & Drag an Image in android

余生长醉 提交于 2019-12-09 13:05:28
问题 I need to drag and zoom an image. Here is my code ... //instance variables Matrix matrix = new Matrix(); Matrix savedMatrix = new Matrix(); static final int NONE = 0; static final int DRAG = 1; static final int ZOOM = 2; int mode = NONE; PointF start = new PointF(); PointF mid = new PointF(); float oldDist = 1f; //OnTouchListener for imageview OnTouchListener touchAction = new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { ImageView i = (ImageView)v;

Drag & drop an object into Google Maps from outside the map : marker not put at correct latitude / longitude

爷,独闯天下 提交于 2019-12-09 12:15:06
问题 I'd like to drag an object into my Google Map (API V3) from outside the map. After some research, I found this very helpful post and I tried to adapt it to my project. The main idea is to drag a .png image on the map and when the mouse button is down, get the actual coordinates and place a marker at that lat / lng. But I noticed there is a difference between the point you drag your image and the point where your marker is placed. The difference is around 10 / 15 pixels on the sample linked

kineticjs drag and drop image from dom into canvas

孤街浪徒 提交于 2019-12-09 11:44:46
问题 I have an image loaded on the dom already, and I want to be able to drag that image into a canvas and drop it into the canvas and create a kineticjs object out of it. I don't know how to make the image draggable, and I don't know how to make the canvas react to drag and drop events that already exist on the dom. Can someone show me how to do this? Most of the tutorials show how to drag and drop from within the canvas, or the file system, I'm looking how to drag from the DOM to the canvas.

Dragging: Replacement of the data

时光总嘲笑我的痴心妄想 提交于 2019-12-09 11:15:36
问题 I got a webpage with some html elements including a textarea and an embedded contenteditable iframe (a rte). Using this code i manage to catch the draggesture event on the main page and set the text/html-data jQuery(document).bind('draggesture', function(event){ event.originalEvent.dataTransfer.setData('text/html', 'my_data'); }); Now, when dropping in a textarea on the main page 'my_data' gets dropped. Dropping in the contenteditable iframe drops 'my_data' too. But i got three issues here

Drag and Drop directly from Outlook to a webform

只谈情不闲聊 提交于 2019-12-09 10:56:58
问题 I searched online and mostly found answers that it cannot be done. My case is a bit different as the application we are developing is for an in-house purposes only and can allow any security level in the browser. Its also intranet based. I also tried to see if there is a ready-made activex control but wasn't able to find one that will allow dragging directly from outlook. Any ideas? 回答1: The easiest solution I found is to just create an Add-In for Outlook to add the email to our database. 回答2