I essentially turned my View Manager Class into a Relative Layout Library that had issues with B4A into an Enhanced B4A ScrollView with View Layout now. Slightly different way to initialize where you specify the size so calculations can be made. You can do what you want with the panel just as the scrollview does (I hid the old scroll functions since I had my own). You set the X/Y Padding for the Layout, Set Sizes for the Views (Remembered, so if no change when adding the next view you don't need to call it), then you add views using the add functions.
Layout flows sort of like text. When you want to place the next control on the same line call NextPos, and when you want a New Line call NextLine. It calculates the Next Positions automatically when you add views with the add functions. The panel automatically expands vertically and it has State Management (SaveState and RestoreState) for all views you give names to. Labels also can link to other views with names and Textboxes/EditTexts can navigate with Next/Prev buttons to other named views too.
02/06/2013: After completely converting my main app from using my old View Manager Class to this the final APK file is over 125KB smaller. This replaced the View Manager Class, the IME library, and a panel on each screen that the View Manager used. This does so much more than my class was able to do as well.
9 Patch images are in my View Manager Thread- http://www.b4x.com/forum/additional-libraries-classes-official-updates/19687-class-view-manager.html
Layout flows sort of like text. When you want to place the next control on the same line call NextPos, and when you want a New Line call NextLine. It calculates the Next Positions automatically when you add views with the add functions. The panel automatically expands vertically and it has State Management (SaveState and RestoreState) for all views you give names to. Labels also can link to other views with names and Textboxes/EditTexts can navigate with Next/Prev buttons to other named views too.
02/06/2013: After completely converting my main app from using my old View Manager Class to this the final APK file is over 125KB smaller. This replaced the View Manager Class, the IME library, and a panel on each screen that the View Manager used. This does so much more than my class was able to do as well.
B4X:
LL.Initialize(Activity.Height, Activity.Width, "LL")
LL.SetTheme(LL.Theme_HoloLight) ' Sets to Light theme if Holo Not Available
Activity.AddView(LL, 0, 0, Activity.Width, Activity.Height)
LL.SetPadding(4dip, 8dip)
LL.SetSize(LL.Size_WrapContent, LL.Size_WrapContent)
LL.AddLabel("", "", "Type:", 18, True, 1, Colors.Red, "Type", 0)
LL.NextPos
LL.SetSize(LL.Size_MatchParent, LL.Size_WrapContent)
LL.AddCombobox("Type", "", "Select Party Type", "Party Type", 18, Colors.Black, True, Array As String("Suspect", "Victim", "Witness", "Prisoner"), Null, LL.GetBackgroundResourceID("comboboxenabled"))
LL.NextLine
LL.SetSize(LL.Size_WrapContent, LL.Size_WrapContent)
LL.AddLabel("", "", "First Name:", 18, True, 1, Colors.Black, "FirstName", 0)
LL.NextPos
LL.SetSize(LL.Size_MatchParent, LL.Size_WrapContent)
LL.AddTextbox("FirstName", "", LL.DataType_Uppercase_Words, "", LL.ActionBtn_Next, 0, 30, 1, "", 18, Colors.Black, "First Name", Colors.Gray, Null, LL.GetBackgroundResourceID("editenabled"), "MiddleName", "")
LL.NextLine
LL.SetSize(LL.Size_WrapContent, LL.Size_WrapContent)
LL.AddLabel("", "", "Middle Name:", 18, True, 1, Colors.Black, "MiddleName", 0)
LL.NextPos
LL.SetSize(LL.Size_MatchParent, LL.Size_WrapContent)
LL.AddTextbox("MiddleName", "", LL.DataType_Uppercase_Words, "", LL.ActionBtn_Next, 0, 30, 1, "", 18, Colors.Black, "Middle Name", Colors.Gray, Null, LL.GetBackgroundResourceID("editenabled"), "LastName", "")
LL.NextLine
LL.SetSize(LL.Size_WrapContent, LL.Size_WrapContent)
LL.AddLabel("", "", "Last Name:", 18, True, 1, Colors.Black, "LastName", 0)
LL.NextPos
LL.SetSize(LL.Size_MatchParent, LL.Size_WrapContent)
LL.AddTextbox("LastName", "", LL.DataType_Uppercase_Words, "", LL.ActionBtn_Next, 0, 30, 1, "", 18, Colors.Black, "Last Name", Colors.Gray, Null, LL.GetBackgroundResourceID("editenabled"), "Alias", "")
LL.NextLine
LL.SetSize(LL.Size_WrapContent, LL.Size_WrapContent)
LL.AddLabel("", "", "Alias:", 18, True, 1, Colors.Black, "Alias", 0)
LL.NextPos
LL.SetSize(LL.Size_MatchParent, LL.Size_WrapContent)
LL.AddTextbox("Alias", "", LL.DataType_Uppercase_Words, "", LL.ActionBtn_Next, 0, 30, 1, "", 18, Colors.Black, "Alias", Colors.Gray, Null, LL.GetBackgroundResourceID("editenabled"), "", "")
LL.NextLine
9 Patch images are in my View Manager Thread- http://www.b4x.com/forum/additional-libraries-classes-official-updates/19687-class-view-manager.html
Attachments
Last edited: