DRAG & DROP - Android Fundamentals

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ม.ค. 2025

ความคิดเห็น • 65

  • @rowenarrow
    @rowenarrow 2 ปีที่แล้ว +3

    This is yet another fantastic video that gets the fundamentals down.

  • @ihabahmed
    @ihabahmed 2 ปีที่แล้ว

    I'm looking for this video since Google announced first-class support for Kotlin, 2017!
    Thank you Philipp, subscribed for sure.

  • @andromilk2634
    @andromilk2634 3 หลายเดือนก่อน

    For your information, if you showed the end result at the start of your video with the desired functionalities, it would make it more comprehensible what it is exactly you're trying to show.

  • @omprasadrathod3600
    @omprasadrathod3600 2 ปีที่แล้ว +2

    Thanks bro..you saved me as usual😃Can you please make a video on drag item from recycled view and put it on the other view group and vice versa..if not possible then please give me resources I will go through it

  • @maximroveri4400
    @maximroveri4400 4 ปีที่แล้ว +2

    hey! i was wandering if you could make an "extension" to this video (so to not waste your time) where you explain how to drop a view anywhere on the screen and not just in a pre-given position.
    anyways thank you, you've been helpful with this content too!
    * or otherwise if you dont have enough time, than i'd be glad if you could answer at this. thanks!

    • @vijay6877
      @vijay6877 3 ปีที่แล้ว

      Here he is placing the view into the view group and this view group will place anything into the center by default and if you have to place something to any specific position you need to find its coordinate also the view's height and width. I'm not sure but you can do that with onTouchListener. with this, you'll get the get coordinates and then you can move the view accordingly.

  • @farelardiansyah2970
    @farelardiansyah2970 ปีที่แล้ว

    Thank you for the video.
    i wonder is possible to save drag and drop views using shared [references?

  • @sidprabhakar3574
    @sidprabhakar3574 4 ปีที่แล้ว +2

    thanks for the video, very helpful. is there something specific I have to setup/import to get the "dragView" command to work? my android studio does not recognize that...

    • @fleurjansen8322
      @fleurjansen8322 3 ปีที่แล้ว

      did you find a solution to this?

    • @charlieweitzenberg9587
      @charlieweitzenberg9587 2 หลายเดือนก่อน

      @@fleurjansen8322 3 years too late but you have to initialize it in your onCreate function first using "val dragView = findViewById(R.id.dragView)"

  • @jaaxConJ
    @jaaxConJ 4 ปีที่แล้ว +1

    Thank you very much man ! It was really helpful. Great video and explanation

  • @averageguycraps8570
    @averageguycraps8570 ปีที่แล้ว

    Thank you for your awesome tutorials, trying to learn on your own is difficult with this info. Question - how would i keep the parent image and drop a duplicate in the 2nsd layout? Ive searched everywhere and cant seem to make it happen. Thanks

  • @hdkloh
    @hdkloh 3 ปีที่แล้ว +1

    Hi Phillip, Can we save the view position (in shared preference) after drag n drop.

  • @gevorgkoshetsyan423
    @gevorgkoshetsyan423 ปีที่แล้ว

    Can we ignore transparency somehow?

  • @buburayam2303
    @buburayam2303 3 หลายเดือนก่อน

    love this tutorial so much

  • @animeshsingh5982
    @animeshsingh5982 2 ปีที่แล้ว

    hi great video just had a question how can we drag the view only vertically

  • @yunoletmehaveaname
    @yunoletmehaveaname ปีที่แล้ว

    How do you get it to save when you close and reopen the app?

  • @cherylm8210
    @cherylm8210 4 ปีที่แล้ว +2

    Nice video. Would be very helpful if there's text code available to compare with when I get errors.

    • @PhilippLackner
      @PhilippLackner  4 ปีที่แล้ว +2

      Thank you! Yes I know that this is helpful, sadly I don't have the code anymore, but for the next series where I write a little bit more code I will put a github repo in the description

    • @cherylm8210
      @cherylm8210 4 ปีที่แล้ว +1

      @@PhilippLackner Thank you!

  • @anasdarai4467
    @anasdarai4467 4 ปีที่แล้ว +2

    Thank you very much for your explanations,you are the best, keep on going!

    • @PhilippLackner
      @PhilippLackner  4 ปีที่แล้ว

      Thank you so much for the feedback, that is what keeps me going 🙏🙏

  • @brayn7504
    @brayn7504 ปีที่แล้ว

    Hello Philipp, I want to achieve the same however I don't want to have 2 separate containers i.e. source container and target container view.
    I am trying to drag and drop a Textview within one single ConstraintLayout. Is it possible? I have tried but view doesn't move exactly where I put and randomly places somewhere other than the place I dropped.
    Or It is just that drag and drop must have 2 containers in order to reliably do this. If so, how can I do the same within single container? I would love to get some directions and your input on this. thank you.

  • @patelmaulikvm
    @patelmaulikvm 4 ปีที่แล้ว

    Thank you so much sir, but if we want to set multiple Clip item for more then one text then , how can we set that ?

  • @algernonanon4533
    @algernonanon4533 4 ปีที่แล้ว

    is there a way to have a hide/unhide eye or icon pop and be attached to it? So you can reorder and also have option to not display some items

  • @carbonoxy9968
    @carbonoxy9968 4 ปีที่แล้ว +2

    Hi there, nice tutorial, seriously, the best one I've ever find on youtube

    • @PhilippLackner
      @PhilippLackner  4 ปีที่แล้ว +1

      Thanks so much man!! That is not difficult to do. As a drag view, just use a layout instead and put a text view in it. And in the onlongclick listener you just set the text of the text view to the clip text after calling it.startDragAndDrop

    • @carbonoxy9968
      @carbonoxy9968 4 ปีที่แล้ว +2

      @@PhilippLackner Thank you so much, I'll surely give it a shot!

  • @zakiahmed1702
    @zakiahmed1702 ปีที่แล้ว

    Is there anyone they can tell me which top apps use these drag and drop features in so that I can learn and implement in a better way.
    Thanks everyone.

  • @terryjohnson3479
    @terryjohnson3479 ปีที่แล้ว

    How about simple drag and drop using a keyboard ? You start off with linear layout and a bunch of crap that doesn't tell you how to simply drag and drop without a mouse.

  • @sheikayubsheikaadil9178
    @sheikayubsheikaadil9178 4 ปีที่แล้ว +1

    Hi bro how to develop an IOT (Internet of Things)app similar to Blynk and Cayenne App, using Android studio to control IOT devices.

  • @mstintern2894
    @mstintern2894 ปีที่แล้ว

    if you share the changes on emulator in next to screen, it will be quite helpful

  • @optimistavaliente9788
    @optimistavaliente9788 ปีที่แล้ว

    could you make a video about making a puzzle game with java?

  • @aryanvikash1967
    @aryanvikash1967 4 ปีที่แล้ว +3

    #Suggestion : Add a small clip of your output app in starting of your videos (whatever you are going to create in videos ) like here your last part that is drag and drop app
    .
    I know I say this every day on your videos😂 But you are awesome .🤪

    • @PhilippLackner
      @PhilippLackner  4 ปีที่แล้ว +2

      Thanks so much for the suggestion, that's a very good idea 👍👍

    • @Surajkumar-hy4mh
      @Surajkumar-hy4mh 3 ปีที่แล้ว +1

      +1

  • @Ram-jv1jg
    @Ram-jv1jg 2 ปีที่แล้ว

    Hi All,
    We have 5 different shapes (Square, Circle, Triangle, Rectangle, and Line) and 4 colors (Yellow, Red, Blue, and Green).
    Can someone please help me to implement an app that allows for dragging a color on a shape as follows:
    Yellow dropped on Square -> turns the shape into a Yellow rectangle
    Yellow on Circle -> Yellow Triangle
    Yellow on Triangle -> Yellow Line
    Yellow on Line -> Yellow Circle
    Red dropped on Square -> turns the shape into a Circle
    Red on Circle -> Yellow Square
    Red on Triangle -> Yellow Rectangle
    Red on Line -> Yellow Square
    NOTE: have to use only OOPs concept in order to build the app (no switch case, if or when statements and no lists or maps)

    • @ChrisAthanas
      @ChrisAthanas 2 ปีที่แล้ว

      Did you figure it out?

  • @anorov_hasan
    @anorov_hasan 3 ปีที่แล้ว

    how we can drag recyclerview item and drop it to another recyclerView item , by the way thank you for such a great tutorial

  • @chiranjeevshubham690
    @chiranjeevshubham690 ปีที่แล้ว

    Perfect 👌

  • @emiliocben
    @emiliocben 4 ปีที่แล้ว

    What if I want to make a copy of the view object being dragged and duplicate the object once it is dropped? Also how do i get the object to drop at the point where the user drops the object instead of the object sticking to the center of the view?

    • @PhilippLackner
      @PhilippLackner  4 ปีที่แล้ว +1

      You can programmatically create views to do that copying. And the second one is harder to do, you need to track the coordinates where the user dropped the item and then adjust the margins accordingly

    • @emiliocben
      @emiliocben 4 ปีที่แล้ว

      @@PhilippLackner when i creat the view through programming, the android documentation dosen't do a good job of explaining the objects methods and they seem far different than xml tags, for instance, if i create a view object the first apparent problem is the layout margins, i dont fully understand how the layoutParams work and some views dont even allow this class to be implemented plus none of the view objects have dedicated margin methods, so if i want to make a view object, without the right method explained i am tormented to force the view object being fullscreen..is there better documentation somewhere??

    • @PhilippLackner
      @PhilippLackner  4 ปีที่แล้ว +2

      @@emiliocben yes you have to set the margins with layout params. Usually googling how to do that programmatically and clicking on the first stackoverflow link is the best documentation you can get 😂

    • @emiliocben
      @emiliocben 4 ปีที่แล้ว

      @@PhilippLackner lol then stack overflow i must!!

  • @trinhgiatrang
    @trinhgiatrang 4 ปีที่แล้ว +1

    Could you make a tutorial on Java?

  • @jamersjames329
    @jamersjames329 3 ปีที่แล้ว

    Hi bro, I really need some help with my code and I don't understand why it's not working. My task was to copy the layout of a certain picture here: imgur.com/TweDH6u and it just doesn't work and its full of error when i do it. I heard that this is just an easy code to do and i can't even do it properly. Can someone help me?

    • @ChrisAthanas
      @ChrisAthanas 2 ปีที่แล้ว

      did you figure it out?

  • @chiranjeevshubham690
    @chiranjeevshubham690 ปีที่แล้ว

    Sir, Can you please share the project source codes and file ? Please 🙏🙏🙏

  • @amirayasmine8490
    @amirayasmine8490 2 ปีที่แล้ว

    U r amazing

  • @nonelelacele9300
    @nonelelacele9300 3 ปีที่แล้ว

    I really need this for java

    • @ChrisAthanas
      @ChrisAthanas 2 ปีที่แล้ว

      Java is deprecated for Android. Have you started learning kotlin?

  • @francissalerno3151
    @francissalerno3151 3 ปีที่แล้ว

    Thank you

  • @anidaniel5553
    @anidaniel5553 3 ปีที่แล้ว

    Can I get Java not kotlin

    • @ChrisAthanas
      @ChrisAthanas 2 ปีที่แล้ว +1

      Java is deprecated. Time to learn kotlin. How has it been going?

  • @guy1407
    @guy1407 4 ปีที่แล้ว

    awsome!

  • @androtest6334
    @androtest6334 4 ปีที่แล้ว

    hi dear

  • @eddytanhh
    @eddytanhh 3 ปีที่แล้ว

    Android is complicated

    • @PhilippLackner
      @PhilippLackner  3 ปีที่แล้ว +4

      indeed

    • @ChrisAthanas
      @ChrisAthanas 2 ปีที่แล้ว +1

      For sure... over complicated for what is actually going on... sadly this is what Android is, and if you can push thru it, it does pay well.

  • @anser3756
    @anser3756 2 ปีที่แล้ว

    java