Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Smooth transition between full-screen-activity and one with notification-bar and action bar

Background

I have an app that has 2 activities :

  • splash activity, which is shown in full screen (no action bar, no notification bar)
  • main activity, which has both an action bar (uses actionBarSherlock) and a notification bar.

The problem

For some reason, when going from the first activity to the second, there is a "jumpy" layout process, which shows the content of the second activity without the action bar and notification bar, and a moment later it shows them both.

This causes the content below to move too, which is very noticeable.

Possible solution

As I've seen, a possible solution would be to hide the action bar and show it a bit later (500ms later), but this seems like a bad solution (making it slower and hiding for no reason), plus I need to get the actionBar items positions for another purpose (for showing a tutorial).

The question

Is it possible to avoid the "jumpiness"? One that doesn't involve such a weird workaround?

like image 718
android developer Avatar asked Dec 22 '13 16:12

android developer


1 Answers

I've solved my problem doing the following:

1.- I have to optimize all the screens where the AB was shown. In some cases I used ListViews which weren't correctly implemented and that caused a noticeable load time in the activity.

2.- I have shown the status bar BEFORE starting the new activity. I mean: I've shown the status bar in the fullscreen activity just before starting the non-fullscreen one. With that I achieved that the layout of the second activity (non-fullscreen) was never resized.

With this two little changes now the AB transition is much more smoother.

You can find the complete post with my answer at: Smoother transition from fullscreen activity using ActionBarSherlock

like image 169
GReaper Avatar answered Nov 13 '22 23:11

GReaper