Recent

Author Topic: Android Module Wizard  (Read 512639 times)

jmpessoa

  • Hero Member
  • *****
  • Posts: 1433
Re: Android Module Wizard
« Reply #1155 on: August 22, 2019, 07:37:31 am »

hummmm... and do you need:

Code: Pascal  [Select]
  1. procedure TViewLogin.ViewLoginJNIPrompt(Sender: TObject);
  2. begin
  3.   jsFloatingButton1.SetPressedRippleColor(colbrCyan);
  4.   jsFloatingButton1.ImageIdentifier:= 'ic_gear_white_36dp';
  5.   edUsername.Text := '';
  6.   edPassword.Text := '';
  7. end;
  8.  

after  "ViewLogin.Init(gApp)" ???
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Dio Affriza

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #1156 on: August 22, 2019, 07:50:33 am »

hummmm... and do you need:

after  "ViewLogin.Init(gApp)" ???
No, it's just a sample what I'm doing in TViewLogin's JNI_Prompt. Because of that design time problem, I am tired to clear edUsername.Text every time I open project so I add that into JNI_Promt. After removing them it's still same, I can't init TViewLogin or any actEasel forms.

Dio Affriza

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #1157 on: August 22, 2019, 07:55:37 am »
Btw, I revert into LAMW from 02 August 2019, and actEasel... It works again.

jmpessoa

  • Hero Member
  • *****
  • Posts: 1433
Re: Android Module Wizard
« Reply #1158 on: August 22, 2019, 08:05:15 am »
Quote
if not Assigned(ViewLogin) then
  begin
    gApp.CreateForm(TViewLogin, ViewLogin);
    ViewLogin.Init(gApp); // <- Don't show actEasel forms...
    ViewLogin.pnView.SetViewParent(pnView); // <- here you are.
  end;

From demo, there are some more code

Code: Pascal  [Select]
  1.     if AndroidModule2 = nil then
  2.     begin
  3.        gApp.CreateForm(TAndroidModule2, AndroidModule2); //hint: property "ActiveMode = actEasel" dont "show"  form
  4.        AndroidModule2.Init(gApp);   //fire OnJNIPrompt ...
  5.        AndroidModule2.jPanel1.Parent:= Self.jPanel2;   // <<-need to handle LayoutParamWidth/LayoutParamHeight rotate      
  6.        AndroidModule2.jPanel1.SetViewParent(Self.jPanel2.View); //add scene 2  to Self.jPanel2
  7.     end;
  8.     ............................
  9.     AndroidModule2.jPanel1.BringToFront();     // << --- What about??
  10.  

Quote
    AndroidModule2.jPanel1.BringToFront();     // << --- What about??

« Last Edit: August 22, 2019, 08:08:31 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Dio Affriza

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #1159 on: August 22, 2019, 08:11:02 am »
Quote
    AndroidModule2.jPanel1.BringToFront();     // << --- What about??
It's same, it will start crash on this line "AndroidModule2.Init(gApp)".

jmpessoa

  • Hero Member
  • *****
  • Posts: 1433
Re: Android Module Wizard
« Reply #1160 on: August 22, 2019, 08:22:00 am »
 :-[
 
I found a bug!   [life time: a day ago....]

Please,  update "jEditText.java" template from the git!

[folder "................\android_wizard\smartdesigner\java"]

« Last Edit: August 22, 2019, 08:41:53 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Dio Affriza

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #1161 on: August 22, 2019, 08:25:31 am »
Thank you...  ;)

I will test it at night, I'll report it later.

Dio Affriza

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #1162 on: August 22, 2019, 11:16:54 am »
I just tested. Seems the actEasel in the "AppCompatNavigationDrawerDemo1" still doesn't work. I don't know why.
Any clues?  :o


Video: https://youtu.be/row4yF2qUf4
My Phone: Sony Xperia X Performance, SOV33; Android 8.0.0.
« Last Edit: August 23, 2019, 04:15:17 am by Dio Affriza »

jmpessoa

  • Hero Member
  • *****
  • Posts: 1433
Re: Android Module Wizard
« Reply #1163 on: August 23, 2019, 02:17:10 am »

Sorry...

Here,  I can run "AppCompatNavigationDrawerDemo1" [and "AppAnimationDemo1"]  on
all my  real  devices..... Android 4.3, Android 5.0.1 and  Android 6.0.1

Maybe, you need some "Run" --> "Clean up and  Build" or even a clean  packages re-install....
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Dio Affriza

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #1164 on: August 24, 2019, 05:24:09 am »
I fixed it.

android_bridges/Laz_And_Controls.pas, Line: 11830 in jPanel.Init(refApp: jApp);

Code: Pascal  [Select]
  1. if not FInitialized then
  2.   begin
  3.    if jForm(Self.Owner).ActivityMode <> actEasel then
  4.    begin
  5.      if FAnimationMode <> animNone then //default
  6.        jPanel_SetAnimationMode(FjEnv, FjObject, Ord(FAnimationMode));
  7.  
  8.      if FAnimationDurationIn <> 1500 then //default
  9.        jPanel_SetAnimationDurationIn(FjEnv, FjObject, FAnimationDurationIn);
  10.      // Do not run animation mode in actEasel!!
  11.      // It causing an apocalyptic crash in Android 8.0.0 (tested on Xperia SOV33)
  12.    end;  
  13.  
« Last Edit: August 24, 2019, 05:36:45 am by Dio Affriza »

jmpessoa

  • Hero Member
  • *****
  • Posts: 1433
Re: Android Module Wizard
« Reply #1165 on: August 24, 2019, 06:47:36 am »

Nice!

Quote
Do not use animation mode in actEasel....

So,  the jPanel animation on "BringToFront" will be lost?
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Dio Affriza

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #1166 on: August 24, 2019, 06:56:06 am »
So,  the jPanel animation on "BringToFront" will be lost?
I think so. I don't know what is wrong with that in the Android 8.0.0, maybe we should disable that for now until we know what the problem, I'm not pretty sure if it caused by Java template (maybe?), because I don't understand Java when I tried to inspect the codes.  :D

jmpessoa

  • Hero Member
  • *****
  • Posts: 1433
Re: Android Module Wizard
« Reply #1167 on: August 24, 2019, 07:13:31 am »
Quote
I don't know what is wrong with that in the Android 8.0.0...

Ok. I will do some test on Android 8.0.0 !!!

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

Dio Affriza

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #1168 on: August 24, 2019, 07:43:23 am »
(edit)
Sorry... There's something wrong with my LAMW installation.  :-[
Now, I can't compile my project after deleting my old LAMW installation. I'll try to reinstall Lazarus.
It's maybe the culprit of why LAMW copying the wrong Java template, even after I've installed newer LAMW. It's caused by different path of an old and new installation.

It's says Fatal: [EFOpenError] Failed: Unable to open file "my_old_path\android_wizard\smartdesigner\java\Controls.java"
« Last Edit: August 24, 2019, 08:06:42 am by Dio Affriza »

jmpessoa

  • Hero Member
  • *****
  • Posts: 1433
Re: Android Module Wizard
« Reply #1169 on: August 24, 2019, 08:06:29 am »

Quote
I think there's something is wrong....

Yes!  your jPanel.java  is outdated!!!!!

This means that you have only partially updated to the "LAMW 0.8.5" !!!

You can do a  "diff" from the "jPanel.java" on git:

https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/android_wizard/smartdesigner/java/jPanel.java
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard