Bottom Navigation Bar with Fragments - Android Studio Java Tutorial 2023 | Step by Step

Поделиться
HTML-код
  • Опубликовано: 30 июл 2024
  • Hello Coders!
    I'm Surya Pratap Raj, and I'm excited to welcome you back to our Android development journey. In today's video, we're diving into the world of Android app development, focusing on one of the key user interface elements - the Bottom Navigation Bar.
    You might wonder why Bottom Navigation Bars are so popular in mobile app design. Well, these nifty user interface elements allow for easy navigation between different sections or pages of your app. Positioned at the bottom of your screen, they make it effortless for users to switch between various features and functionalities.
    By the end of this video, you'll have a deeper understanding of how to implement a Bottom Navigation Bar in Android Studio using Java. This is a valuable skill for Android app developers looking to create intuitive and user-friendly apps.
    If you found this tutorial helpful, don't forget to hit the like button and subscribe to my channel for more exciting Android development tutorials and tips. Your feedback is invaluable, so feel free to leave any questions or comments in the section below.
    Bottom Navigation Bar with Fragments - Android Studio Java Tutorial 2023 | Step by Step
    Chapters :
    00:00 Intro
    00:16 UI Design
    01:37 Create Navigation Items
    03:27 Import Icons
    04:21 Implement Icons into Navigation Items
    05:39 Java Code
    06:41 Create Fragments
    07:45 Fragments Design
    08:17 Navigation Item Selected Listener
    11:54 Create loadFragment Method
    13:30 Resolving Issues
    17:05 Run App in Physical Device
    #android #androidstudio #java #programming #codewithsurya #ui #tutorial #app
  • НаукаНаука

Комментарии • 61

  • @cyberdawn361
    @cyberdawn361 3 месяца назад

    i was stuck in this bottom navigation for weeks. you Have finished my job. Thanks❤

  • @Chetan_fireworks
    @Chetan_fireworks 6 месяцев назад +3

    Your video explanation is excellent. Keep us updating. Thank you 😊

  • @skilllearn904
    @skilllearn904 6 месяцев назад +4

    Wow, this tutorial is amazing! I really appreciate the effort you put into explaining code. Your clear instructions made it easy to follow along. Can't wait for more videos on Android UI design and backend tutorials. Keep up the fantastic work! 👏👍

    • @codewithsurya101
      @codewithsurya101  6 месяцев назад

      I appreciate the positive feedback! Thanks! 👍

  • @Chetan_fireworks
    @Chetan_fireworks 6 месяцев назад

    Your code is working excellent.

  • @motovloggingwithsunny
    @motovloggingwithsunny 3 месяца назад

    Your clear instructions made it easy to learn can you start android full course basic to advance explanation is excellent 👌

  • @pankulghai456
    @pankulghai456 Месяц назад

    sir you are doing a good job. thankyou so much your video helped me.

  • @user-th5ni7sq9y
    @user-th5ni7sq9y 7 месяцев назад

    thanks bro you saved me

  • @Chetan_fireworks
    @Chetan_fireworks 6 месяцев назад

    I was finding solution from one week, but your video gave me solution. And code is working fine 👌

  • @soomrog4312
    @soomrog4312 5 месяцев назад

    You are a great teacher. Thumbs Up for you! Keep up good work. You will get thousands of subscribers. 😊

    • @codewithsurya101
      @codewithsurya101  5 месяцев назад +1

      Loved your appreciation, Thankyou so much! 💚

  • @x7429.
    @x7429. 9 месяцев назад

    Hello, the video was helpful. I followed the procedure and understood how it works. Is there a way to navigate between the various fragments without losing their data?

  • @volkancicek5117
    @volkancicek5117 4 месяца назад

    thanks bro

  • @iqct_vr7578
    @iqct_vr7578 Месяц назад

    Hi, im stucked, can you tell me the logic of instagram: imagine we have an inner fragment inside the main fragment and we swtich to other item bottom navigation, and then come back to the previous item bottom navigation but it has to open the inner fragmnet as it was the last opened fragment(instead of the main fragment), just like the search nav in instagram, we open a post and it has the bottom nav, if we go to profile nav and then come back to search box nav, it opens the last post instead of whole search box!, how can we achieve this behavior?

  • @techamatuer8115
    @techamatuer8115 2 месяца назад

    Actually this video is not helpful, it is the best video on RUclips for beginners, lot's of love sir keep doing well

    • @codewithsurya101
      @codewithsurya101  2 месяца назад

      Thankyou so much for your appreciation, means a lot :)

  • @ItsLayal
    @ItsLayal 8 месяцев назад +1

    Hello, is it possible to achieve for the home fragment to have a listView and inside each item of the listView it contains a gridView?

    • @ItsLayal
      @ItsLayal 8 месяцев назад

      How can I achieve this please? 😅

    • @codewithsurya101
      @codewithsurya101  8 месяцев назад +1

      Yes, it is possible.
      I will Create a video for it. Thanks

    • @ItsLayal
      @ItsLayal 8 месяцев назад

      @@codewithsurya101 yes please 🥹 thank you so muchh ❤️

  • @JorgeMiguel147
    @JorgeMiguel147 8 месяцев назад

    can you pls give us the source code? Great job!

  • @drxrathore
    @drxrathore 5 месяцев назад +1

    How to remove the background highlight of the selected tab in the bottom nav bar!

    • @codewithsurya101
      @codewithsurya101  5 месяцев назад +2

      Create a new style with parent "Widget.Material3.BottomNavigationView.ActiveIndicator" and name it as you want.
      In this style tag, add the following code :
      @color/ _@android:color/transparent_
      Now add the following code in your *BottomNavigationView* :
      app:itemActiveIndicatorStyle="@style/ _your_style_name_ "
      and its done.
      Let us know if it worked for you. Thanks

    • @drxrathore
      @drxrathore 5 месяцев назад

      Thank you, brother, it worked! I really appreciate it. You've earned yourself a new subscriber. ❤️

  • @enhapsh
    @enhapsh 3 месяца назад +1

    how the other icons doesn't have title visible except home?

  • @ransfordfixonowoo5949
    @ransfordfixonowoo5949 4 месяца назад

    Hello sir I'm having issues that's says default activity not found so what can I do to make the activity start

  • @irfanshahid328
    @irfanshahid328 4 месяца назад

    bro, why all my icons at the navigation bar become notification icon? home, search and profile displayed a same icon as notification

    • @codewithsurya101
      @codewithsurya101  4 месяца назад

      You can change these icons in "bottom_nav_items.xml" file, each item have its own icon and can be changed in "android:icon="@drawable/your_icon..xml" attribute.

    • @ilyha_P
      @ilyha_P 3 месяца назад

      у меня также было, просто очисти кэш в file - Invalidate Caches - Invalidate and Restart. проект перезапустится и все нормально будет

  • @user-wy2cy5xn9f
    @user-wy2cy5xn9f 3 месяца назад

    5:18 how to make icons colored? In my project it just grey...

    • @codewithsurya101
      @codewithsurya101  3 месяца назад

      Just add this attribute to your BottomNavigationView
      app:itemIconTint="_your_color_"

    • @user-wy2cy5xn9f
      @user-wy2cy5xn9f 3 месяца назад

      @@codewithsurya101 I tried, on the page where the navbar is shown, everything is colorless (gray)...

  • @albertaldemita2604
    @albertaldemita2604 8 месяцев назад

    how to change the color of background of icon?

    • @codewithsurya101
      @codewithsurya101  8 месяцев назад +1

      *If you wanted to change the selected icon background (not the selected item background) :*
      Create a new style with parent "Widget.Material3.BottomNavigationView.ActiveIndicator" and name it as you want.
      In this style tag, add the following code :
      @color/ _your_color_
      Now add the following code in your *BottomNavigationView* :
      app:itemActiveIndicatorStyle="@style/ _your_style_name_ "
      and its done.
      Let us know if it worked for you. Thanks

  • @ArlizunYt
    @ArlizunYt 6 месяцев назад

    Aur video dala karo bro

  • @ilyha_P
    @ilyha_P 3 месяца назад

    здравствуйте! благодаря вашему видео я смог сделать эту навигацию, спасибо вам огромное! но есть один недочет, скорее всего из-за моей невнимательности. у меня почему то высоко смещена полоска навигации. сто раз пересмотрел ваш xml код, все равно не могу понять в чем ошибся. можете помочь мне пожалуйста?

    • @codewithsurya101
      @codewithsurya101  3 месяца назад

      Hi, thanks for your appreciation! but I am not getting your flaw completely, I don't understand that what you mean of "NavigationBar set high", can you please elaborate your query?
      In case you need to share your screenshots or something else, you can message me to my Instagram : instagram.com/coding.lab_?igsh=a3BxOW0yNzZsYXhu

    • @ilyha_P
      @ilyha_P 3 месяца назад

      @@codewithsurya101 написал

  • @MarvelLiberty
    @MarvelLiberty 3 месяца назад

    I have a issue and I tried my best to spot the issue but it seems whenever I click in nagivation bottom view to go to another fragment, it overlaps the text meaning it overlaps another fragment on to it. I dont know how to fix this

    • @codewithsurya101
      @codewithsurya101  3 месяца назад

      Can you please share your Java code?

    • @MarvelLiberty
      @MarvelLiberty 3 месяца назад

      @@codewithsurya101 Its the same one I followed your's in this video. Just the fragment's name is different

    • @codewithsurya101
      @codewithsurya101  3 месяца назад +1

      There is one line of code which I have placed in another method, I have added a note in this video, I think you didn't noticed that note.
      That may be causing the issue. Revise the video once again and try.
      If it doesn't works, please provide me your java code.

  • @nayansingha6469
    @nayansingha6469 7 месяцев назад

    Hello sir give me a Navigation Drawer video

  • @sanju_bk_476
    @sanju_bk_476 4 месяца назад

    Bro in my code it hasn't shown any fragments.why is that?

  • @abdulganiukassim1085
    @abdulganiukassim1085 7 месяцев назад

    I watched from start to end though I don't understand what he is saying. Please can u do some in English

    • @codewithsurya101
      @codewithsurya101  7 месяцев назад

      You can watch this video with English subtitles.

  • @frank3606
    @frank3606 7 месяцев назад

    why is my navigation bar appearing on the top instead of the bottom. Nice video by the way

    • @codewithsurya101
      @codewithsurya101  7 месяцев назад

      Please message me on Instagram, I need to see your xml code.
      instagram.com/coding.lab_?igshid=OGQ5ZDc2ODk2ZA==

  • @user-ch7dk8yo1y
    @user-ch7dk8yo1y 8 месяцев назад

    I tried your code and this is what happened. "Attempt to invoke virtual method 'android.view.View com.google.android.material.bottomnavigation.BottomNavigationView.findViewById(int)' on a null object reference" how can i fix this?

    • @codewithsurya101
      @codewithsurya101  8 месяцев назад

      Can you please share your Java code where you are getting this error?

  • @waheguruthedivine540
    @waheguruthedivine540 2 месяца назад

    Surya Sir I need your contact number, as I am making an android application but I am stucke somewhere. Your videos are very knowledgeable. Please help and reply.

  • @user-qh7bw5jj6r
    @user-qh7bw5jj6r 5 месяцев назад

    Hlo bro I got an erron in this code please share me your social media account where I can ask solution for the the error.

    • @codewithsurya101
      @codewithsurya101  5 месяцев назад

      Sure, I'm on Instagram as @coding.lab_. instagram.com/coding.lab_?igsh=YzljYTk1ODg3Zg==