Hi All
I am attempting to port a [delete B4J] B4A application to B4J. Below is the sub that brings up a LIstView from which a file is selected. I am at a loss as to how I treat the line:
"Activity.AddView(ImportFileView, 0, 10%y, 100%x, 90%y)".
Any help appreciated.
Regards Roger
I am attempting to port a [delete B4J] B4A application to B4J. Below is the sub that brings up a LIstView from which a file is selected. I am at a loss as to how I treat the line:
"Activity.AddView(ImportFileView, 0, 10%y, 100%x, 90%y)".
Any help appreciated.
B4X:
Sub FileSelect
'Brings up ListView to allow selection of files.
'Called by BtnFiles_click
Dim temp As String
ImportFileView.Initialize("ImportFileView")
Activity.AddView(ImportFileView, 0, 10%y, 100%x, 90%y)
'Set the parameters for displaying the Items of the ListView
FileLabel = ImportFileView.SingleLineLayout.Label
'FileLabel.TextColor = Colors.White
FileLabel.Style = FileLabel.Styl&"-fx-text-fill: White;"
FileLabel.TextSize = DispInput.TextSize '14*btnscale
'FileLabel.Color = Colors.DarkGray
FileLabel.Style = FileLabel.Styl&"-fx-background-color: DarkGray;"
FileLabel.Height = 5%y 'Label height and Item Height should match to avoid gsps & overlaps
ImportFileView.SingleLineLayout.ItemHeight = ImportFileView.SingleLineLayout.Label.Height
'ImportFileView.Color = Colors.DarkGray 'ListView color matches Label color
ImportFileView.Style = ImportFileView.Styl&"-fx-background-color: DarkGray;"
ImportFileView.Clear 'Clear Listview before populating
For FileN = 0 To FileListing1.Size-1 'Builds the viewable list ImportFileView from the List "FileListing"
temp = FileListing1.Get(FileN) 'Get the value from the List
ImportFileView.AddSingleLine(temp) 'Store the value in the ListView
Next
lblTitle.Text = "Select File"
lblTitle.BringToFront
lblTitle.Height = 10%y
lblTitle.width = 100%x
lblTitle.Top = 0
ListBack.BringToFront
ListBack.Height = 10%y
ListBack.Top = 0
ListFlag = 1
End Sub
Regards Roger
Last edited: