6

While working with the ActionBar tabs (being fragments) that can be swiped with a ViewPager I recognized that the custom menu options for each fragment are added pretty lately to the ActionBar.

This is the behavior I recognized:

  1. Swipe to the next tab
  2. Tab reached
  3. ~ 10ms with a empty bar Options
  4. Item from the fragment appears in the ActionBar

The "10ms gap" looks pretty ugly and it would be great to solve that problem.

I have looked through the native Android applications and I am able to reproduce the problem in the native ICS/JB dialer. (swiping from the contacts tab to the call log) When I look at the Play Movies app the "10ms gap" is missing (swiping from movies to personal movies) so it should be possible to solve the problem somehow.

It is interesting as well that the gap is missing when clicking on the tab. The click causes the options item to appear instantly.

It would be great if someone could help me solving the problem.

denis
  • 1,393
  • 3
  • 14
  • 34
  • What is Traceview showing you is going on during those ~10ms? – CommonsWare Aug 30 '12 at 23:54
  • 1
    Would like to gain knowledge on this one as well. I am having a similar problem here:http://stackoverflow.com/questions/13229893/android-showing-action-bar-menu-items-depending-on-viewpager – Josh Nov 05 '12 at 21:16
  • 1
    Having a similar issue binding cart items when swiping between fragments. The cart items appear about 500ms late, it only happens when swiping and not when selecting an action bar tab using onTabSelected's ViewPager.setCurrentItem(tab.getPosition()); – Brissles Jan 24 '14 at 11:50
  • @and-dev hello. any solution for this? – Eren Jun 15 '16 at 18:23

0 Answers0