how to drag and drop in android? - android

my android version is 2.2
I want to make ui like easyband (youtube video)
so, how to drag and drop imageView or button between other layout?
and I want know insert imageView or button array of items to use drag and drop
plz help me

Your answer would be Android drag and drop framework.
However, I guess you are just at the beginning to solve your problem, try to ask more specific questions (like I have tried this method and it's giving me this error) instead of looking for a whole answer

Try creating a GridView that allows you to drop views from one area to another. Here is Bill Lahti's code and examples of the similar Drag and Drop effect on lower API's.
http://blahti.wordpress.com/2011/02/10/moving-views-part-3/
http://blahti.wordpress.com/2012/03/03/improved-drag-drop-for-gridview/
Also, explore his content and hopefully you will find what you need.

Related

Android Studio 2.2 Gridlayout not working

I can understand maybe Android Studio 2.2 is different but I feel like it's not working at all with GridLayout, I'm watching thenewboston tutorial 17 for GridLayout, and when he makes it wrap around content then drag the buttons into it, it shows a bit of information over the mouse about where the button is going to be placed (Then shows green bars to indicate where the button is), mine doesn't do that and also it doesn't work at all. I'll include a gif of what I'm talking about.
Also, how do you enable the tooltips for the palette? and no I'm not talking about the quick docs but the mouse hover tip over the palette items.
Here is a gif https://gyazo.com/8a2bc1919f3d117238b7f52be11a2316
And also the error codes that pop up, one of them says view requires API Level 14 (Current min 9):<.GridLayout/>
And the other says
This Gridlayout view is useless (no children, no background, no id, no style)
Regarding dropping the button on the Grid... just drop the button on the GridLayout on the component tree (bottom left). Once you have the first item there you can use the grid as you'd normally expect it to work by moving the buttons around.
I realize that this question is a tad old, but also that it comes up quickly in a google search, so I hope that my solution can be of help to some one.
I was going through this same tutorial, and while I was never able to figure out if it's possible to enable the green lines or drag and drop properly into a GridLayout, I did find how to do it explicitly in the XML file.
In the tag for your button, simply add:
android:layout_row="X"
android:layout_column="X"
where x is any (positive) integer number from top to bottom for the row value, and left to right for the column value.
A less than ideal solution I know, but hopefully some one will benefit from this.

How to develop ListView within ListView?

Friends,
I am trying to develop an application which requires the below UI:
I know its not a feasible thing to run a ListView with-in ListView or with-in a ScrollView. So I'll like to know that Is there any other way to do this same thing ? as the UI has to be same as its running in its LIVE iOS App.
Thanks in advance.
Solution: Thanks guys for all of your answers, but as I told that the Expandable-ListView is not the option in my condition. So I have creating a dynamic layout in Java Class file using an amount of various Layouts & Widget's Array. It took a lot of practice but it covered the necessity.
android-expandable-listview-simple
check this it will help you
You don't really describe your problem in detail but from your indication of a blue bar at the left, I suppose that you want to have some sort of a secondary ScrollView inside the primary ListView; which itself has its one scrolling view. If so, then using an ExpdandableListView will not be the solution that you want.
Android has some difficulties managing a ScrollView inside another ScrollView but if this is what you want, then take a look at: ScrollView Inside ScrollView .
Be warned that these solutions are not perfect and that probably you will never achieve the same level of control for this type of thing on Android as you can have on iOS.

Circular / rotary dial view in android

I have a need to create a circular dial/rotary style component for use in an application. It's essentially a circular menu that allows users to select from the items that are ringed around it, and then they can click the button in the center to activate the selected item. However, I've never created a custom UIView of this type, and don't really know where to begin. Can anyone give me any pointers as to how I would draw the view and then rotate it as the user drags their finger? I obviously know how to intercept touch events, etc. but I'm not sure how to actually go about manipulating the UI appropriately. Any tips or pointers would be great!
I don't know if you've already found a solution to this, but here is a nice overview of how to get started:
http://shahabhameed.blogspot.com/2011/05/custom-views-in-android.html
For you, I think you can extend an existing View, that View being the SeekBar. You can take the standard SeekBar and draw it in a circle.
Finally, here is a source code that does the rotation with a volume knob. It is its own project though, so you have to do some work to use it in your own app.
http://mindtherobot.com/blog/534/android-ui-making-an-analog-rotary-knob/
Good Luck!
I have a neat library to do this. It is extremely stable and well maintained. https://bitbucket.org/warwick/hgdialrepo
Heres a youtube demo: https://youtu.be/h_7VxrZ2W-g
This library comes with a demo app with source code and the demo app actually uses a dial as a menu, So I think this should be the perfect solution for you.

Dragging and Dropping of view in Android 2.2

How to do drag/drop functionality to move a view from one position to another position in the current layout using a graphical drag and drop gesture in API level 8 as this functionality comes in Android 2.3
Thanks Saurabh!
hi here i give the link and go this post and find the solution of your question.
where i post my whole activity code for everyone.
so i think it`s help you best of luck
How to implement Drag and Drop in android 2.2?
and also find the another solution of how to do this.then use this link
http://code.google.com/p/rxwen-blog-stuff/source/browse/#svn/trunk/android/drag
And Another is
http://code.google.com/p/android-drag-and-drop-basic/source/browse/src/edu/sbcc/cs123/draganddropbasic/DragAndDropBasicActivity.java
My guess is you would need to listen for the touch of the user on the screen, identify the object that is being selected using the x/y coordinates, and then when the user releases the click, identify where they released. If it has changed, then work out where the new location is, and pass the object originally clicked to the other view, and remove it from the old one, placing it in the position clicked on the new view.
Look up OnClickListener for more information on how this works, in the Android Developer guides

Android - drag and drop - list rearrange

How can I create a list where I can rearrange list items with dragging
list rows to another row and so on (to change to order)?
Just like on the HTC Hero in the clocks app where you can rearrange
the order of clocks?
Even though this question is already answered. I struggled using the music app as an example, so I created a simple Drag and Drop List project to help others that can be found here
Pay special attention to this one
com.android.music.TouchInterceptor
You can also try my recent implementation here:
https://github.com/bauerca/drag-sort-listview
It gives smooth scrolling while dragging and supports list items with arbitrary heights. Lots of jumpy behavior has also been removed as compared to the TouchInterceptor.
It's in platform/packages/apps/Music/src/com/android/music/TouchInterceptor.java. Here's a direct link:
https://android.googlesource.com/platform/packages/apps/Music/+/master/src/com/android/music/TouchInterceptor.java
Hint: download the android sources and have a look how the Music app (packages\apps\Music) implements this functionality.

Categories

Resources