Added Feb 20th, 2014 - Version 1.02
This library displays a splash screen and then removes it by fading it out, just removing it or sliding it off the screen in any direction, your choice.
This new library was based on my SplashFade class, that I had posted some time back. It requires the Phone and JavaObjects libraries provided with B4A 3.2. It will work in previous versions of B4A, provided you have these libraries in the Xtralibs or Internal library folder . Supports Android 2.2+ versions. There are many improvements above the class code as to how it works and the speed. It also now includes a callback to the Activity to let the Activity know the screen slide or fade has completed. Instead of "Left", Up, etc., pass "" for the fade.
This version also includes a new Random feature. If set to True(the last parameter), it will randomly choose to fade, slide up, down, left, etc.
The library is attached.
Special thanks to Stevel05 for helping me sort this out! This library has broader support due to his work and help. Thanks Steve!
Uses Phone & JavaObjects Libraries. NOTE: You do not need to select these in the Libraries TAB, just make sure they are in your Xtralibs folder.
Code Sample:
This library displays a splash screen and then removes it by fading it out, just removing it or sliding it off the screen in any direction, your choice.
This new library was based on my SplashFade class, that I had posted some time back. It requires the Phone and JavaObjects libraries provided with B4A 3.2. It will work in previous versions of B4A, provided you have these libraries in the Xtralibs or Internal library folder . Supports Android 2.2+ versions. There are many improvements above the class code as to how it works and the speed. It also now includes a callback to the Activity to let the Activity know the screen slide or fade has completed. Instead of "Left", Up, etc., pass "" for the fade.
This version also includes a new Random feature. If set to True(the last parameter), it will randomly choose to fade, slide up, down, left, etc.
The library is attached.
Special thanks to Stevel05 for helping me sort this out! This library has broader support due to his work and help. Thanks Steve!
Uses Phone & JavaObjects Libraries. NOTE: You do not need to select these in the Libraries TAB, just make sure they are in your Xtralibs folder.
Code Sample:
B4X:
Sub Globals
Dim MyFade As SplashFade
End Sub
Sub Activity_Create(FirstTime AsBoolean)
Activity.LoadLayout("YourLayoutFile")
'Place this line below the Activity.LoadLayout or after the last view you add by code.
MyFade.Initialize(Activity, Me, "yourimage.jpg", Gravity.FILL, 3000, 100, "Left", False)
End Sub
Sub Splash_Complete
'Add this sub if you need to know when the splash has completed
End Sub
Attachments
Last edited: