Recent

Author Topic: LAMW OnRotate  (Read 1398 times)

Dio Affriza

  • Jr. Member
  • **
  • Posts: 87
LAMW OnRotate
« on: June 17, 2019, 09:38:41 am »
Hello, I have a problem with jEditText and jListView, when the screen is rotated, the width is the same as the previous layout width, I have used OnRotate and UpdateLayout, but it doesn't do anything.

So, if the screen started with Landscape then on the Portrait layout will become ugly, and if the screen started with Portrait then on then Landscape layout will be broken.

Any ideas?  :'(

jmpessoa

  • Hero Member
  • *****
  • Posts: 1480
Re: LAMW OnRotate
« Reply #1 on: June 17, 2019, 07:33:52 pm »

Can you put your ".pas" and  ".lfm"  files?  [or send me your project....]
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Dio Affriza

  • Jr. Member
  • **
  • Posts: 87
Re: LAMW OnRotate
« Reply #2 on: June 18, 2019, 04:46:23 am »

Can you put your ".pas" and  ".lfm"  files?  [or send me your project....]
Thank you for the reply  :), here the form files (.pas and .lfm).

TR3E

  • Jr. Member
  • **
  • Posts: 59
    • TR3E Software
Re: LAMW OnRotate
« Reply #3 on: June 20, 2019, 09:05:49 am »

Can you put your ".pas" and  ".lfm"  files?  [or send me your project....]
Thank you for the reply  :), here the form files (.pas and .lfm).

Hello, I've tried your code and the bug that I see that the "jForm" uses "ActivityMode = actEasel" when you should use "ActivityMode = actRecyclable" and thus works correctly.

Dio Affriza

  • Jr. Member
  • **
  • Posts: 87
Re: LAMW OnRotate
« Reply #4 on: June 20, 2019, 01:35:20 pm »

Can you put your ".pas" and  ".lfm"  files?  [or send me your project....]
Thank you for the reply  :), here the form files (.pas and .lfm).

Hello, I've tried your code and the bug that I see that the "jForm" uses "ActivityMode = actEasel" when you should use "ActivityMode = actRecyclable" and thus works correctly.
It makes my app freeze at startup because I am used it as a jPanel's child, the correct option is actEasel, not the actRecycleable.

jmpessoa

  • Hero Member
  • *****
  • Posts: 1480
Re: LAMW OnRotate
« Reply #5 on: June 21, 2019, 05:27:10 am »
Ok. 

In the  attachments,  there is a demo project and some pictures....

note1: avoid using multiple panels ... this causes an unbelievable screen process delay....

note2: you can use "margins" properties to improve the layout....

note3: tested in Galaxy S3 [4.3]  S4 [5.0.1] and S5 [6.0.1]
« Last Edit: June 21, 2019, 06:12:44 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Dio Affriza

  • Jr. Member
  • **
  • Posts: 87
Re: LAMW OnRotate
« Reply #6 on: June 21, 2019, 07:29:38 am »
Ok. 

In the  attachments,  there is a demo project and some pictures....

note1: avoid using multiple panels ... this causes an unbelievable screen process delay....

note2: you can use "margins" properties to improve the layout....

note3: tested in Galaxy S3 [4.3]  S4 [5.0.1] and S5 [6.0.1]
I have a problem opening the project, should I need to update LAMW?

jmpessoa

  • Hero Member
  • *****
  • Posts: 1480
Re: LAMW OnRotate
« Reply #7 on: June 21, 2019, 07:38:58 am »

Yes! LAMW is always evolving!  8-)
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Dio Affriza

  • Jr. Member
  • **
  • Posts: 87
Re: LAMW OnRotate
« Reply #8 on: June 21, 2019, 08:10:28 am »
Ah, yeah, I forgot to mention that. Can you check the demo "AppCompatNavigationDrawerDemo1", I'm replicate that thing to make the form, that's why I'm using a lot of panels previously. As the previous reply, the alignment problem may only affect atEeasel jForm.

I want to send my project files, but there are many SQL things. Can I send the file via email or private message maybe?
« Last Edit: June 21, 2019, 08:15:54 am by Dio Affriza »

jmpessoa

  • Hero Member
  • *****
  • Posts: 1480
Re: LAMW OnRotate
« Reply #9 on: June 22, 2019, 01:41:08 am »
Yes, you can use jPanel as in demo "AppCompatNavigationDrawerDemo1"....
that is  a good  technique!

But, the massive use  of jPanel is bad.... [you can see: the "actEasel" forms use only one jPanel
to encapsulates all the layout!]

A revised  "AppLayoutingDemo1" demo is here:

https://od.lk/f/Ml8xNzA2NTE2ODdf               [opendrive.com]
 
Now there is an external jPanel wrapping all the layout... so you can use it as  an "actEasel" form...

And there is, too,  some code to handling the "Landscape" and  "Portrait"  screen  state/style....

P.S About "Easel" meaning ....  8-) :D
   
                http://paintingproperly.com/best-easel-reviews/
« Last Edit: June 22, 2019, 03:29:13 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Dio Affriza

  • Jr. Member
  • **
  • Posts: 87
Re: LAMW OnRotate
« Reply #10 on: June 22, 2019, 06:32:33 am »
Yes, you can use jPanel as in demo "AppCompatNavigationDrawerDemo1"....
that is  a good  technique!

But, the massive use  of jPanel is bad.... [you can see: the "actEasel" forms use only one jPanel
to encapsulates all the layout!]

A revised  "AppLayoutingDemo1" demo is here:

https://od.lk/f/Ml8xNzA2NTE2ODdf               [opendrive.com]
 
Now there is an external jPanel wrapping all the layout... so you can use it as  an "actEasel" form...

And there is, too,  some code to handling the "Landscape" and  "Portrait"  screen  state/style....

P.S About "Easel" meaning ....  8-) :D
   
                http://paintingproperly.com/best-easel-reviews/
The form in that demo still doesn't work after I inserted into my project as an Easel (layout still broken), but yeah it's work as a recycler, but I can't embed it to the main form as a child of the panel. I'm not sure why.  %)

Maybe I will disable the form rotate for now.  :-X

Btw, thank you for the replies and tips! I appreciate that.  ;)
« Last Edit: June 22, 2019, 09:01:05 am by Dio Affriza »

jmpessoa

  • Hero Member
  • *****
  • Posts: 1480
Re: LAMW OnRotate
« Reply #11 on: June 22, 2019, 09:04:01 am »

Yes. We have some issues here....

1) I Fixed the file "amw_ide_menu_items.pas"   [LAMW folder "..../ide-tools"]
[Now the "Import LAMW Stuff..."  works,  again!]

2) About " layout still broken" in  "Easel"  model.... I will try some solution...
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Dio Affriza

  • Jr. Member
  • **
  • Posts: 87
Re: LAMW OnRotate
« Reply #12 on: June 22, 2019, 09:05:39 am »

Yes. We have some issues here....

1) I Fixed the file "amw_ide_menu_items.pas"   [LAMW folder "..../ide-tools"]
[Now the "Import LAMW Stuff..."  works,  again!]

2) About " layout still broken" in  "Easel"  model.... I will try some solution...
Btw, there's some fun stuff here.

jCustomDialog works fine in easel form. It still requires a timer to update, but yeah, it's better than crowding a single form with many components, that's why I like the Easel idea. It's only broken in jPanel, even I tried with a timer it doesn't work like jCustomDialog. :)

EDIT
There's what I've experienced until now.

1) I realized in jCustomDialog I'm using 2 edits (right and left, jEdit combined with jEdit), but the left side looks a bit bigger (at least it much looks better). Then I changed the right edit to a button (jEdit combined with jButton), it starts broken as the previous case.

2) If the button or edit I set to MatchParent, it will work completely normal. Like ThreeQuarter or NineTenth, it will be broken, except for MatchParent.

3) jPanel and ListView shared similar behavior when I tested in the jCustomDialog, it's only working with MatchToParent. For jPanel it will collapse until invisible when there's no component inside the jPanel (it's like the component is forcing the layout into WrapContent), even I set the weight HalfOfParent, ThreeQuarter, or anything except MatchParent. For jListView, it same as jPanel even there's contains items, it still collapsed, until I set into MatchParent.

Sorry for my bad English, I edited it so much. :D
« Last Edit: June 24, 2019, 04:14:11 am by Dio Affriza »

jmpessoa

  • Hero Member
  • *****
  • Posts: 1480
Re: LAMW OnRotate
« Reply #13 on: June 23, 2019, 08:47:25 am »
Quote
There's what I've experienced until now.....

Yes, we need some more code to handle HalfOfParent, ThreeQuarter.... etc...

But, but I already know!

I will notify here  after some tests....
[Now I need to sleep....  :-X ]
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Dio Affriza

  • Jr. Member
  • **
  • Posts: 87
Re: LAMW OnRotate
« Reply #14 on: June 24, 2019, 04:51:28 am »
I will notify here  after some tests....
[Now I need to sleep....  :-X ]

Thank you! I will wait for it.  ;)