Moving the ActionBarTabs - android

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.

Related

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.

Custom action bar with tabs wish to be at the bottom in android

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.

Using both list navigation and tabs with ActionBarSherlock?

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.

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.

Fragments Within Fragment Tabs

I'm building an application that requires Tabs, which are now deprecated. The dev guide says to use Fragments to replace the tabs instead. However, my application needs to have fragments within each tab, which means fragments inside fragments, which isn't allowed. Does anyone know of a possible work around for this?
While the action bar support for tabs is designed to make it easy for the contents of a tab to be a fragment, that is not strictly required. You could use ViewFlipper, repeated calls to setContentView(), or something to arrange to change other stuff when the action bar tab is selected.
Prior to the native action bar (Android 1.x/2.x), either stick with classic tabs, or use something like Action Bar Sherlock to get an action bar and tabs.
I fake tabs by having a "tabs" fragment across the top that contains multiple toggle buttons. Below that I have a merge view containing a separate fragment for each tab.
I respond to taps on a toggle button by toggling the other buttons "off", showing the fragment for that "tab", and hiding the others.
its little late , but yes you can :) here's an example
but for fragment inside fragment inside tab isn't an android native way, you have to start a new fragmentActivity if you want to show detail of fragment. you can but is not an android way !

Categories

Resources