Java Question Showing controls in designer?

keirS

Well-Known Member
Licensed User
Longtime User
I think I already know the answer to this (which is no) but I thought I would ask anyway. I will be creating a lot of custom controls probably about 20 or so. Is there anyway these can interact with the Designer?
 

keirS

Well-Known Member
Licensed User
Longtime User
I am sub classing:

EditText
Spinner
Label
Panel
CheckBox
RadioButton
Toggle Button

What I am doing is creating a set of controls which are data bound. Like Access, Visual FoxPro, VB etc. I know this is possible to do in B4A without a Lib as I already do it. But shoving every thing into the tag property makes the code very difficult to understand and to manage. Its also not very intuitive.
 

warwound

Expert
Licensed User
Longtime User
I seem to remember reading on the forum that the deisgner is powered by an APK that contains all the default B4A views.

So no way to add a custom View / library to the designer.

I meant to ask if the source code for that APK was available and if so whether we could produce a custom APK that the designer would use - thus enabling us to add custom Views using the designer.
Not a very practical solution - but if possible then it'd enable an individual user to customise the designer with their own Views.

Martin.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The designer source code is not available. By itself it will not be enough as the IDE also needs to support the new views.

I know this is possible to do in B4A without a Lib as I already do it. But shoving every thing into the tag property makes the code very difficult to understand and to manage. Its also not very intuitive.

Consider creating a class for each such view. The class will have a reference to the original view and will allow you to add the required logic. Composition is almost always preferable over inheritance.
 

keirS

Well-Known Member
Licensed User
Longtime User
I will need to think about that. I will definitely not be just chucking all the logic required in to the subclass. I want build something that can be extended to be easily serializable and maybe turned into a light weight ORM framework in the future.
 
Top