I have an android app that uses legacy TabHost, its deprecated but still works fine.
Requirement is to add a sliding Navigation Drawer to the TabHost. Menu in the Nav drawer will be a combination of tabs in the tabhost plus additional items.
Can anyone provide examples of how to integrate Navigation Drawer with TabHost?
thanks!
Section 3.2 in this article explains quite well how to implement the navigation drawer. In this example they set it up with a header and a RecyclerView, but you can really build it however you like.
I hope this helps
Related
In developer.android training there is an explnation on how to create Navigation Drawer http://developer.android.com/training/implementing-navigation/nav-drawer.html.
there is a sample app in this tuturial --> http://developer.android.com/shareables/training/NavigationDrawer.zip .
in eclipse you can also create Navigation Drawer (file->new->android application project....->Navigation Drawer activity).
in eclipse Navigation Drawer activity there is a NavigationDrawerFragment class , but in the sample app they use ListView
my question is why the sample app and eclipse Navigation Drawer activity are so diffrent (Although they have the same functionality)?
what is the use of NavigationDrawerFragment class? why to use Fragement ( instead of ListView like in the sample app)?
I never work with NavigationDrawerFragment. I think its hard or etc. If you want real Navigation Drawer go to this link=
http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/
Here you have and updated Nav Drawer implementation sample according to Material Design. From Google IO 2015 it's recommended to use the Android Support Design library that will make your life easy.
I'm trying to get a NavigationDrawer working with sliding tabs inside a fragment (just like google play music or the google i/o app). In all my reasearch I found that you can't use Action bar tabs + Navigation Drawer together because the Navigation drawer will look like in the back of the tabs (I notice that). Can anyone help me telling me how to get that done without use an external library such ActionBarSherlock or TabHost (according to the documentation is recommended the use of actionbar)?
Yes, you're right. It won't be possible using ActionBar tabs as the navigation drawer won't overlap them. I recently implemented a library called ViewPagerAddons which has a custom view called SlidingTabLayoutColors imitating the behavior seen in Google Play/Music.
But as you said you don't want to use any libraries, you can still have a look at the source code. Here's the link with instructions: https://bitbucket.org/enthusiast94/viewpageraddons
I want to use Navigation drawer in Action Bar and below that I want to use Swipe Tabs in single sherlock fragment. I want to open above sherlock fragment on the Item click of ListView.And Most Important think is that I want to open different swipe tab on the click of different Item in ListView.
thank in advance.
Use this library. Because Navigation Drawer with swipe tabs is really difficult and as far as I know many developers are struggling with it. For reference you can refer my Application.
Create the Navigation Drawer with the standard procedure and just integrate the above library.
Hope it helps
I am using action bar with help of android-support-v7-appcompat and also using Navigation drawer over it.
In one of my fragment if I use ActionBar.Tabs then the tabs overlaps the navigation drawer and the drawer gets below the ActionBar tabs.
How can I make the action bar like in google play application or Google movie application.
The tabs should also go behind like the fragment. How can I do the same with android-support-v7-appcompat Libs
For Tab bar try ViewPagerIndicator http://viewpagerindicator.com/
This has a very good implementation for tab bar.
When we use default tab bar with actionbar, in landscape mode it will be merged into single row. So its better to use the above library.
I think you would be better off using a library like ViewPagerIndicator. The ActionBar is recognized as decor and is shown over top of the window, and the DrawerLayout is drawn as an object in the window.
Not sure if they're going to fix it in a future revision, but ViewPagerIndicator is pretty easy to set up and customize anyway.
Also, go to this question for better achievement getting-drawerlayout-to-slide-over-the-actionbar
Roman Nurik says that the Navigation Drawer should not be used with the Action Bar tabs.
The discussion is here https://plus.google.com/u/1/116515063230772720916/posts/8dWEkFcbTFX
Does anyone of you know of a sub navigation pattern in Android that uses a tabbed ActionBar navigation with pageable Fragments for its main navigation? (ViewPager)
I have looked at Spinners in the ActionBar which could work quite well if it wouldn't take ages to get the submenu rendered in the ActionBar while swiping from one tab to the next. (in the end you have jumping action items which look pretty ugly)
The other approach would include a segmented control widget which is known from the iOS platform. (like the TED application has it at the moment)
But what would be the Android way of doing it?
Why can't you try menu's for different tabs? I dont know whether it helps or not.Surf google for creating menus for each tab.