Is there a library for moving views by dragging & dropping on Android? I don't want any fancy animations or anything, just users can drag the ImageButtons to anywhere in the screen and they will stay where they are dropped.
I googled it and searched for it but I couldn't find anything ready to use, will I be required to implement it using onTouch and stuff?
By the way, my API level is 8.
Check out this Drag and Drop tutorial in the API Guides.
Related
I'm trying to implement drag and drop functionality in xamarin android.
I also want to implement pinch to zoom with drag and drop.
I referred a article, although it is not very clear.
https://blog.xamarin.com/android-tricks-supporting-drag-and-drop-in-an-app/
I also tried with other links, but not succeed.
I found a app which has the same functionality I want to.
https://play.google.com/store/apps/details?id=com.polyvore
So Please help me on this.
I am trying to develop custom launcher app (with unlimited number of home pages)and i need to implement Drag and Drop as done in Launcher2(android 4.2).
So i found two approaches
1) Drag and Drop framework
2) Use the android launcher2 way like implementation DragController, DragSource as explained here.
But i am struggling to understand why didn't Android guys didn't use the Drag and Drop framework developed by them in their own application. Can anyone brief regarding possible rationale behind their approach?( i mean in terms of memory/performance)
Thanks in advance.
The Android drag and drop framework is very basic as compared to the one used in the Launcher app.
The Launcher app has a myriad of "layers" and the drag and drop occurs accross these layers, namely the DragLayer, Workspace and the All Apps view etc. It uses window flags and dynamically adds/removes views to the DragLayer when a drag is in progress and a multitude of activities monitor the drag. For more details look at the DragLayer.java and Workspace.java files particularly.
Drag and Drop in Android Launcher is done as Overlay drawing within the same ViewGroup and in same window . But android drag and drop approach creates a separate window with a separate window type altogether .
Resource and memory wise standard android drag and drop approach is costlier.
If performance is very critical my suggestion is go as per Android launcher way else prefer standard android approach its easy and simple.
Drag and Drop framework is sice api 11.
My guess is, lot of code for launcher was written before that, and noone had time to refactor it yet. But api works similar like second approach.
http://javapapers.com/android/android-drag-and-drop/. This is the best drag and drop example since i have implemented the same in my application. Note: It will support versions only above 11. The drag and drop feature will not support for version 10. Instead u have to move the fields in a absolute layout by settin X and Y positons. But Absolute layout is completely deprecated...
You should use WindowManaager to control Drag And Drop if in case your Application is not so much complex. This is easy to implement and work on Position changed. get the code Here
I want to show a dashboard like interface in my Android tablet app where the user can drag and drop listviews using touch. Is there a library that i can use to give d&d to my app?
For android 3.0 and up, which is usually in all Android tablets. You can use this:
http://developer.android.com/guide/topics/ui/drag-drop.html
You do not necessarily need a library to give the drag and drop functionality. It is already in Android 3.0 and up. If you want the code, the best way is to write it yourself as it will suit you to what you want. To learn about it, look at several examples and read them. It is pretty simple and acts much like OnTouchListener and MotionEvent.
I'm writing playing cards game. I have implemented dragging and dropping one view onto another based on this tutorial.
Now I want to animate opponent moves.
Is there easy way to to this?
I thought about using TouchUtils.dragViewBy(...), but it isn't supported on device.
for opponents move, shouldn't you use animations instead?
for this, you could use either the old API or the new one, or use a compatibility library instead .
do note that if you run animations on old android versions (even with the compatibility library) meaning API 10 and below, the view only looks to be on the position that you see it, but actually it stayed on the original position.
I want to implement a Drag and Drop Feature in my app.
I should be able to drag a Button into a field, and the field should know that it holds a button now..
I saw that there is a Drag and Drop Documentation on the android developers page, but API 11 is needed for this.
How can i do this for API 7++ ?