Android Question Activity create first time and default views' layout animations

LucaMs

Expert
Licensed User
Longtime User
You lose the default views' animations when Activity create is not first time.

[Log without ExitApplication]

** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true ** here animations are ok
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Activity (main) Create, isFirst = false ** here no animations start
** Activity (main) Resume **

Activity.Finish, at least in Main Activity, is not enough to solve (and also it should not be the correct solution, I think).

Is this a bug?
 
Last edited:

LucaMs

Expert
Licensed User
Longtime User
I did more tests.

The problem was on a layout with 6 custom views (not too much complex, only 5 simple components) and the Animation Duration set to the default 400ms.

Then I tried a similar layout but with 6 simple panels. With this layout it seems ok, but I'm not sure, because the animation is too quick; so I changed Animation Duration to 1000ms and it works as expected.

If I increase the Animation Duration to 1000ms in the first layout, with custom views, animations start, first time and next.

I think using 400/500 ms animations seem to start only first time because app takes time to create the custom views (but, correctly, I don't see their creation on screen)


Thank you
 
Last edited:
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Make sure to test it in Release mode. It will start quicker.
I'm sure, I did the tests only in release (obfuscated) mode.

But now I've done it a try on a different device and I get the correct animation.

The problem is on a tablet with Android 4.4.2 and everything is ok with a 4.0.4 smartphone.

I will try with 4.4.2 emulator, can the tablet have system problems? (not memory problems, it has almost 9 Gb free)
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Tried with a Google emulator 4.4.2, same animations problem - they are correct on first start only.
Same with a GenyMotion emulator but 4.4.4 (same API 19).

No problems with a phone with 4.0.4. "Wrong" animations with real device and 2 emulators with API 19 (release mode).
 
Upvote 0
Top