@@justeben you can use the Activity theme: Theme.NoTitleBar (with this code your action bar disapear) and your navigation drawer open with swipes a finger from the left edge of the activity.if you mean not this , pls let me know :)
excellent video, it helped me a lot 😃, could you help me with how to pass data to change the textView inside the nav_header, please 😓For example data I get from a login :(
do you use the codes that I show in this video? or use another code? because the code that I used is not deprecated. Now, I checked again, and it works as I expected. would you please tell me exactly which code cause to error? and also please check your dependencies version , I used the last version for all my dependencies
@@AndroidGeekCo I use it for fragment. So I can't click it from fragment? It works when I swipe screen from left to right. But dont work when click hamburger. Also it can be deprected for fragment.
I got , let me check it for fragment , just as suggestion , you can use single activity , and then in your activity , yoy can use drawer with out any problem , and this way is mush more modern instead of using just fragment
i have followed your code but navigation drawer button not showing me ... if i swipe on the screen from left side drawer menu it will come.. how can i fix this ?? pls help
Hi. I don't know if the problem is relevant at the moment, but still. I also followed the code from the video, just like you. The same problem has arisen. The solution is that you need to initialize the Toolbar in the Activity.xml and Activity.kt for Activity.xml --- in ConstraintLayout --- // initialize the Toolbar with the code
in this video, we use => [ when (it.itemId) ] for accessing each item of our navigation drawer instead of show toast that we have done in this video, you can use intent for going to another activity like this -> startActivity(Intent(this,SecondActivity::class.java))
@@AndroidGeekCo Can you tell me what is wrong in my code lateinit var binding: ActivityMainBinding lateinit var toggle: ActionBarDrawerToggle override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(layoutInflater) setContentView(binding.root)
Please check your code again with the video and GitHub source : github.com/ezatpanah/Navigation-drawer-RUclips , as you can see in the video when I click on each item of menu, the toast has appeared and it's works
I love how your codes are clean and straight to the point!👏
Glad to hear that😀
Please would the nav drawer work if if I don't want the toolbar to be visible?
@@justeben you can use the Activity theme: Theme.NoTitleBar (with this code your action bar disapear) and your navigation drawer open with swipes a finger from the left edge of the activity.if you mean not this , pls let me know :)
It works but how to make the hamburger sign show is a challenge.
you can create custom action bar , and inside your custom action bar , you can put hamburger sign to control your drawer :)
I was learning from old outdated videos and facing problems of depcrecation and errors. Found your channel and I am blessed
Happy to help! 😊
Your explanations are very clean and easy to understand. Thank you so much for the content.
You're very welcome! glad you like them 😊✨
A highly educational video and one of the most understandable and clear codes. ❤❤❤
Really glad to hear that you like the video 😊🙏
Same for me... and at least it works 😀 - Congratulations !
Glad to hear! 🤩 Thanks 😊🙏
your tutorial was amazing thank you very much it was a life saver😇
Glad it helped! :)
Well explained and to the point.
Thanks for your feedback 😊🙏
Like always great reyhaneh😍✨
Thank you! 🤗
thank u very much, very helpful🌼
Glad it was helpful! 😊
excellent video, it helped me a lot 😃, could you help me with how to pass data to change the textView inside the nav_header, please 😓For example data I get from a login :(
hey, i love your video. however i have some problem on binding. the binding.apply didn't work on my laptop. what should i do?
Thanks for your feedback 😊glad you liked the video 😊 please check this video :
ruclips.net/video/JxsJxuNIcMk/видео.html
Thank you in advance
You're very welcome!😊🙏
thanks
welcome 😊
hi, thank fot you video, i have a questin, How i can close the menu when i tap del option?
you're welcome , in our example , you can use : drawerLayout.closeDrawers() for closing navigation drawer after clicking on each item 😊
if someone can't see the ActivityMainBinding, just add (dataBinding true) in (buildFeatures{})
you can add viewbinding= true inside your buildFeatures body 👍
@@AndroidGeekCo well, i use both, one to create the navigator bar and de second to made the activity code
i loved
glad to hear that 🤩✨ thanks for your feedback 🙏🏻
Menu does not open when click hamburger menu. What's problem? That say deprected for onOptionsItemSelected. That can be reason? How can I solve it?
do you use the codes that I show in this video? or use another code? because the code that I used is not deprecated. Now, I checked again, and it works as I expected. would you please tell me exactly which code cause to error? and also please check your dependencies version , I used the last version for all my dependencies
@@AndroidGeekCo I use it for fragment. So I can't click it from fragment? It works when I swipe screen from left to right. But dont work when click hamburger. Also it can be deprected for fragment.
I got , let me check it for fragment , just as suggestion , you can use single activity , and then in your activity , yoy can use drawer with out any problem , and this way is mush more modern instead of using just fragment
@@AndroidGeekCo I do navigation compoenent. I did it for MainActivity that works. It's all about fragment. Thanks for your helping.:)
i have followed your code but navigation drawer button not showing me ... if i swipe on the screen from left side drawer menu it will come.. how can i fix this ?? pls help
same for me the hamburger menu is visible, but if I touch it the window hide , did you found a fix ?
Hi. I don't know if the problem is relevant at the moment, but still. I also followed the code from the video, just like you. The same problem has arisen. The solution is that you need to initialize the Toolbar in the Activity.xml and Activity.kt
for Activity.xml
--- in ConstraintLayout ---
// initialize the Toolbar with the code
@@supermurloc5371 thank u very much 🙏🙏🙏
how do we redirect to another activity from navigation drawer in kotlin
in this video, we use => [ when (it.itemId) ] for accessing each item of our navigation drawer instead of show toast that we have done in this video, you can use intent for going to another activity like this -> startActivity(Intent(this,SecondActivity::class.java))
@@AndroidGeekCo thanks
@@AndroidGeekCo Can you tell me what is wrong in my code
lateinit var binding: ActivityMainBinding
lateinit var toggle: ActionBarDrawerToggle
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
binding.apply {
toggle = ActionBarDrawerToggle(this@MainActivity, homeMain, R.string.open, R.string.close)
homeMain.addDrawerListener(toggle)
toggle.syncState()
supportActionBar?.setDisplayHomeAsUpEnabled(true)
navView.setNavigationItemSelectedListener {
when (it.itemId) {
R.id.loginBtn -> startActivity(Intent(this@MainActivity, LoginActivity::class.java))
}
true
}
}
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
if(toggle.onOptionsItemSelected(item)){
true
}
return super.onOptionsItemSelected(item)
}
}
menu item is not clickable why it is
Please check your code again with the video and GitHub source : github.com/ezatpanah/Navigation-drawer-RUclips , as you can see in the video when I click on each item of menu, the toast has appeared and it's works
Hi i have a problem, the DrawerToggle doesnt show up, what should i do?
would you please write your code about toggle here
@@AndroidGeekCo
private lateinit var toggle: ActionBarDrawerToggle
override fun onCreate(savedInstanceState: Bundle?) {
toggle = ActionBarDrawerToggle(this, binding.notebook, R.string.open_drawer, R.string.close_drawer)
binding.notebook.addDrawerListener(toggle)
toggle.syncState()
supportActionBar?.setDisplayHomeAsUpEnabled(true);
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
if (toggle.onOptionsItemSelected(item)){
return true
}
return super.onOptionsItemSelected(item)
}
notebook is my drawerLayout
your code seems right... 🤔 is there your code on github? maybe I can take look into whole your code...
I have the same problem and i don´t know how to solved it
How this drawer work on other Activities??
just use fragment to use the same activity and only change the fragments
@@luisdanielfigueroagarcia317 Thank You Sir.