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.
Related
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.
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.
I'm using Android sherlock fragment tabs for creating a layout for swiping the tabs.
Now what I want to do is put the tabs below a relative layout , but the tabs headers are appearing at the top while it's content is appearing where it should be.
You may use standalone tabs widget like https://github.com/JakeWharton/Android-ViewPagerIndicator
or move existing tabs using technique (really hack) described at http://kriomant.blogspot.ru/2013/08/navigation-drawer-tabs-overlap.html
But in case of hack current tab indicator will still be drawn at the bottom. I didn't investigate whether it is possible to move it.
I'm doing my project which is based on action bar tabs....I encountered with a problem.....it is
1.My requirement is i need to place 4 tabs at the bottom of the screen whenever I'm clicking the tab the view should be change.
2.So at first i choose tabs for this but i got to know that tabs are deprecated.
3.So i have chosen action bar with tabs and for view i have chosen fragments .
4.Still now every thing is fine and perfect.
5.But what i need is i need to place those tabs at the bottom.
6.And exactly i need tab view i tried split action bar for this but it doesn't appear to the tab view.
7.So dear developers can you please help me for this
I think i have given valid information .If you feel it as insufficient please let me know
While ActionBar has a manifest attribute: android:uiOptions="splitActionBarWhenNarrow" this won't work always, not for tabs.
The other option you have is to use a ViewPager with a FragmentStatePagerAdapter. This will make swipe-able pages from fragment. Now you can include PagerTabStrip or PagerTitleStrip in Activity layout, inside <ViewPager> tag, at top or at bottom by using android:layout-gravity attribute on it.
This will show and switch to fragment/page titles.
I'm looking through the ActionBarSherlock samples demo, and I see that the List Navigation and the Tab Navigation both make use of the ActionBar's setNavigationMode method. This tells me that you can only have one or the other. If I want the user to have list navigation to move around between activities but I want some activities to have tabs, is there a different way to add tabs than via navigation mode? Is it against ActionBar design guidelines to use both? I don't look at tabs and consider this to be a navigation feature, so I find it odd that you get one or the other.
This tells me that you can only have one or the other
Correct. Bear in mind that with action bar tabs, Android will convert you to list navigation, on its own, in certain configurations, whether you like it or not.
If I want the user to have list navigation to move around between activities but I want some activities to have tabs, is there a different way to add tabs than via navigation mode?
You can use a ViewPager with PagerTabStrip or the tab flavor of ViewPagerIndicator.
Or, you can go retro and use TabHost and TabWidget.
Is it against ActionBar design guidelines to use both?
The design guidelines refer to them as separate options for "View Controls". More importantly, given the automatic conversion of tab navigation to list navigation, it would be seriously confusing for the action bar to have two Spinners' worth of navigation choices.