In these two months I've started to study ABMaterial and really I noticed that is well designed. One of the tricky questions for a developer used to build B4A/B4J forms is the flexible concept of a web form.
Designing a well-responsive form is not so easy. On the other side a well refined look is very important to give a professional feel to an app, so some graphic details are essential.
From my trials I show these three arguments:
I used as base Master Template Project, adding some lines:
As you can see:
Is there someone that could help me?
thanks
Roberto
p.s. : often I have found on the forum samples that shows the lines to build the controls, but not the themes lines: I think that should be important to show also themes details
Designing a well-responsive form is not so easy. On the other side a well refined look is very important to give a professional feel to an app, so some graphic details are essential.
From my trials I show these three arguments:
- Sizing of a DatePicker
- Sizing of a Combo
- Put two labels to the right of the same row
I used as base Master Template Project, adding some lines:
B4X:
Sub ConnectPage()
' See the ABMPageTemplate for the tutorial!
ABMShared.ConnectNavigationBar(page)
' add header
page.Cell(1,1).AddComponent(ABMShared.BuildLabel(page, "hdr1", "About / Help Landing Page", ABM.SIZE_H3, "",0,""))
page.Cell(3,1).AddComponent(ABMShared.BuildLabel(page, "hdr2", "Not much to see here... Click on 'Template Page' in Navigation Bar!", ABM.SIZE_H5, "",0,""))
page.Cell(5,1).AddComponent(ABMShared.BuildLabel(page, "hdr3", "NOTE: Currently, Only About and Template In The Nav Bar Expose Any Pages!", ABM.SIZE_H5, "lbltheme2",0,""))
'test
Dim dpDate As ABMDateTimePicker
Dim NewDate As Long = DateTime.now
dpDate.Initializewithsize(page,"date",ABM.DATETIMEPICKER_TYPE_DATE,NewDate,"MyDate",0,0,0,30,30,30,"")
dpDate.CancelText = "ignora"
dpDate.ClearText = "reset"
dpDate.PickText = "ok"
dpDate.TodayText = "oggi"
dpDate.Language = "it"
dpDate.ReturnDateFormat = "DD/MM/YYYY"
dpDate.ReturnTimeFormat = ""
dpDate.FirstDayOfWeek = 0
page.Cell(6,1).AddComponent(dpDate)
Dim combo1 As ABMCombo
combo1.Initializewithsize(page,"combo","MyCombo",250,0,0,0,300,300,300,"")
combo1.AddItem("elem1","first element",BuildLb(page,"lbelem1","abc"))
combo1.AddItem("elem2","1234567890 1234567890 1234567890 1234567890 1234567890",BuildLb(page,"lbelem2","1234567890 1234567890 1234567890 1234567890 1234567890 "))
page.Cell(6,2).AddComponent(combo1)
Dim lbr1 As ABMLabel = BuildLb(page,"lbr1","lb 1")
Dim lbr2 As ABMLabel = BuildLb(page,"lbr2","lb 2")
page.Cell(7,1).AddComponent(lbr1)
page.Cell(7,2).AddComponent(lbr2)
page.Refresh ' IMPORTANT
' NEW, because we use ShowLoaderType=ABM.LOADER_TYPE_MANUAL
page.FinishedLoading 'IMPORTANT
End Sub
public Sub BuildLb(apage As ABMPage, aIdField As String, aTitle As String) As ABMLabel
Dim label1 As ABMLabel
label1.Initialize(apage,aIdField,aTitle,ABM.SIZE_PARAGRAPH,False,"")
Return label1
End Sub
public Sub BuildPage()
' initialize the theme
BuildTheme
page.InitializeWithTheme(Name, "/ws/" & ABMShared.AppName & "/" & Name, False, ABMShared.SessionMaxInactiveIntervalSeconds, theme)
' show the spinning cicles while page is loading....
page.ShowLoader=True
page.PageHTMLName = "index.html"
page.PageTitle = "" ' You can also set this as a property in "ABMShared.BuildNavigationBar" below...
' Google SEO stuff...
page.PageDescription = ""
page.PageKeywords = ""
page.PageSiteMapPriority = ""
page.PageSiteMapFrequency = ABM.SITEMAP_FREQ_YEARLY
' faint green dot (on title bar) when connected - red when not connected with web socket
page.ShowConnectedIndicator = True
ABMShared.BuildNavigationBar(page, "My {B} About Page {/B} ", "../images/logo.png", "", "", "")
page.AddRowsM( 5, True, 0, 10, "").AddCellsOSMP( 1, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, "")
page.AddRows(1,True,"").AddCellsOSMP(2,0,0,0,6,6,6,0,0,0,0,"") '6=DatePicker and combo
page.AddRows(1,True,"").AddCellsOSMP(2,8,8,8,2,2,2,0,0,0,0,"") '7=two labels right
'IMPORTANT - Build the Grid before you start adding components ( with ConnectPage()!!! )
page.BuildGrid
End Sub
- the DatePicker underline is longer than needed by the content of the field (the date)
- the Combo shows only 20 crts (the element contains 40 crts
- the two labels should be on the same line, but don't
Is there someone that could help me?
thanks
Roberto
p.s. : often I have found on the forum samples that shows the lines to build the controls, but not the themes lines: I think that should be important to show also themes details