I'm working on a code-generating designer in .net winforms... it's just easier to build a windows app to write all my b4a code for me lol... I'm spending 85% time on UI stuff, 15% on actual coding...
It's pretty simple:
a) I'm creating all the android view types in my Android namespace, each one inheriting the windows version of the equivalent control. like Spinner -> combobox
b) I'm making a form that you size the same as your target resolution, each type of view on the left like the Visual studio toolbox. Drag n drop em on the "Activity" which in my case is just a plain class inheriting form.
c) Create a .ToB4aCode() function on all my classes to make the code by reading the properties, but converting them to percentages so they scale
this might need tuning, but whatever. I'll figure that out later.
d) Save the View to an xml file to open and load user interfaces.
c) Iterate through the View and all it's child controls all the way down, calling MyView.ToB4aCode() > a text file etc... as i go along. overwrite whatever is in your activity code file done. That's the plan anyways. I automate stuff for a living so this is stuff I do at work all day long anyways...
e) I'd have the same code output for my own user controls output to panels, ready to tile. I'd have to make some subs to make that easier too since I can't do simple lambda expressions like: Newview.top = Panel.Children.Sum(function(x) x.height)
I appreciate the visual designer that comes with b4a and how cool it is to see your phone doing the same thing
, but me, I hate writing TONS of lines of code for stuff i'd normally just drag and drop and be done with it in one step.
This is a typical program for me so you can see where i'm coming from:
For Each p1 In OrdObj.Products
Dim objp1 = p1.Product
Dim available_p = (From x In Available Where x.Product.IsSameProductAs(objp1)
Order By x.Warehouse,
(Not x.StockType = StockType.SPI),
(Not x.StockType = StockType.WEB)
).FirstOrDefault
If Not available_p Is Nothing Then
p1.Available.Add(available_p)
p1.AllocateProducts()
End If
Next
By the way, Erel if you see this... is there command-line commands we can use to use b4a as a compiler for apk's if we make our own code b4a editor/generator to avoid some copy/pasting?