Popular

Tabs and ViewPager (Android Development Patterns Ep 9)

Published on Nov 19, 2015 144,989 views

Showing multiple screens or pages of content is easy with the help of ViewPager and a PagerAdapter. Combining that with tabs make for an effective top level navigation strategy (https://www.google.com/design/spec/pa...) for your app or for moving between content at the same level of hierarchy within your app.

TabLayout ensures that your tabs matches the material design guidelines (https://www.google.com/design/spec/co...) and integrate easily with ViewPager to make jumping between pages and getting an overview of all pages much easier.

Add the Android Design Library to your app today: http://android-developers.blogspot.co...

#ui #ux

Subscribe to the Android Developers channel at http://goo.gl/GEh1ds

Comments
  • Armando J Leon
    Armando J Leon 3 года назад Thanks for the videos @Ian Lake​, not just this one, but all the ones the team has made!
  • PhilGerb93
    PhilGerb93 2 года назад Thank you so much! This is easily the best video on the subject and it's only 3 minutes long.. Amazing!
  • Ian Lake
    Ian Lake 2 года назад Glad you liked it!
  • Rama Ayesh
    Rama Ayesh 2 года назад Thanks but the translation is white so I can not see the line can you change the line color
  • ki wi
    ki wi 2 года назад The second link is old,something cannot be used.
  • Mauricio Silva Vázquez
    Mauricio Silva Vázquez 3 года назад Very nice and quick way to explain the uses of tabs and fragments. Good job!
  • Emmanuel Rodriguez
    Emmanuel Rodriguez 3 года назад What about RTL support?
  • Diego Gómez Olvera
    Diego Gómez Olvera 3 года назад +Emmanuel Rodriguez I open sourced a tiny library to solve that issue https://github.com/diego-gomez-olvera/RtlViewPager.
  • Randy Saborio
    Randy Saborio 3 года назад What's the pen and pad he is using?
  • Alex Gomes
    Alex Gomes 10 месяцев назад most likely, wacom Cintiq - https://www.wacom.com/en-in/products/pen-displays
  • Brane Petkoski
    Brane Petkoski 3 года назад Thanks for the tablayout.
  • Arun P M
    Arun P M 2 года назад Thanks buddy for the quick and easy tutorial :)
  • sara mohmad
    sara mohmad Год назад شرح ممتاز
  • Atul Vidyarthi
    Atul Vidyarthi 4 месяца назад Sir, what view element I should use for different questions navigation in a quiz app. Please reply soon
  • Guillermo Alfonso Barros Gerdts
    Guillermo Alfonso Barros Gerdts 2 года назад Gracias por la imformación!!!! save the day!!
  • Mateus KP
    Mateus KP Неделю назад (изменено) thanks a lot , this is the only tutorial that I find on youtube that worked for me !(and the most straight to the point)
  • Kevin Vizcarra
    Kevin Vizcarra 3 года назад Does PagerAdapter and TabLayout support dynamically adding and removing tabs? For example, I'd like to show everyday of this week as a tab in TabLayout, where each day is a page in a ViewPager and when the user swipes on the TabLayout the previous or next week is shown, depending on the direction of the swipe.
  • Mike Xue
    Mike Xue Год назад thanks god! Tabs-ViewPager-Fragment .... you got it clearly!!!!
  • Tirth Patel
    Tirth Patel 11 месяцев назад This was quite easy to understand tutorial. Thank you!
  • dieter gustaf
    dieter gustaf 2 года назад how do you use getString() without a context? or rather, where do you get the context from, to call this method?
  • Andrew Epstein
    Andrew Epstein Год назад (изменено) @Andrea Rosini This is the correct answer. I was puzzled about this as well, and this made perfect sense.
  • harshit sharma
    harshit sharma Год назад Andrea, the Ist input (i.e getContext()) in FixedTabsPagerAdapter constructor doesn't exist.It shows only getApplicationContext() and getBaseContext().
  • Under The Radar
    Under The Radar Год назад Resources.getSystem().getString(R.string.stringName);
  • Andrea Rosini
    Andrea Rosini 2 года назад Create a private Context variable and assign value passed to constructor so constructor must be FixedTabsPagerAdapter(Context context, FragmentManager fm) and than call will be PageAdapter mPageAdapter = new FixedTabsPagerAdapter(getContext(), getFragmentManager())
  • Ramy Bittar
    Ramy Bittar 2 года назад I also have the same problem. I've been trying few things but nothing worked so far.
  • Kevin Tresuelo
    Kevin Tresuelo 2 месяца назад Udacity brought me here
  • Renato Kuramoto
    Renato Kuramoto 2 года назад how can I send data between fragments?
  • Sunil Sharma
    Sunil Sharma 2 года назад +Ian Lake in the title of tablayout how to set an image and text ?