ActionBar and ActionBar.Tab and Navigation Drawer android - android

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

Related

Android Airbnb like Tabs

I am trying to figure out how airbnb has implemented its Tab Bar, it either seems they have hidden their actionbar and everything has been shifted onto a tab bar but then the right most user icon opens the navigation drawer which should be ideally on actionbar, Or everything is on action bar itself but then how can those 3 tabs/icons on left be implemented on actionbar. (Kindly refer attached image)
Can somebody put some light on how this can be implemented. How to go about it? Also are those 3 icons fragments or separate activities?
Here, is a library which makes your life simpler to implement TabBarView for actionbar tabs.
https://github.com/Mirkoddd/TabBarView
This should give you insight about how to use it for your app.

Navigation Drawer + Sliding Tabs inside fragment Android

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

Making ActionBar tabs appear under the content AND integrate a WebView in an ActionBar Menu

I'm currently working on an Android application with two ActionBar Tabs.
I have three questions:
1) How can I make the ActionBar Tabs to appear on the bottom of the app (under the fragments)
2) Can I make a WebView in a Navigation drawer (menu)
3) How can I let the ActionBar menu appear on the right side of the ActionBar?
Thanks for answering
EDIT:
With an ActionBar menu, I'm meaning the menu on the middle of this Picture:
http://static.androidnext.de/Facebook-for-Android.jpg
How can I make the ActionBar Tabs to appear on the bottom of the app (under the fragments)
Sorry, that is not possible with action bar tabs. You cannot even control if they show up as tabs at all, let alone their position.
Can I make a WebView in an ActionBar Menu (the menu for example Facebook has the main Navigation)
What you are referring to is a navigation drawer. Putting a WebView in a navigation drawer is technically possible but is unlikely to meet Google's design guidelines for navigation. In your case, given your third question, you presumably are not using this for navigation.
How can I let the ActionBar menu appear on the right side of the ActionBar?
That depends on what you are using for the navigation drawer. DrawerLayout supports this:
Drawer positioning and layout is controlled using the android:layout_gravity attribute on child views corresponding to which side of the view you want the drawer to emerge from: left or right. (Or start/end on platform versions that support layout direction.)

Using SlidingMenu with ABS Tabs working incorrectly?

I have Actionbar Sherlock and SlidingMenu set up in my project. I want the menu to slide in under the actionbar, so I set:
setSlidingActionBarEnabled(false);
Though, when I have the action bar Navigation Mode set up with tabs:
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
They stick with the action bar instead of sliding away. That causes the issue of being able to switch tabs and the view pager switching while the menu stays open. Along with it not being the aesthetic I am going for.
Is it possible for the tabs to slide away from the action bar with the menu? Or would it just be more practical to set up a custom implementation with radio buttons?
It's not possible to have the tabs slide when you are using NAVIGATION_MODE_TABS.
The alternative is to use the ViewPagerIndicator library and the TabPageIndicator mode from that. That way the tabs are a part of the activity layout, and will slide. The downside is that the tabs won't get embedded in the action bar on larger devices or when a device is in landscape.

How can I allow horizontal tab navigation (swipe views) with action bar navigation tabs?

How can I allow horizontal tab navigation (swipe views) if I'm using action bar navigation tabs?
Is there anything special I have to do to get this to work with ActionBarSherlock?
The code-generated stuff for a "Tabs+Swipe" activity (from BlankActivity in the new activity wizard in Eclipse) has code for this. Basically, your tabs tie into a ViewPager, calling setCurrentItem() to change the page, rather than running their own FragmentTransaction or otherwise affecting the UI. The ViewPager handles the horizontal swiping, and you populate those pages using some form of PagerAdapter (one is code generated for you). See this very related question and answer for more.
Is there anything special I have to do to get this to work with ActionBarSherlock?
Other than standard stuff for using ActionBarSherlock, nothing out of the ordinary should be required. ViewPager is in the Android Support package, which ActionBarSherlock also needs, so you will have that already in your project.
Note, though, that action bar tabs only sometimes show up as tabs. In some screen sizes and orientations, they are automatically converted into a drop-down list (per "list navigation" with the action bar instead of "tab navigation"). If you want to use tabs all of the time, rather than using action bar tabs with ViewPager, use PagerTabStrip (from the Android Support package) or a suitable indicator from ViewPagerIndicator instead.

Categories

Resources