I've been trying to recreate a navigation drawer looking something like this:
http://developer.android.com/design/media/navigation_drawer_holo_dark_light.png
It appears to just be an expandable list view within a navigation drawer but the trouble is I'm a bit of a newbie so i'm not sure on how to do it, any advice on how I would go about creating something like this?
Try this tutorial, you'll learn as well.
http://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/
As for the Navigation Drawer implementation, use a Menu Drawer library, it will make it much easier.
Related
i'm trying to create another navigation bar (top navigation bar) inside a fragment that already have bottom navigation bar. but i only find a way to do it (based on searching the android docs and sites) on a new activity not on a fragment that already had bottom navigation bar. Those 4 menus are fragment (Home, History, Message and profile)
edit : i already found kotlin solution (https://medium.com/#avinriyan/android-kotlin-bottom-navigation-tab-layout-19d062256882) sadly i'm using java and knows java only
it should look like above link (image)
i tried to browse a way to do it but i can't find a single tutorial either on youtube nor google.
i already have bottom navigation view like shown on above link (image)
i'm a complete beginner i need this for my project. thank you
You can use TabLayout for that purpose. Here is an article about it on medium
Or you can use libraries with custom views that also implement such feature. For example DViews that has TopMenuView which is easy-to-use analog of TabLayout
Screenshot of TopMenuView
I'm new to Android development. I get that a NavigationView is an AppBar (i think). What makes these two different? I want to create a custom "appbar/toolbar" with a centered logo and menu/settings button in the top right corner (instead of the standard left) which reveals a drawer.
I was going to ditch the built in appbar/toolbar all together and just create my own somehow and include button overlay which displays a drawer.
What would you do? Navigation view, app bar, or custom toolbar from scratch? I don't know what the standard is or what is acceptable. What is the difference between a navigationview and appbar. Thank you.
edit: I'm slowing realizing that an appbar is one feature within a navigation view, among others like a drawer layout, menu items etc... i think.
1. NavigationView
By using NavigationView, we can bind the menu directly with NavigationView. This is the benefit of the NavigationView. No need to create ListView and adapter with navigation drawer. By default we can get selector of item click. With menu we can change the color of icon of selected menu.
For more details :
1.https://developer.android.com/reference/android/support/design/widget/NavigationView.html
http://www.technotalkative.com/part-4-playing-with-navigationview/
2. AppBar
Appbar is for toolbar with scrolling effect. We can easily give the material design effect.
For more details :
1.https://developer.android.com/reference/android/support/design/widget/AppBarLayout.html
I'm fairly new here so I was wondering can someone advise me on a way to implement a navigation drawer activity in the main activity? The code is downloadable from the following links with the source code being the second link and the first link the explanation of how it is done (This isn't my code just to point out):
http://blog.grafixartist.com/image-gallery-app-android-studio-1-4-glide/
https://github.com/Suleiman19/Gallery
It would be very much appreciated and thank you in advance
you can directly implement navigation drawer in your main activity if you are using android studio.
right click on your java folder and go to new->activity->navigation drawer activity.
everything is setup for you (action bar toggle button , lists , icons , onclick methods etc.)
you can edit the list items in menu folder take activity_main_drawer.xml file.
How can i do this please help me? It is using navigation drawer list view with sub items. How I can do this?
Instead of simple listview in navigation drawer u'll have to use expandable list view .
you can follow this tutorials to get basic idea
http://www.tutecentral.com/android-custom-navigation-drawer/
Is it possible to create and add to app Navigation Drawer without using xml?
Every example i saw had an additional xml file with layout.
Nowadays i try to initialize this with:
DrawerLayout sidePanel = new DrawerLayout(this);
and then add this sidePanel using View method addView() but it cause exception.
Is it possible to add Navigation Drawer using only java code?
yes , you can do that without the XML, but still you would require a layout to at least hold that navigation drawer that you need