'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize(a As activity)
Dim nd As CustomDialog
Dim lblFpath As Label
lblFpath.Initialize("")
lblFpath.Text = "test"
Dim p As Panel
p.Initialize("")
nd.AddView(p,0,0,100%x,100%y)
p.AddView(lblFpath,0,0,100%x,20%y)
Dim edt_Author As MLComboBox
edt_Author.Initialize(a, Me, p, "edtAuthor")
edt_Author.DropColor(Colors.Red) 'uncomment these to test colors and text size
edt_Author.DropTextColor(Colors.White)
'edt_Author.DropTextSize(18)
edt_Author.AddItem("artist 1", Null)
edt_Author.AddItem("artist 2", Null)
edt_Author.AddItem("artist 3", Null)
edt_Author.AddItem("artist 4", Null)
edt_Author.AddItem("artist 5", Null)
edt_Author.AddItem("artist 6", Null)
edt_Author.AddItem("artist 7", Null)
p.AddView(edt_Author.AsView,0,25%y,60%x,150dip) ' these values don't work so the porition is set below
edt_Author.setLeft(0)
edt_Author.setTop(25%y)
edt_Author.setWidth(60%x)
edt_Author.setHeight(50dip)
Dim edt_song As EditText
edt_song.Initialize("")
edt_song.Hint = "Song Name"
edt_song.HintColor = Colors.Gray
edt_song.Text = "test"
edt_song.ForceDoneButton = True
edt_song.SingleLine = True
p.AddView(edt_song,0,25%y+100dip,100%x,60dip)
Dim ret As Int
ret = nd.Show("Enter artist and song names","Resolve","Cancel","",Null)
If (ret = DialogResponse.POSITIVE) Then
Log("Choose to resolve: artist=" & edt_Author.Text & " song:" & edt_song.Text)
Log("Artist text is: " & edt_Author.Text)
Else
Log("Choose to cancel")
End If
End Sub
Sub edtAuthor_ItemClick(Position As Int, Value As String)
Log("item click:" & Value)
End Sub