2

I am making a custom animation which requires that the page content slides synchronously with my ActionBar. For that, I need to know the animation duration of hide() and show() actions.

Runnable animationRunnable = new Runnable() {
    @Override
    public void run() {
        getSupportActionBar().hide();
        animate(topSlideImage).setDuration(ANIMATION_DURATION).translationYBy(-sectionHeight);
    }
};

My animation duration is 600ms

Apart from knowing, I would want to change (duration, interpolator etc) ActionBar hide and show animations, any ideas on how to do the same.

Edit #1

I dig into the ActionBarImpl code and found that hide()/show() duration is 250 ms, and it internally uses cubic interpolator.

Any ideas on how to use a custom animation for hiding and showing ActionBar ?

himanshurb
  • 1,115
  • 1
  • 12
  • 22
  • 1
    .hide() uses this internally: [link](http://grepcode.com/file/repo1.maven.org/maven2/org.robolectric/android-all/4.3_r2-robolectric-0/com/android/internal/app/ActionBarImpl.java#ActionBarImpl.doHide%28boolean%29) – 3mpty Sep 19 '14 at 11:53
  • Check this old stackoverflow question [how-to-hide-the-animation-of-actionbar-show-and-hide-in-android][1] [1]: http://stackoverflow.com/questions/21824472/how-to-hide-the-animation-of-actionbar-show-and-hide-in-android – Harsha Vardhan Sep 19 '14 at 11:54
  • Thanks 3mpty, I also found this link just now. Duration is 250 ms, along with cubic interpolator. – himanshurb Sep 19 '14 at 12:01

0 Answers0