Navigation Drawer with Navigation Component - Android Studio Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ก.ย. 2024
  • 🏆 My Online Courses
    ⭐Discount Coupon: LAUNCH-STEVDZA-SAN
    stevdza-san.com
    🐱‍👤 Wanna become a member? Join!
    / @stevdzasan
    📸 Instagram
    / stevdza_san
    The navigation drawer is a UI panel that shows your app's main navigation menu. The drawer appears when the user touches the drawer icon in the app bar or when the user swipes a finger from the left edge of the screen.
    The drawer icon is displayed on all top-level destinations that use a DrawerLayout.
    To add a navigation drawer, first declare a DrawerLayout as the root view. Inside the DrawerLayout, add a layout for the main UI content and another view that contains the contents of the navigation drawer.
    Navigation Component: • Navigation Component -...
    Safe Args: • Safe Args with Navigat...

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

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

    Absolutely loved your video...Other videos of 30 minutes and 40 minutes just shows the procedure without explaining...I understood really well...Thanks a lot

  • @rameshramesh-bd2wu
    @rameshramesh-bd2wu 4 ปีที่แล้ว +2

    All your tutorials are useful for who are already familiar with Android development but beginners like me it was very hard to catch-up.

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

      That's why I will make full courses on Android Development in the future, because there are so many details to cover, and it's impossible with just one video.

    • @rameshramesh-bd2wu
      @rameshramesh-bd2wu 4 ปีที่แล้ว

      @@StevdzaSan I am eagerly waiting for that or would you suggest some other resources to learn Android development from scratch
      Namaste & Regards
      Loves from India❤️

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

      @@rameshramesh-bd2wu You can find an ebook online on Java or Kotlin, I recommend you to start learning Kotlin.

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

    Sir u made it so simple and so easy ... Thanks Alot 😍

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

    Q: I don't want back button. So, should i remove connections in nav_graph.xml file?
    Nice video 😃

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

    Great series! Very helpful to see how all the pieces go together. Thank you!

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

    Thanks for the video

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

    How can I change the activity_main (xml) from ConstraintLayout to Drawer Layout once I have already changed it for another layoutpurpose (for instance I might have used it as Linear Layout or RecyclerView)?Please tell me the technique how to solve it?... We do take home page (mainactivity)for everything but it is stuffed with other issues… While I use fragments, they crushed when Irun it… I need help guys please help me. I am a new developer with zeroeducation and experience but I understand how to make apps

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

    thank youuuuuuu

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

    Short and useful! Thank you!

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

      Thanks for supporting . (from Stevdza-San)

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

    Thanks for the video. Little help is needed, after the drawer icon is opened, again clicking drawer icon doesn't close the drawer. how to implement it?

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

    Thanks a lot! Keep the good work! I prefer Java, but I understand why you are using Kotlin and as you already mentioned, we can convert kotlin to java. I just subscribed :)

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

    Nice tutoriall

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

    So this way, if we had fragments A B C D, we'd have to create toB, toC and toD actions for A then? And then toA, toC and toD actions for B? That cannot be correct.

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

      I totally agree with you. It feels a bit clumsy. I'm building an app with 9 items in the drawer and users should be able to navigate from any item to any other one so that means about 72 actions already. Am I doing something wrong?

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

    hello guy, i love your channel :)

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

    Thanx a lot.

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

    thankyou !!!!

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

    Great work sir. Keep it up.

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

    I like your videos! They all have good content, but I am a java developer and Kotlin makes it more dificult to understand.

    • @StevdzaSan
      @StevdzaSan  4 ปีที่แล้ว +6

      You can copy and paste Kotlin code in Java class and Android Studio will automatically convert it for you.

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

      @@StevdzaSan Thanks !

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

    if drawer is open, and back button pressed,then without closing drawer its directly quit, how to solve this?? or how to lock drawer layout in some fragments?? pls

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

    Thank you very much.

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

    Hey man , great content , I have a small problem the navigation drawer doesn't close when I click the hamburger button again and there no any animation

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

      Please, use stack overflow and also recheck or match your complete code with the video

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

    Best vedio sir

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

    Great tutorial, but after drawer icon is opened, again clicking drawer icon doesn't close the drawer. and back icon is not shown in drawer icon place, after clicking drawer icon. Seeking for help! ( using kotlin )

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

    how to disable item when it's selected i couldn't find any reference in docs
    please help

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

    Use this -
    navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment
    navController = navHostFragment.navController

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

    It’s saying unresolved reference : navigationView

  • @Sk-gb2hx
    @Sk-gb2hx 3 ปีที่แล้ว

    No access to onSupportNavigateUp() from fragment, can you help me with it ?

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

    Just out of curiosity, is it standard practice to make the NavDrawer act as a switch between fragments such that the hamburger icon shows regardless of the current fragment? Any help is greatly welcome. Thanks

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

      Yeah that's true.

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

    Sir can i do that by using only one fragment and show the data related to the menu item clicked

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

    please make a video on recycler view
    filter

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

      It is now in his channel, check it out

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

    I failed to do that by java I am stack in the beginning any one help

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

    Thanks a lot i have a Q i can't use this method (findNavcontroller) ! exactly like in this line "navController= findNavController(R.id.fragment)" this method doesn't show for me on android studio any help plz

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

      Add dependency for Navigation Component. Or call Navigation.findNavController

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

      Thnks for answering me
      I all ready add those dependancy to my project but when i try to call it (initialize my navcontroller )doesn't show also this method setupWithNavController any help plz

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

      @@StevdzaSan thnks the prob was gone ^^

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

      from: developer.android.com/guide/navigation/navigation-getting-started
      val navHostFragment =
      supportFragmentManager.findFragmentById(R.id.fragment) as NavHostFragment
      navController = navHostFragment.navController
      It worked for me. Before only crashes.

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

      @@FIsabettini at last I found something that it works, than you so much

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

    Layout gravity is not available

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

      ik im late, but just try typing it fully inside the view and the error will be gone

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

    Everything is different on Java

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

    How can I add animations? Thanks 🥺🥺

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

    How to impelment using java

  • @rameshramesh-bd2wu
    @rameshramesh-bd2wu 4 ปีที่แล้ว

    Can you please make a tutorial for beginners ?

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

    doesn't work lol

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

    Is anyone here with an experience of more than a year in android development?

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

    Putting source code would be good maybe a github link to this code.

  • @abada-s
    @abada-s 3 ปีที่แล้ว

    very helpful but you was to fast in this video

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

    Is there a chance to explain them with Java

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

      You can copy Kotlin code and paste it in Java class, Android Studio will automatically convert it for you. It's not a full-proof method, but still works really well.

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

      @@StevdzaSan thank u