BOTTOM NAVIGATION VIEW - Android Fundamentals

  Рет қаралды 53,520

Philipp Lackner

Philipp Lackner

4 жыл бұрын

In this video you will learn how to implement a BottomNavigationView to navigate between fragments.
⭐ Get certificates for your future job
⭐ Save countless hours of time
⭐ 100% money back guarantee for 30 days
⭐ Become a professional Android developer now:
pl-coding.com/premium-courses...
Regular Android tutorials on my Instagram: / philipplackner_official
Checkout my GitHub: github.com/philipplackner

Пікірлер: 123
@srivastav3684
@srivastav3684 3 жыл бұрын
You have a very good knowledge plus a good voice to express it. Don't stop it brother, your views are increasing day by day. If you continue like this, your channel might hit 1 lakh subscribers in the next few months. All the best
@aav42005
@aav42005 3 жыл бұрын
Thank you for a very detailed tutorial.
@Prog10000
@Prog10000 3 жыл бұрын
Thank you very much. This is the best tutorial on this subject
@manishpingale6558
@manishpingale6558 3 жыл бұрын
Great Tutorial man !!!! I am watching your every single video in this series and I AM LOVING IT!!!! Thanks For Such Valuable Content MIllions subscribers on your way.
@PhilippLackner
@PhilippLackner 3 жыл бұрын
Thanks man!
@MCA_HimanshuSeth
@MCA_HimanshuSeth 3 жыл бұрын
Very good , now I am feeling like a developer 😁😁
@LaurinusPonpon
@LaurinusPonpon 3 жыл бұрын
Thanks sooooo much. So clear!
@vlc5554
@vlc5554 2 жыл бұрын
Cool Information, it appreciate for a New Development !!!
@pratikthorat3480
@pratikthorat3480 3 жыл бұрын
This right here! nothing less than divine. Thanks Philipp
@PhilippLackner
@PhilippLackner 3 жыл бұрын
Thanks!
@brandondelacruz2933
@brandondelacruz2933 4 жыл бұрын
New channel, yet the quality of this tutorial is gold
@PhilippLackner
@PhilippLackner 4 жыл бұрын
Thanks!!
@valarmorghulisx
@valarmorghulisx 4 жыл бұрын
You can add this implementation guys. implementation 'com.google.android.material:material:1.2.0-alpha05'
@chris_rb84
@chris_rb84 4 жыл бұрын
You are my Hero! Thank you so much!
@PhilippLackner
@PhilippLackner 4 жыл бұрын
Glad I could help!
@valarmorghulisx
@valarmorghulisx 4 жыл бұрын
İ finished it! great explaining! you are awesome!
@PhilippLackner
@PhilippLackner 4 жыл бұрын
Thank you❤️
@kareemkamal6185
@kareemkamal6185 2 жыл бұрын
great Tutorial man !!!
@bigotes20random86
@bigotes20random86 2 жыл бұрын
Thank you so much mate!! :D
@ste1516
@ste1516 3 жыл бұрын
16:43 there are nothing to improve, your explanation is perfect
@sheffomp
@sheffomp 4 жыл бұрын
Good bonus ! Great Videos so far!
@PhilippLackner
@PhilippLackner 4 жыл бұрын
Thank you!
@yadude101
@yadude101 2 жыл бұрын
these are all very good tutorials, I am watching each one, but these are getting somewhat confusing, could you provide an overview at the beginning so we can see how all these files and built in functions work together? You explain what each function does but if you could further explain what each function in terms of it's relation to the other functions and lists etc. in other files at each step, it would help. Keep up the the great work! and thank you. netninja provides a good level of explanation, he may be a good model to follow?
@sasidharan1937
@sasidharan1937 3 жыл бұрын
Speechless !!!
@NeitonSilva
@NeitonSilva 4 жыл бұрын
Great video!
@brucebane7401
@brucebane7401 3 жыл бұрын
really informative !!!!!
@wowovanmbothen
@wowovanmbothen 4 жыл бұрын
Thanks for the explanation.. Btw i have a question If i want to get the data from another activity and i want use that data on my fragments (first fragment and second fragmen), should i use intent on each fragments or only use intent on the activity??
@princedeka6054
@princedeka6054 3 жыл бұрын
New subscriber 😎👍
@manshalkhatri9289
@manshalkhatri9289 Жыл бұрын
Helpful
@bessamlegrand
@bessamlegrand 3 жыл бұрын
Wunderbar tutorial meine freund, ich liebe dich
@riteshgeddam3619
@riteshgeddam3619 3 жыл бұрын
how can we change the title of action bar at top , when clicked on particular icon from the bottom menu? for e.g on clicking home it should display Home instead of Tutorials, same for others too.
@hanadanefa7837
@hanadanefa7837 4 жыл бұрын
Thanks it works perfectly hahaha, i just miss the commit line sorry for that
@Self_growth_and_Love
@Self_growth_and_Love 3 жыл бұрын
What if I want to set the counter based on the amount of nodes that get added to my firebase Database? Or when I add a layout to my recycler view adapter? Basically making the counter Dynamic.
@tomasyedid3140
@tomasyedid3140 3 жыл бұрын
Thank for the video, it helps me a lot! I have one question, i did the same as you but at the time of running the App, each time i touch an item, gets double in the screen. I start in home but when a touch another item, goes to that fragment and the homeFragment stills there. any help?
@MMB3245
@MMB3245 3 жыл бұрын
Hi Philipp, this is such a wonderful video. In the beginning of the video (0:16) you mentioned 'it should have at least 3 fragments.' Is there any particular reason for this? I've tested using two fragments and it seems to work fine so far. Any comment on this issue if you may?
@alejandroflorez9409
@alejandroflorez9409 2 жыл бұрын
I think it's a convention of the Material Design Standard, not about a technical reason.
@TheImaginativeSachin
@TheImaginativeSachin Жыл бұрын
Hey In the fragments we added (addToBackStack) to remember the stack of fragment. I want to also synchronize the bottom navigation items with those stack. When clicking the back button only the fragment's stack is used. Is there anyway to also remember the stack of bottom navigation synchronized with the fragments while using back button? If you have answer please comments friends!!
@beeatechjs2928
@beeatechjs2928 2 жыл бұрын
good
@programmer4047
@programmer4047 3 жыл бұрын
Hey! You forgot to paste the dependency in the description box
@shreyashchoudhary7413
@shreyashchoudhary7413 3 жыл бұрын
EPIC!
@DanielMaze-tr1kp
@DanielMaze-tr1kp 10 ай бұрын
After i create the botton button view can i just create buttons on a created fragment and everything will show or is there another step? Im trying to create a sple menue on one of the fragments with a button
@android-dev
@android-dev Жыл бұрын
Could you make a video how to save fragments state when switching between them with bottom navigation bar (using xml and navigation component). It would be really helpful for beginners. Thank you!
@knflux9840
@knflux9840 Жыл бұрын
You are probably gonna want to use a ViewModel for that, I think he has some videos on that.
@Anonymous-nx9fh
@Anonymous-nx9fh 3 жыл бұрын
How can I add a coloured line below the selected item in bottom nav ?
@Somerandomnessvvv
@Somerandomnessvvv 3 жыл бұрын
since setOnNavigationItemSelectedListener is deprecated use setOnItemSelectedListener instead: bottomNavigationView.setOnItemSelectedListener{ when(it.itemId) { R.id.messages -> setCurrentFragment(fragSecond) R.id.profile -> setCurrentFragment(fragThird) else -> setCurrentFragment(fragFirst) } true }
@tushankdutt8954
@tushankdutt8954 2 жыл бұрын
Is this method still working buddy?
@Somerandomnessvvv
@Somerandomnessvvv 2 жыл бұрын
@Emprende Libre 'when' is not a method/function. It is part of Kotlin's conditional statements/expressions you can learn more about it here kzbin.info/www/bejne/moTWfaxjlNWDf5o Here I am using when as a statement to check every item id and set my fragments accordingly
@josephgellida
@josephgellida 2 жыл бұрын
the code is little bit deprecated i cant reach the change between fragments.
@lara-kp7lp
@lara-kp7lp 3 жыл бұрын
How we can add recyclerview in fragment?
@Yash-jp6xh
@Yash-jp6xh 3 жыл бұрын
I wanted this video with java
@bharathkrishnan23
@bharathkrishnan23 3 жыл бұрын
How can we test bottom navigation using espresso
@zerotechighqualitytutorial568
@zerotechighqualitytutorial568 2 жыл бұрын
könntest du das nicht auch alles auf deutsch machen :D sehr hilfreiches video danke dafür
@md.imranhossain5364
@md.imranhossain5364 3 жыл бұрын
How can I move everything from main activity to Home Fragment ?
@nt1231
@nt1231 2 жыл бұрын
i Just want to add back stack in every fragments how i can ? i mean addToBackStack(null)
@tanloc1273
@tanloc1273 2 жыл бұрын
since setOnNavigationItemSelectedListener is deprecated use setOnItemSelectedListener instead: binding.btNav.setOnItemSelectedListener { when(it.itemId) { R.id.miHome -> setCurrentFragment(firstFragment) R.id.miMessage -> setCurrentFragment(secondFragment) R.id.miProfile -> setCurrentFragment(thirdFragment) } true } Hope it can help you
@orbulak
@orbulak Жыл бұрын
Thanks, but do u have any solution for this? wtihout deprecation
@rabihutomo1598
@rabihutomo1598 Жыл бұрын
thanks man for saving my time
@AN-im4yp
@AN-im4yp 2 жыл бұрын
I have error on bottomnavigationview.setOnItemSelectedListener in main activity why?
@geraldlinao1143
@geraldlinao1143 2 жыл бұрын
Philipp are you using kotlin x is it still working kotlin x is deprecated now
@bugra1994
@bugra1994 4 жыл бұрын
Great video! I wonder is there any chance you can upload these mini projects on GitHub so that we can copy/paste some parts?
@PhilippLackner
@PhilippLackner 4 жыл бұрын
Thank you for the feedback! That's a good point, but sadly I don't have all the projects anymore. I think I will start with this in my next series from the beginning on
@bugra1994
@bugra1994 4 жыл бұрын
@@PhilippLackner that would be great, thank you :)
@srini01
@srini01 3 жыл бұрын
You have recorded this video in Mar. But by now the dependencies in build.gradle file could have have been updated. From where do i get the latest dependencies. if you use the dependencies you mentioned it is showing error
@thekralj9600
@thekralj9600 3 жыл бұрын
you can just hit alt+enter and it'll find the latest version
@savannasullivan4443
@savannasullivan4443 3 жыл бұрын
Really useful tutorial but do you have the same tutorial for Java instead of Kotlin? Thanks
@rowenarrow
@rowenarrow 2 жыл бұрын
I was faced with this same question and decided to scrap working with Java and move onto Kotlin. I watched is Kotlin playlist and am now here on this playlist. While I took my time to get here I am happy I did and ready to move forward using Kotlin. I would suggest anyone who is at is using Java to do the same.
@harshaharshi7269
@harshaharshi7269 3 жыл бұрын
sir how to get the dependencies like for bottom navigation bar you have a dependency where will we get those dependency
@PhilippLackner
@PhilippLackner 3 жыл бұрын
you find them by googling
@urvishbundela7826
@urvishbundela7826 3 жыл бұрын
This was awesome, but I wonder, can I use three separate activities in place of those three fragments. is that possible ? and is it easy to do so ?
@DanielMaze-tr1kp
@DanielMaze-tr1kp 10 ай бұрын
wondering the same
@GrumpyOldMan9
@GrumpyOldMan9 2 жыл бұрын
Surely, there must be a simpler way.
@yisun9573
@yisun9573 Жыл бұрын
setOnNavigationItemSelectedListener is deprecated, we need to use onNavigationItemSelected
@Marinakulichok
@Marinakulichok 3 жыл бұрын
Still can not understand diff between vector and image assets.
@MCA_HimanshuSeth
@MCA_HimanshuSeth 3 жыл бұрын
Dear sir I got an error when I implemented the dependency com.google.android.matetial: material:1.2.0-alpha04. The error is that - DSL method not found implementation ()
@rufansdev7446
@rufansdev7446 3 жыл бұрын
implementation 'com.google.android.material:material:1.2.0-alpha04'
@hari7027
@hari7027 3 жыл бұрын
Bro i have downloaded icons but when i am adding them they are not showing up instead empty square is showing up what to do
@erezlevanon469
@erezlevanon469 Жыл бұрын
notice that you have icon_name_foreground and same with background, use the foreground and not the background when selecting the icon to attach
@AryanvedhFromIndia
@AryanvedhFromIndia 2 жыл бұрын
implementation isnt working. showing error, has it changed since you made the video?
@un7sh226
@un7sh226 Жыл бұрын
Is anyone having the problem where the XML preview disappears just like in the Fragment video when we dont mention the tools:layout = "@layout/first_fragment" line in the fragment tags? if so does anyone know how to fix this problem?
@un7sh226
@un7sh226 Жыл бұрын
i fixed by downgrading the material version from 1.5.0 to 1.4.0
@ishaangupta6915
@ishaangupta6915 Жыл бұрын
u need to click on the ! icon, then again a popup from bottom will appear, then again it will show the ! icon on the bottom pain, click on it, anothe popup will appear to the right with 2 li ks highlighted in blue, click on the second one
@loveshpurswani632
@loveshpurswani632 3 жыл бұрын
I don't know but the bottomNavigationView.setOnNavigationItemSelectedListener() is not working for me. it's not even coming in the auto completion. if anybody could help.
@edenlu1331
@edenlu1331 2 жыл бұрын
replace with setOnItemSelectedListener
@rihanarinsi9988
@rihanarinsi9988 Жыл бұрын
in my values folder, there is no styles.xml file ..
@abhisheh2191
@abhisheh2191 6 ай бұрын
now its themes>themes.xml
@kamyt3460
@kamyt3460 24 күн бұрын
where is dependecies?
@roerbakeitje1
@roerbakeitje1 3 жыл бұрын
Realy sorry i.m a beginner. And need help. Fragment 1 must be a webview . Must i make this is in mainactivity or in fragment 1 .XML. all the tutrorials begin with a new app. Sorry i want to understand it.
@PhilippLackner
@PhilippLackner 3 жыл бұрын
I don't really get you, but if you ask where you should put the webview, then in the fragment XML if you want it to be displayed in the fragment
@roerbakeitje1
@roerbakeitje1 3 жыл бұрын
@@PhilippLackner so if i get it now. i must first make a splash screen . Than the menu with fragments and within the fragments i must made the other stuff.
@htgsniper8458
@htgsniper8458 Жыл бұрын
**********Pls help bro ******************* Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'. This is the error I'm getting while doing the projects what can I do to resolve this error i cant find any answer in stack overflow and any other sources, also tell us where can we get solutions if i get errors ?
@hanadanefa7837
@hanadanefa7837 4 жыл бұрын
how can we change the name of the toolbar? everytime the bottom navigation is clicked?
@PhilippLackner
@PhilippLackner 4 жыл бұрын
You mean the title?
@hanadanefa7837
@hanadanefa7837 4 жыл бұрын
@@PhilippLackner I think it is
@hanadanefa7837
@hanadanefa7837 4 жыл бұрын
Clicked from bottom nav
@wowovanmbothen
@wowovanmbothen 4 жыл бұрын
Maybe using ActionBar.. Set the ActionBar name with the title name (for this example home/ messages/ profile).. cmiiw
@hanadanefa7837
@hanadanefa7837 4 жыл бұрын
sorry i forgot to put the commit lol
@mohitmahajan1947
@mohitmahajan1947 4 жыл бұрын
why don't you use jetpack navigation?
@LaBoots
@LaBoots Жыл бұрын
Because it’s cheeks
@mohitmahajan1947
@mohitmahajan1947 Жыл бұрын
@@LaBoots i changed my domain lol
@jackwinter2669
@jackwinter2669 2 жыл бұрын
everything works up until 15:00
@jackwinter2669
@jackwinter2669 2 жыл бұрын
bottomNavigationView is unknown
@sujalaggrawal5481
@sujalaggrawal5481 10 ай бұрын
/Code/ package com.example.bottomnavigation import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.util.Log import android.widget.Button import androidx.fragment.app.Fragment import com.google.android.material.bottomnavigation.BottomNavigationView class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) lateinit var bottomNav : BottomNavigationView var firstFragment = FirstFragment() var secondFragment = SecondFragment() var thirdFragment = ThirdFragment() setCurrentFragment(firstFragment) bottomNav = findViewById(R.id.bottomNavigationView) bottomNav.setOnItemSelectedListener { when (it.itemId) { R.id.miHome -> setCurrentFragment(firstFragment) R.id.miMessages -> setCurrentFragment(secondFragment) R.id.miProfile -> setCurrentFragment(thirdFragment) } true } bottomNav.getOrCreateBadge(R.id.miMessages).number=10 } private fun setCurrentFragment(fragment: Fragment)= supportFragmentManager.beginTransaction().apply { replace(R.id.flFragment, fragment) commit() } }
@hanadanefa7837
@hanadanefa7837 4 жыл бұрын
how can we add buttons in here?
@PhilippLackner
@PhilippLackner 4 жыл бұрын
Where do you want to add them?
@hanadanefa7837
@hanadanefa7837 4 жыл бұрын
@@PhilippLackner in the fragment itself, i have a problem that encounter, the textview do not appear even that i follow your instruction, what could be the problem, i am using the latest android studio
@hanadanefa7837
@hanadanefa7837 4 жыл бұрын
@@PhilippLackner not just button but also something like recyclerviewer,
@alfian3570
@alfian3570 3 жыл бұрын
up
@sahilmakkar2354
@sahilmakkar2354 3 жыл бұрын
Getting error 'setOnNavigationItemSelectedListener(BottomNavigationView.OnNavigationItemSelectedListener?): Unit' is deprecated. Deprecated in Java
@edenlu1331
@edenlu1331 2 жыл бұрын
replace it with setOnItemReselectedListener
@edenlu1331
@edenlu1331 2 жыл бұрын
*meant setOnItemSelectedListener
@carelventer1964
@carelventer1964 2 жыл бұрын
@@edenlu1331 Thank you
@ksalarang
@ksalarang 2 жыл бұрын
A comment for promotion.
@ramadhansaputra3812
@ramadhansaputra3812 Жыл бұрын
getorcreatebadge
@thijsj2128
@thijsj2128 Жыл бұрын
Doesn't work. Don't bother
@rowenarrow
@rowenarrow 2 жыл бұрын
As of Jul 2022 I had to use binding.bottomNavigationView.setOnItemSelectedListener {} to get this to work. Hope this helps!
@yisun9573
@yisun9573 Жыл бұрын
I find that addToBackStack can add fragment to the stack. So, is there any listener which can let me know the stack is pop out? Because I want set some status of the fragment. Or there will be some other functions? binding!!.btnFragment1.setOnClickListener{ if(state != 0){ supportFragmentManager.beginTransaction().apply { replace(R.id.flFragment, firstFragment) addToBackStack("0") commit() } } state = 0 }
CREATING SWIPABLE VIEWS WITH VIEWPAGER 2 - Android Fundamentals
11:56
Philipp Lackner
Рет қаралды 66 М.
RECYCLERVIEW - Android Fundamentals
24:58
Philipp Lackner
Рет қаралды 101 М.
КАРМАНЧИК 2 СЕЗОН 7 СЕРИЯ ФИНАЛ
21:37
Inter Production
Рет қаралды 479 М.
The day of the sea 🌊 🤣❤️ #demariki
00:22
Demariki
Рет қаралды 99 МЛН
Navigation Drawer and Bottom Navigation View in Android Studio | Kotlin
27:36
FRAGMENTS - Android Fundamentals
17:29
Philipp Lackner
Рет қаралды 324 М.
The ViewModel & LiveData Tutorial in Android Studio (Kotlin)
8:56
RecyclerView | Everything You Need to Know
25:07
Practical Coding
Рет қаралды 129 М.
ViewModels & Configuration Changes - Android Basics 2023
18:46
Philipp Lackner
Рет қаралды 104 М.
Fundamentals of Compose Layouts and Modifiers - MAD Skills
11:56
Android Developers
Рет қаралды 85 М.
Bottom Navigation in Android Studio using Kotlin | Android Knowledge
16:25
Navigation Component - Android Studio Tutorial
12:11
Stevdza-San
Рет қаралды 170 М.