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

2

10

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?

Florencia answered 22/12, 2013 at 16:20 Comment(0)
I
2

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

Intoxicate answered 1/4, 2014 at 8:21 Comment(1)
Thank you. I hope I will remember to use this tip when I see this problem again.Florencia
T
0

Why don't you use some other animation slide transitions rather than default popping one?

something like this?

overridePendingTransition(android.R.anim.accelerate_interpolator, android.R.anim.slide_out_right);

Here is the Animation lists that you can use http://developer.android.com/reference/android/R.anim.html

Timmy answered 22/12, 2013 at 16:53 Comment(1)
i'm not talking about the transition animation at all. i'm talking about the notification bar that comes and moves everything a little to the bottom, after the content itself is shown, and this is not in an animation but a very "jumpy" experience.Florencia

© 2022 - 2024 — McMap. All rights reserved.