B4A Library [Class] Splash Screen With Fade Out

Updated Feb 20th, 2014 - There is now a New library of SplashFade which is much improved over the class code. You can find it at the link below.

New SplashFade Library

Here is another class I had to write to complete a project. It displays a splash screen and then removes it by fading it out, just removing it or sliding it off the screen, your choice. The attachment has the class and a demo activity to show it working.

Requires B4A 2.02+

Updated, now includes the option to Slide the splash screen off

This Demo has now been modified to show some Activity Objects after the Splash Screen
 

Attachments

  • SplashFadeSlide.zip
    144.2 KB · Views: 2,184
Last edited:

asmag

Member
Licensed User
Longtime User
Another version of Class SpashFade

Hi margret!

Thank you for sharing your code!

I made a small modification in its class to demonstrate how the class behaves after the Fade Activity is completed. I put one Panel on the main Activity and it is called at the end of class.

Regards

:sign0098:

asmag
 

Attachments

  • SplashFade1.1.zip
    144.6 KB · Views: 889

margret

Well-Known Member
Licensed User
Longtime User
@ asmag,

I looked at the sample you changed. You must not understand the class as it was intented to be used. The class did not need any changes, or any activities started. The only thing you needed was to add the panel/layout before my code in Activity_Create. You were making it to complicated. I will replace the code on Post #1 with other Activity items so you can see how this should work in this sample. Also, look at the comment in the sample of mine you download posted in Activity_Create.

Anyway, I know what you were trying to do and thank you for that. I will add it and it will make the Demo more clear for others.

Thanks for the help,

Margret
 

asmag

Member
Licensed User
Longtime User
Hi Margret!

The first time I ran the application, because the parameter Firstime, is shown Splash screen but then the focus does not return to the Activity page. I wanted to demonstrate through the Panel a way to do this. I could not do it using your original class. I'm sorry if I did not understand you.

Thanks

asmag
 

AHilton

Active Member
Licensed User
Longtime User
Updated, now includes the option to Slide the splash screen off


Either the link wasn't updated with the new code or I'm really missing something perusing the code. I can't see where there's an option for sliding.
 

margret

Well-Known Member
Licensed User
Longtime User
Either the link wasn't updated with the new code or I'm really missing something perusing the code. I can't see where there's an option for sliding.

In this code, the last parameter tells it to slide and the direction:
B4X:
MyFade.Initialize(Activity, Me, "splash.jpg", Gravity.FILL, 3000, 100, "Left")

Use: Left, Right, Up, Down
 

AHilton

Active Member
Licensed User
Longtime User
Yeah, the v1.1 download in the first post of this thread doesn't have that. It only has 6 parameters for the init. No direction parameter
 

rfsingh81

Member
Licensed User
Longtime User
Hi, can you please guide me as to what to save from the example folder in this post into the library folder of my B4A installation so I can use it as well in my project?
 

paolofi

Member
Licensed User
Longtime User
how wait before fade completed?

HI, good job!
I tough to to launch my main page after splash screen, but the MainMenu activity start before fade is completed.
How can I do it?

Regards.

B4X:
Sub Activity_Create(FirstTime As Boolean)
   '***** This code just added to show activity items in this demo *********************************
   Activity.AddView(MyPan, 0, 0, Activity.Width, Activity.Height) : MyPan.Color = Colors.Gray     '*
   '************************************************************************************************

   'Put the block of code below as the last thing in Activity_Create
   If FirstTime Then
      MyFade.Initialize(Activity, Me, "splash.jpg", Gravity.FILL,  10000,  70, "")   
   End If

   StartActivity("MainMenu")
  
End Sub
 

dclarkchem

Member
Licensed User
Longtime User
Trying to use the fade and it works, but it does some 'funky' things with labels and bitmaps. When I don't use the fade, this problem disappears. Any ideas?
error_caused by fade.gif
 
Top