Android Question B4XView create via Designer

ilan

Expert
Licensed User
the great thing with xui that we can share the code for all b4x platforms. but what i am missing a lot is the possibility to add a b4xview via designer. for simple project i am creating the design via designer and it would be nice if we could do it with xui views so we can create 1 layout and share it with all platforms.

there could be an option when we click on DESIGNER to have another Designer option like:

xuidesigner.png


and it will include only xui views that we can share with all platforms. simple views like panel, label, button, checkbox, radiobutton, textview,...

maybe there is already a possibility to add b4x views via designer, is there?

thanx
 

sorex

Expert
Licensed User

ilan

Expert
Licensed User
I've seen it once that you get a "Customview >" item when right clicking in a design and select "Add View"

I guess the Xui views fall under this category aswell?


Edit:

this reveals the trick (createdesignerview) > https://www.b4x.com/android/forum/threads/b4x-xui-creating-custom-views-with-xui.85115/
the xuiviewslibrary is indeed customvies but i am missing simple views like label, button, radiobutton, checkbox, ...

and it should be related to the running os automatically. like in ios the checkbox is a switch, etc..

so the idea is to have a seperate designer for xui views and create the same designer file that will run on all b4x platforms.
 

Erel

Administrator
Staff member
Licensed User

ilan

Expert
Licensed User
This is already possible.

All views are B4XViews. You should use the designer to create the layout. The only thing that you need to do is to change the generated type to B4XView:
B4X:
Private Button1 As B4XView 'change As Button to As B4XView
Watch the XUI video tutorial for more information: https://www.b4x.com/etp.html?vimeography_gallery=1&vimeography_video=256289568
Wow this is really cool. So when you say all views you mean all standart ciews or all views that are available in the designer?

Ps why not allow generate the view from designer to ide as b4xview?
 

sorex

Expert
Licensed User
and it should be related to the running os automatically. like in ios the checkbox is a switch, etc..
ok, I now know what you mean, Ilan.

in my opinion if you really want to have your app look identical on any platform you need to (re)create things yourself.

for example the switch on B4A used to be a square box with a led like light in it. on B4i it is that pill with circle in it.

I would go for the pill with can be done as a rounded panel including a circular label for the bullet and an extra label if you want to have that green/red coloring.
or you could create 2 images based on svg versions of the pilll but then you lose movement animations unless you seperate the sliding part of it.

Relying on the OS specific ones will alwas give you issues to have identical looks.
Not to mention that some are missing views that the other one has.
 

Erel

Administrator
Staff member
Licensed User
I would go for the pill with can be done as a rounded panel including a circular label for the bullet and an extra label if you want to have that green/red coloring.
or you could create 2 images based on svg versions of the pilll but then you lose movement animations unless you seperate the sliding part of it.
Check the very nice B4XSwitch from XUI Views.

 

DawningTruth

Active Member
Licensed User

Star-Dust

Expert
Licensed User
Worth reading my comments on that thread (https://www.b4x.com/android/forum/threads/b4x-xui-sd-xuiview.96178/#post-609055). I think that it as a mistake to use wrapped views just to save this step:

View attachment 80109

There are advantages to using native views.
The views are wrapped not only to save a step, but to have XUI view in the design.
They also add many rotation and drag and animation methods that are not available on B4Xview.

It is worth reading all the answers to get a complete view of the topic
 

DawningTruth

Active Member
Licensed User
The views are wrapped not only to save a step, but to have XUI view in the design.
They also add many rotation and drag and animation methods that are not available on B4Xview.

It is worth reading all the answers to get a complete view of the topic
Does this have a performance impact?
 
Top