ActionBar Tabs "locked" below ActionBar - android

Is there any way, how to set that the Navigation Tabs will be displayed below Action-bar every-time? On my phone is the view like I want it to be - tabs below Action-bar - but on tablet are the tabs inside the Action-bar.
Is there any way how to accomplish that?

You can not force tabs to be below the action bar. You can, however, roll-your-own with a ViewPager and PagerTabStrip. See the post below:
Force stacked tabs
Also, the Android Developers docs have some info:
http://developer.android.com/training/implementing-navigation/lateral.html#PagerTitleStrip

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.

Scroll arrow in Navigation Tabs of actionbar

I have chosen action bar with navigation tabs for fulfilling my app requirement.
If I set three tabs in navigation mode, window width is good enough to show all the tabs. When I add more than 3, say 5, tabs are visible and I can access it by scrolling horizontally. Even though, tabs are visible only on scrolling to right and user may not aware that more tabs are available.
Is it possible to add arrow images in Navigation TabView if more tabs were available? I believe navigation tabs are shown in stack view of actionbar. Is there some way to add custom view in stacked layout of actionbar?
possibly unrelated (and feel free to comment as such so that I delete the answer) but have you considered using swipe views instead of ActionBar tabs?
http://developer.android.com/training/implementing-navigation/lateral.html
They're really easy to use and you can customize them very easily to do what you want and to include any sort of layout you deem applicable to your app. Have a look at
http://viewpagerindicator.com/
for ideas on what's possible.

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.)

Moving the ActionBarTabs

I've set up a ViewPager in my App with tabs, but I need to position the tabs underneath a button so the layout would be
TitleBar
Button to search activities on a day
Tabs of each day there are activities
Is that kind of layout possible to do using Tabs or will I need a different approach to solve this?
The way the activity is running is theres a main activity, and the layout is just the button and a FrameLayout, and the the list (where the ViewPager is) is set up in a fragment and the fragment is loaded into the FrameLayout. I don't know if this is the best method for this so if not please add your recommendations of a better method I could use.
EDIT: If I could get it so all the tabs were at the bottom of the screen this would also be fine.
Is that kind of layout possible to do using Tabs
Not with action bar tabs. Not only can you not control where the tabs go, you cannot even control if there will be tabs versus a drop-down list.
will I need a different approach to solve this?
You are welcome to use some other tab solution (ViewPager with a tabbed indicator, FragmentTabHost, etc.) where you have more control.
Note that your proposed design does not adhere to Android design aesthetics. Most apps would not have "Button to search activities on a day", but instead a search action bar item, or perhaps a SearchView in the action bar.
If I could get it so all the tabs were at the bottom of the screen this would also be fine.
This is completely against the Android design guidelines. Don't use bottom tab bars on Android.

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.

Categories

Resources