DevByte - Sliding Tabs

Android Developers · 86K views · 2014 · 2:03

Open on YouTube

Software (other)UX & UI designtutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering how to replace deprecated ActionBar tabs with Google Play-style swipeable tabs.

Recommended by 12 people across 6 different months, 2014 to 2015.

What it is

A two-minute DevBytes episode from the Android Developers channel showing how to implement and theme Play Store-style sliding tabs using ViewPager. It accompanies the official SlidingTabsBasic and SlidingTabsColors sample projects.

What people said

Recommends Soumil Deshpande · 2014-05 · Stack Overflow · on “Develop a music player android app with swipe feature in two weeks”

Here is a link from google developers on how to implement sliding tabs like google play. [this video] And this is an excellent tutorial to build a music player. [LINK] Integrate both and you will have your app.

Recommends Soumil Deshpande · 2014-05 · Stack Overflow · on “Android TabLayout With Swipeable Views Button Click From One Fragment To Another Fragment”

Check this tutorial out from the official android developers channel that teaches you to make a sliding tab layout like google play and then you can add the code to the button click. Check it out [this video]

Recommends ianhanniballake · 2014-06 · Stack Overflow · on “Action bar navigation modes are deprecated in Android L”

The new Android Design Support Library [LINK] adds TabLayout [LINK] , providing a tab implementation that matches the material design guidelines for tabs [LINK] . A complete walkthrough of how to implement Tabs and ViewPager can be found in this video [LINK] Now deprecated: The PagerTabStrip [LINK] is part of the support library (and has been for some time) and serves as a direct replacement. If you prefer the newer Google Play style tabs, you can use the PagerSlidingTabStrip library [LINK] or modify either of the Google provided examples SlidingTabsBasic [LINK] or SlidingTabsColors [LINK] as explained in this Dev Bytes video [this video] .

Recommends jpardogo · 2014-10 · Stack Overflow · on “android 5.0 material design tabs”

This post [LINK] of @ChrisBanes (Developer Programs Engineer for Android) explain the situation with the new Toolbar. So this [LINK] sample can help. As well as this [this video] DevBytes video. If you want a library, you can go for this one [LINK] but It is not updated to material design (I forked it, and If I have some time, I will try to update it). You can find more information about the new API 21 in @ChrisBanes blog [LINK] as well as the official android blog [LINK] EDIT: You can find material design tabs in this repo jpardogo/PagerSlidingTabStrip [LINK] : I basically did 4 changes to the original library, so far (I will add Toolbar and fix some stuff tomorrow): Change the default parameter

Recommends Tim Rae · 2014-10 · Stack Overflow · on “How to implement sliding effect on the tab host indicator in android using fragment and view pager”

It's possible to use ActionBar tabs, but this design mode has been deprecated in API 21 [LINK] , and it works differently on different sized screens anyway which can lead to some undesired effects. I used the classes in SlidingTabs example [LINK] from Android developers to achieve this effect without having to include a 3rd party library dependency. There is a video tutorial [this video] as well.

Recommends Tim Rae · 2014-10 · Stack Overflow · on “Action Bar Tabs using ViewPager with Navigation Drawer”

As you have noticed, ActionBar tabs don't play very nicely with Navigation Drawer and this design mode has been deprecated in API 21 [LINK] anyway. I used the classes in SlidingTabs example [LINK] from Android developers to achieve this effect without having to include a 3rd party library dependency, and am very happy with the result. There is a video tutorial [this video] as well.

Recommends Liran Peretz · 2014-11 · Stack Overflow · on “Customize view pager android”

i recommend to you to see this [this video] tutorial about sliding tabs. if this not what u looking for u can create your own tabs layout and implement OnPageChangeListener, when the method "onPageSelected" invoked u can change the visibility of the indicator in your custom tab layout.

Recommends hax · 2014-11 · Stack Overflow · on “How to add different content fragments to sliding tabs”

I am not sure whether I got the question right but the fact is that there are fragments created in SlidingTabsColorsFragment.java by the following method: Fragment createFragment() { return ContentFragment.newInstance(mTitle, mIndicatorColor, mDividerColor); } So I would suggest to simply change that method to something like this: Fragment createFragment() { return MyVeryOwnFragment.newInstance(mTitle, mIndicatorColor, mDividerColor); } Because there can only be Fragments displayed whose were created beforehand in this method. Then your own Fragment will be displayed in the content area. You may also want to watch this video on the topic [this video] by the android developers youtube channel. ---

Recommends tim687 · 2015-01 · Stack Overflow · on “create custom android tabs”

Watch this video [this video] from the Android Dev team showing how to use Sliding Tabs I got a handy class if you want to dynamically edit the layout of the pages: Create a file called SmartFragmentStatePagerAdapter.java and enter this code: package com.package.name; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentStatePagerAdapter; import android.util.SparseArray; import android.view.ViewGroup; /* Extension of FragmentStatePagerAdapter which intelligently caches all active fragments and manages the fragment lifecycles. Usage involves extending from SmartFragmentStatePagerAdapter as you would any other PagerAdapter. */

Recommends DeanK · 2015-01 · Stack Overflow · on “Action Bar Tabs do not fill screen width”

I would recommend you use Android Sliding Tab, which is pieces of code from Google to do the same thing as you've shown. Since the 5.0 API, the Action Tab has been deprecated, so this is one good solution to this problem. Maybe some actually link [LINK] will be helpful. Also this in action [this video] (Youtube)