Android Question How to manually invoke designer script+anchor's

JohnC

Expert
Licensed User
Longtime User
Erel,

I have my anchors and designer script all setup for an activity and it works great.

But, I would like my activity to automatically reposition all the views/controls (based on my designer scripts/anchors) when the software keypad pops up.

There used to be a Activty.RerunDesignerScript that might have worked (but didn't support anchors), but that function looks like it's no longer supported.

I notice in another thread that since RerunDesignerScript is no longer supported, you suggested to just remove all views and reload the layout which will rerun the scripts/anchors based on the new (smaller) screen size when the keyboard is displayed. But doing that would require me to first save the state/contents of all the views/controls in the current activity, then remove all views, reload in the layout and then restore the contents of all the views. This not only is visually kind of ugly, it also add programming overhead.

What would be much more useful is a way to manually initiate the script/anchor's of a layout (that has already been loaded) so it will simply reposition all the views based on my script/anchors for the new screen size, and keep the already user-entered settings/content of all the views.

Is this possible?
 

JohnC

Expert
Licensed User
Longtime User
Erel,

Please try to think about this...

When I was trying to get scrollview working for a different problem, I could have sworn that during one of my edit versions (trial and error cycles), I'm pretty positive that I got the controls/views in my layout to reposition themselves automatically when the keyboard was displayed.

What I had was about 6 views on a panel, which made up my layout. I then loaded this panel into a scrollview. I was then doing a bunch of edits/test cycles to get the scrollview working the way I needed, when I remember one of my edits made my layout reposition itself automatically when I popped up the keyboard. But since I was trying to do something else, I did not save/document the code that made this happen.

So, please think if there might be some way with using a scrollview and/or panel to get a layout to reposition itself (using anchors) without having to reload in the layout.
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Hi Erel,

But that will just reduce the "window" of the scrollview - my panel that is embedded in the scrollview still has all it's views positioned as if the activity is full-height even though the keyboard is shown.

I would like to have all my views resize/reposition as configured in my designer script and anchors when the keyboard pops up.

It's seems so inefficient to duplicate/rewrite all the code over gain in an IME_HeightChanged event (and create new code to simulate the anchors) when all my code was already written in the designer script/anchor setups.

Would it be possible to add the ability to B4A so I could programmically reinvoke the designer script/anchors for my layout without loosing the settings/contents of the views that the end user already entered?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
This is exactly the purpose of ScrollView. To allow the total layout size be larger than the actual available size.

Would it be possible to add the ability to B4A so I could programmically reinvoke the designer script/anchors for my layout without loosing the settings/contents of the views that the end user already entered?
Please start a new thread for this in the wishlist forum.
 
Upvote 0
Top