hi all i have mentioned about a code link which can be used as an e.g. of the Drag_N_Drop feature, but there will be small change. the onMotionEvent(MotionEvent event) has to be replaced by onTouchEvent(MotionEvent event). though it starts the Drag_n_drop but it not smooth as u expect. rather here i am getting a abnormal behavior,i.e, i am getting double image of the button, that i drag and drop,Can anyone run the code sample and solve the issue...?
regards Kaushik On Fri, Jan 9, 2009 at 2:39 AM, Peli <peli0...@googlemail.com> wrote: > > which can be found here: > > http://android.git.kernel.org/?p=platform/packages/apps/Launcher.git;a=blob;f=src/com/android/launcher/DragLayer.java > with the related classes being here: > > http://android.git.kernel.org/?p=platform/packages/apps/Launcher.git;a=tree;f=src/com/android/launcher > > but this is the luxury version, including scaling of the image, scroll > zones, and vibration :-) > > Peli > > On Jan 8, 8:16 pm, Romain Guy <romain...@google.com> wrote: > > You can also look at the source code of the Home (Launcher) > > application, in particular the class called DragLayer. > > > > > > > > On Thu, Jan 8, 2009 at 11:12 AM, Peli <peli0...@googlemail.com> wrote: > > > > > The code sample you linked to should work. > > > > > The basic idea is that you continuously put your image to a new > > > position according to the coordinates that you obtain through > > > ACTION_MOVE to give the illusion of dragging. > > > In ACTION_UP you check whether the finger position is close to the > > > target. > > > in ACTION_DOWN you can remember the initial finger coordinates so that > > > you can grab your icon everywhere correctly. > > > > > Basically you have to code everything by yourself, but it should not > > > be very difficult. > > > > > Peli > > >www.openintents.org > > > > > On Jan 8, 7:06 pm, "kaushik sur" <kaushik....@gmail.com> wrote: > > >> hi > > > > >> i got a suggestion here. but i really doubt whether it will work or > not.http://groups.google.com/group/android-beginners/browse_thread/thread. > .. > > > > >> please give me a valid reasoning or example. > > > > >> regards > > >> Kaushik > > > > >> On Thu, Jan 8, 2009 at 9:43 PM, kaushik.siso <kaushik....@gmail.com> > wrote: > > > > >> > hi > > > > >> > i want to know how can i enbale Drag and drop feature in android. > > >> > suppose i have a image,which are to be dragged and dropped on > another > > >> > result and it will start a new activity. > > >> > i seek your help to get a head-start atleast. > > > > >> > regards > > >> > k...@sis > > > > -- > > Romain Guy > > Android framework engineer > > romain...@android.com > > > > Note: please don't send private questions to me, as I don't have time > > to provide private support. All such questions should be posted on > > public forums, where I and others can see and answer them > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---