Hi guys, I think it is an important functionality to be able to change the design of the visual component in the execution time, this will allow us to adapt our applications to different situations. I'm working on it by modifying the LAMW functions "ResetAllRules" and "UpdateLayout", the latter does not work as it should. After the modifications that I have made, I have tested them and it works correctly. I attach an "UpdateLayout" test application and creation of components at run time, as well as the modifications that should be made in LAMW.
Example code:
buttonTest.PosRelativeToParent := [rpTop, rpRight];
buttonTest.UpdateLayout;
// jTextView Create at Runtime, it is necessary that this is defined as
// a local variable and you need a component for the compiler to call your .java file
if tvTest2 = nil then
begin
tvTest2 := jTextView.Create(AndroidModule1);
tvTest2.FontColor:= colBrBlack;
tvTest2.Text:= 'Anchor Test';
tvTest2.PosRelativeToParent := [rpTop, rpCenterHorizontal];
tvTest2.Init(gApp);
tvTest2.SetParentComponent(AndroidModule1);
end;
Modified "UpdateLayout" in LAMW files:
jButton
jTextView
jCheckBox
jDBListView
jEditText
jHorizontalScroll, Created ResetAllRules;
jImageBtn, Created ResetAllRules;
jImageView, Created ResetAllRules;
jListView, Created ResetAllRules;
jPanel
jProgressBar, Created ResetAllRules;
jRadioButton
jScrollView, Created ResetAllRules;
jView, Created ResetAllRules;
jWebView, Created ResetAllRules;