Android Question how to build dynamic layout ?

peacemaker

Expert
Licensed User
Longtime User
HI, All

Is there for this moment a way to build the dynamic layout like below ?

1) scrolling up\down container on the activity
2) container loads variable qty of the item panels
3) Item panel contains variable qty of labels, images, buttons, checkboxes... And maybe different set of the views (!), also changeable.
4) Each view, sure, must be editable any time, updated...

I already used such in my app - load a static .bal layout into dynamically created panels, placed into the Scrollview, but ...
1) just simple set of views on each panel, the same
2) updating each view is ... hard, need to recongnize each before trying to update.

Maybe some "framework", engine exists already ?
 

KMatle

Expert
Licensed User
Longtime User
Another one: https://www.b4x.com/android/forum/t...eved-from-a-database-php-mysql.48705/#content

Here I get "forms" from a database (could be a file, too). I find it better to learn how it works before using a library (you can do that later).

Basics: You can add/update/remove views at any time - just play with it in a simple app. I never use the designer - I add all views at the start.

For a test create a new app and play:

1. add a panel to the activity (activity is the parent)
2. add a label and a button to that panel (here the panel is the parent of the label)
3. add another panel
4. add some edittexts
5. set panel 1 to visible=true, panel 2 to visible=false (and vice versa for a test)

Handling views:

Get them with "getallviews" or better - store them in a list. Use x.tag to identify each view (x.tag="xxxx")
 
Upvote 0
Top