I've created a ViewPager. and I want to add scrollable tabs (swipey tabs) to make it more flexible (like google play).
and all the tutorials that i found using ActionBar.
How can i do it without using ActionBar?
PagerTabStrip and the tab flavor of ViewPagerIndicator should both give you swipey tabs.
This link will be helpful to you and you achieve that by following the example explained in the tutorial.
Or
You can search for SupportV4Demos in Samples and you can find the example FragmentTabs and Pager example to achieve that.
Related
How would I go about implementing swipeable icon tabs as the main navigation in an app? Heres a screenie of the popular Flipboard app, which demonstrates what im looking for: http://prntscr.com/83607c
I have been looking for an answer to this question for almost a week now, and have asked on several communites yet no one seems to be able to answer how to go about doing something like this. I'm assuming its a ViewPager for the swipeable part, but the only thing I can think of for the tabs would be a TabLayout, but this implements tabs "below" the toolbar, eg: http://prntscr.com/83674c which is not what i'm looking for.
Google recently released Support Design library. Witch contains all the necessary views. You can read more here
The views you are interested:
TabLayout and
TabLayouts.Tab
I have been familiar with TabHost/TabSpec to create application with tabs. I noticed that there are more than one option to create tabs:
1- Tabs in action bar
2- Viewpager (I guess google calls it horizontal pager)
3- And offcourse the tabhost/tabspec approach.
I tried to read google docs but it is like everywhere so I got further confused.
When would you use what or is there one that is the norm?
Thanks
You should use a Toolbar with a ViewPager to simulate tabs (all wrapped in an AppBarLayout). The result will look something like this:
You can read more about this type of design on the Material Design spec: https://www.google.com/design/spec/components/tabs.html#tabs-usage
Also, here is a good tutorial on how to implement tabs within a ViewPager: http://blog.grafixartist.com/material-design-tabs-with-android-design-support-library/
Im trying to implement a tabbed navigation where the tabs are located inside the Toolbar and the user can navigate via left/right swipes or tab clicks, just like the Hotel Tonight app:
Screenie:
http://i.imgur.com/joXRr1N.png
Before this would be done using ActionBar.Tab, but that has been deprecated. All tutorials and SO questions i've found have only described how to use the new TabLayout to put tabs under the ToolBar, not inside it. How should I go about implementing this? What would the basic xml layout look like?
You can try using PagerSlidingTabStrip and here you are a tutorial:
https://guides.codepath.com/android/Sliding-Tabs-with-PagerSlidingTabStrip
When using actionbarsherlock, when there are a lot of tabs how to hide other tabs and only show three or four tabs and when I slide the tabs I can see the tabs hidden?
thanks~
Despite your short description of the problem, I guess the following link should give you the answer:
SwipeyTabs - how to create Swipey Tabs using ActionBarSherlock Library?
If that does not help, please try to rephrase your question after reading this:
http://developer.android.com/design/patterns/actionbar.html
As in this image:
![two muppets][1]
where the buttons are Main, Favorites, and Help.
This is obviously a Tab Layout. Read Google's documentation and this more clear example
check this:
http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
That is not the Button. It's Tab Bar that is Displayed at the Top instead of Bottom
Tab Bar aligned Top
I would recommend that you look at the Android Tab layout tutorial: http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
HOWEVER please be aware that this tutorial uses the TabActivity class, which is deprecated. The documentation for TabActivity contains a version done using Fragments, which is the way tabs should be done now: http://developer.android.com/reference/android/app/TabActivity.html
Note that if you are developing for older Android devices, you should download the v4 support library, which allows you to use Fragments on old API versions: http://developer.android.com/sdk/compatibility-library.html