Android Question Activity still shows a very brief animation on loadLayout, even with the animation duration set to 0ms

Cableguy

Expert
Licensed User
Longtime User
Hi guys and gals,

So the title should be self explanatory...
This is a B4XPages project, with immersive mode.
When launching, if its first time, a brief animation is shown and then the MainPage layout is loaded (root.loadLayout". . . . . ")

On this first video, you can see the animation, and at around 3s or 4s, the B4WPages MainPage is created and shown, but no layout is loaded.
No flickering, no flashing, just as it should be.
https://youtube.com/shorts/Zrh67I7ApTA

On this second video, same animation, same everything, and at about 3s or 4s, the B4WPages MainPage is created and shown, and an empty layout is loaded.
You can notice an incomplete animation stating from Top Left.
https://youtube.com/shorts/AdBQp8J9Ki8

ALL ANIMATION DURATION HAVE BEEN SET TO ZERO, IN THE LAYOUT FILE, IN THE B4XPAGES MANAGER AND IN THE ACTIVITY!!!!!
How can I prevent this animation from starting?
I read at StackOverFlow that we can set a flag to disable all transition animation in our app, others talk about creating a resource to cancel pending animations and apply it to both zoom-out and zoom-in animations.... but I cant seem to make that work, or even know if that works at all.
(See first results group on this google search)
 

aeric

Expert
Licensed User
Longtime User
I am not sure about immersive mode.
I found this thread and maybe Erel's answer would help.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I have tried as per instruction, even using the original example, passing 0 for in/out, but I get this error:
B4X:
java.lang.NoSuchFieldException: No field 0 in class Lanywheresoftware/b4a/samples/flickr/R$anim; (declaration of 'anywheresoftware.b4a.samples.flickr.R$anim' appears in /data/app/~~rSfYq-c-rA23thzK8cgXLg==/anywheresoftware.b4a.samples.flickr-5HEFzhghJ6L4Hhfgq4LzKg==/base.apk)
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Do you modified the code to something like this?
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
    If KeyCode = KeyCodes.KEYCODE_BACK Then
        Activity.Finish
        'SetAnimation("zoom_enter", "zoom_exit")
        Dim r As Reflector
        r.Target = r.GetActivity
        r.RunMethod4("overridePendingTransition", Array As Object(0, 0), Array As String("java.lang.int", "java.lang.int"))
        Return True
    End If
End Sub
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
yes, I did, and although I no longer get that error, the sub seems to do nothing....
Or maybe I just don't know were to place the call (using B4Pages)
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
My problem is not the transition between Pages, that is easily disable with the B4XPages manager ( pm.TransitionAnimationDuration = 0 )
My issue is that, when the mainPage layout is loaded to the page, and since I am "replacing" an activity Layout by another, WITHOUT CHANGING ACTIVITIES, android insists in trying to run the transition animation, even though all animations are ser to zero!
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I don't want to pass as ungratefull or even rude, but.... I already stated that all values have been set to zero, being them in Layout, Activity or B4XPages manager!
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
as I said.....
"I don't want to pass as ungratefull or even rude"

This is proving to be one of those walls that once hit, trying to go through takes way to much effort and time than just going around it... so I'll find a way to go around it
Thanks for the time spent reading, brainstorming and replying
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
It's better if you post a small example of your app, so we can help you.

What is a B4XPage?

It differs between the three platforms:
B4J - Form
B4i - Page in a single NavBarController
B4A - Panel in a single activity.
 
Upvote 0

asales

Expert
Licensed User
Longtime User
Which device are you using?
Did you try in another device? Same issue?
I have a Redmi 9A that show the animation between screen, even I disable all options of animation. In a Samsung A71 works fine.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…