Recent

Author Topic: LAMW: Splash Screen  (Read 3692 times)

c4p

  • Full Member
  • ***
  • Posts: 157
LAMW: Splash Screen
« on: March 30, 2018, 10:26:51 pm »
Shame there isn't an option to add a splash screen to Android app like in Delphi as my app would really benefit from one.
Manually create a splash screen?  :)
Lazarus 2.0.12 r64642/FPC 3.2.0 LAMW v0.8.6.4 on Windows 10+Linux Mint 21.2, projects mainly built using AppCompat and Gradle v8.5

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: LAMW: Splash Screen
« Reply #1 on: March 30, 2018, 10:57:18 pm »
Hi c4p!

Yes,  you can add a splash screen!

Look for "AppDemo1" and the

new "AppDBGridViewDemo1" [by Martin Lowry]  in LAMW 0.8  preview!

LAMW 0.8 preview is here:  https://od.lk/f/Ml8xNTU4Mjc1NDVf  [Please,  test it!!!]
demos preview is here:       https://od.lk/f/Ml8xNTU3ODQyMDlf

Ok. There is some trick...

1) You need set your "splash" form property "ActivityMode= actSplash"
2) You need edit "*.lpi" ... add a  new  line in "CustomData"  like:
    <CustomData Count="????">
      <Item? Name="StartModule" Value="MyAndroidModuleSplash"/>
    </CustomData>

3) Maybe, you need edit ".lpr" ,  too!

here:
Code: [Select]
procedure pAppOnCreate(PEnv: PJNIEnv; this: JObject; context: JObject;
  layout: JObject; intent: JObject); cdecl;
begin
  Java_Event_pAppOnCreate(PEnv, this, context, layout, intent);
    MyAndroidModuleSplash.Init(gApp);
end;

and here:
Code: [Select]
....
.....
gApp.CreateForm(TMyAndroidModuleSplash, MyAndroidModuleSplash);

« Last Edit: April 01, 2018, 08:31:52 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

c4p

  • Full Member
  • ***
  • Posts: 157
Re: LAMW: Splash Screen
« Reply #2 on: April 01, 2018, 10:23:07 am »
Fantastic!
Can't believe I missed this.
I will try it  :D
« Last Edit: April 01, 2018, 11:16:58 am by c4p »
Lazarus 2.0.12 r64642/FPC 3.2.0 LAMW v0.8.6.4 on Windows 10+Linux Mint 21.2, projects mainly built using AppCompat and Gradle v8.5

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: LAMW: Splash Screen
« Reply #3 on: April 01, 2018, 08:30:41 pm »

Yes,  and LAMW 0.8 has improved support to make splash!

Only change  here:
Quote
    <CustomData Count="????">
      <Item? Name="StartModule" Value="MyAndroidModuleSplash"/>
    </CustomData>

OR

Change/rename the splash form property name.... [after change main form property name]

Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

c4p

  • Full Member
  • ***
  • Posts: 157
Re: LAMW: Splash Screen
« Reply #4 on: April 02, 2018, 05:24:22 pm »
Cool, thanks!  :)
Lazarus 2.0.12 r64642/FPC 3.2.0 LAMW v0.8.6.4 on Windows 10+Linux Mint 21.2, projects mainly built using AppCompat and Gradle v8.5

 

TinyPortal © 2005-2018