UpdateLayout at Runtime and Create Objects at Runtime lazarus / 43-Android ---------------------------------------------------------------------- ADiV · 2018-10-06 10:09 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: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i        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: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i jButtonjTextView jCheckBoxjDBListViewjEditTextjHorizontalScroll, Created ResetAllRules;jImageBtn, Created ResetAllRules;jImageView, Created ResetAllRules;jListView, Created ResetAllRules;jPaneljProgressBar, Created ResetAllRules;jRadioButtonjScrollView, Created ResetAllRules;jView, Created ResetAllRules;jWebView, Created ResetAllRules;