luke2012 Well-Known Member Licensed User Longtime User Aug 19, 2020 #1 Hi all, I'm testing a very cool (and very useful) tutorial named "B4XPages Splash Screen" by @Erel [B4X] [B4XPages] Splash Screen B4A, B4i and B4J splash screen implementation. The implementation is different in each platform. 1. Don't miss the manifest editor code in B4A. 2. Don't use %y in the code. Use Root.Height instead (you can use %y in the designer script). www.b4x.com POSSIBLE BUG ? If I install and run it as it is (without changes) I see the splash with the B4X logo. After the logo disappear I see a white empty screen with a text on top that says "MainPage". If I check the "B4XMainPage" code I see: Code: Copy Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 Wait For (ShowSplashScreen) Complete (Unused As Boolean) Root.LoadLayout("MainPage") 'don't use %y in your code! Use Root.Height instead. End Sub The problem is that Root.LoadLayout("MainPage") should load the "MainPage.bal" layout file that contains a panel, a button and a label. Instead I see a white empty screen. AFTER MY CODE CHANGE... Code: Copy Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 'Wait For (ShowSplashScreen) Complete (Unused As Boolean) Root.LoadLayout("MainPage") 'don't use %y in your code! Use Root.Height instead. End Sub If I comment the "Wait For (ShowSplashScreen)..." all work as expected. The MainPage.bal is loaded. and I can see the grey Button with "Click" text and the belove label text. So the solution is to disable (comment) the code belove ? Code: Copy Wait For (ShowSplashScreen) Complete (Unused As Boolean) P.S. Another thing: how to support also animated images instead of static logo ? Thanks in advance for your help! Luca.
Hi all, I'm testing a very cool (and very useful) tutorial named "B4XPages Splash Screen" by @Erel [B4X] [B4XPages] Splash Screen B4A, B4i and B4J splash screen implementation. The implementation is different in each platform. 1. Don't miss the manifest editor code in B4A. 2. Don't use %y in the code. Use Root.Height instead (you can use %y in the designer script). www.b4x.com POSSIBLE BUG ? If I install and run it as it is (without changes) I see the splash with the B4X logo. After the logo disappear I see a white empty screen with a text on top that says "MainPage". If I check the "B4XMainPage" code I see: Code: Copy Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 Wait For (ShowSplashScreen) Complete (Unused As Boolean) Root.LoadLayout("MainPage") 'don't use %y in your code! Use Root.Height instead. End Sub The problem is that Root.LoadLayout("MainPage") should load the "MainPage.bal" layout file that contains a panel, a button and a label. Instead I see a white empty screen. AFTER MY CODE CHANGE... Code: Copy Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 'Wait For (ShowSplashScreen) Complete (Unused As Boolean) Root.LoadLayout("MainPage") 'don't use %y in your code! Use Root.Height instead. End Sub If I comment the "Wait For (ShowSplashScreen)..." all work as expected. The MainPage.bal is loaded. and I can see the grey Button with "Click" text and the belove label text. So the solution is to disable (comment) the code belove ? Code: Copy Wait For (ShowSplashScreen) Complete (Unused As Boolean) P.S. Another thing: how to support also animated images instead of static logo ? Thanks in advance for your help! Luca.
Erel B4X founder Staff member Licensed User Longtime User Aug 20, 2020 #2 luke2012 said: Another thing: how to support also animated images instead of static logo ? Click to expand... Use B4XGifView or APNG. There was indeed a bug. It is fixed: https://www.b4x.com/android/forum/threads/b4x-b4xpages-splash-screen.120851/ Upvote 0
luke2012 said: Another thing: how to support also animated images instead of static logo ? Click to expand... Use B4XGifView or APNG. There was indeed a bug. It is fixed: https://www.b4x.com/android/forum/threads/b4x-b4xpages-splash-screen.120851/
udg Expert Licensed User Longtime User Aug 20, 2020 #3 @Erel: it seems you forgot to publish the updated code Upvote 0
luke2012 Well-Known Member Licensed User Longtime User Aug 20, 2020 #4 Erel said: Use B4XGifView or APNG. There was indeed a bug. It is fixed: https://www.b4x.com/android/forum/threads/b4x-b4xpages-splash-screen.120851/ Click to expand... Thank you Erel! I applied the fix. One more thing Running the app on Android, now between the splash screen (with logo) and the layout loaded (see my code within B4XMainPage) I see an empty white screen named "MainPage" that appears. Is it possible (somewhere within the splash code) to hide it? Code: Copy Private Sub B4XPage_Created (Root1 As B4XView) 'B4XPages Root = Root1 Wait For (ShowSplashScreen) Complete (Unused As Boolean) Root.LoadLayout("home") end sub Upvote 0
Erel said: Use B4XGifView or APNG. There was indeed a bug. It is fixed: https://www.b4x.com/android/forum/threads/b4x-b4xpages-splash-screen.120851/ Click to expand... Thank you Erel! I applied the fix. One more thing Running the app on Android, now between the splash screen (with logo) and the layout loaded (see my code within B4XMainPage) I see an empty white screen named "MainPage" that appears. Is it possible (somewhere within the splash code) to hide it? Code: Copy Private Sub B4XPage_Created (Root1 As B4XView) 'B4XPages Root = Root1 Wait For (ShowSplashScreen) Complete (Unused As Boolean) Root.LoadLayout("home") end sub
luke2012 Well-Known Member Licensed User Longtime User Aug 20, 2020 #5 Erel said: Use B4XGifView or APNG. There was indeed a bug. It is fixed: https://www.b4x.com/android/forum/threads/b4x-b4xpages-splash-screen.120851/ Click to expand... About " Use B4XGifView": So it could be integrated within the B4XPages Splash screen project without problems ? Upvote 0
Erel said: Use B4XGifView or APNG. There was indeed a bug. It is fixed: https://www.b4x.com/android/forum/threads/b4x-b4xpages-splash-screen.120851/ Click to expand... About " Use B4XGifView": So it could be integrated within the B4XPages Splash screen project without problems ?
Erel B4X founder Staff member Licensed User Longtime User Aug 20, 2020 #6 luke2012 said: About " Use B4XGifView": So it could be integrated within the B4XPages Splash screen project without problems ? Click to expand... Yes. luke2012 said: Running the app on Android, now between the splash screen (with logo) and the layout loaded (see my code within B4XMainPage) I see an empty white screen named "MainPage" that appears. Is it possible (somewhere within the splash code) to hide it? Click to expand... There is a delicate issue here and your device behaves different than most devices, so you need to wait the full 500ms until the layout is loaded. You can improve the situation by loading something before the Wait For. Just remember that the layout height might not be accurate at this point. You can for example keep the splash screen background color and remove it after the Wait For line. Upvote 0
luke2012 said: About " Use B4XGifView": So it could be integrated within the B4XPages Splash screen project without problems ? Click to expand... Yes. luke2012 said: Running the app on Android, now between the splash screen (with logo) and the layout loaded (see my code within B4XMainPage) I see an empty white screen named "MainPage" that appears. Is it possible (somewhere within the splash code) to hide it? Click to expand... There is a delicate issue here and your device behaves different than most devices, so you need to wait the full 500ms until the layout is loaded. You can improve the situation by loading something before the Wait For. Just remember that the layout height might not be accurate at this point. You can for example keep the splash screen background color and remove it after the Wait For line.