How do I code a toolbar in android which has a carousel? - android

I was making my app when I thought I'd look at other apps for inspiration, when I came across this toolbar implementation.
Does anyone know how to implement this?

It is using FragmentStatePager which uses fragment for its implementation.
The menu has been set up and aligned using ActionMenuView. Tablayout is also being used for the category

Related

Icon Tabs as main navigation in app bar

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

Tabhost/spec vs. viewpage vs tabbed actionbar ..which one?

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/

Navigation Drawer implies nested fragments?

I created an application with a navigation drawer navigating following the android documentation tutorial. Now the main parts of my application are Fragment but the problem is I have to use dynamic fragments in one of them.
I saw the nested fragments were supported since android 4.2, but I need to use my app on older version.
What can I do ?
I'm thinking of using a FrameLayout of fixed fragments and to set them visible or gone depending of what I need, but it seems a little ugly...
What do you think ?
Thanks for your answers
Edit :
my question is not clear but what I want to know is :
can I use the navigationdrawer with activities instead of fragments ?
is the solution I'm thinking about realy ugly ?
how can I use the nested fragment system for older version ?
In the end I used the nested fragment system using the Android Support Library (thanks Nobu Games)
Thanks for your comments

Using ActionBar.NAVIGATION_MODE_TABS together with ActionBar.NAVIGATION_MODE_LIST

I am creating an app where i would like to use both the drop down list navigation and tab navigation on an actionbar. But i can not figure out how to do this without implementing the actionbar as a custom view which would mess up a lot of the nice built in features.
So what is the best way to get both of these navigation modes at the same time?
Android will not build both of these for you. You can use the ViewPagerIndicator library to make an emulated tab bar for a ViewPager, which is probably the easiest way to do this.

Fragment based Tabs without ActionBar

Google's FragmentTabs demo feels very hackish to me. Does anyone know a nice way to have fragment based tabs that do not rely on the ActionBar?
The ActionBar is not an option, because the tabs must appear somewhere else on the screen. Also, the ActionBar lacks in the support library.
Just wanted to check before I go on and build my own solution...
I used this implementation in my app and it works great. It does not require an ActionBar and uses Fragments with a ViewPager. I came across this if anyone is still interested...
SwipeyTabs
Also here is a blog post about it:
http://blog.peterkuterna.net/2011/09/viewpager-meets-swipey-tabs.html
TabActivity in the Android docs
has an example using fragments and the TabHost and TabWidget. Hope this helps.

Categories

Resources