Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder)
DoEvents
If parser.Parents.IndexOf("item") > -1 Then
If Name = "sdImg" Then
DoEvents
sdImg = Text.ToString
Else If Name = "title" Then
DoEvents
Title = Text.ToString
Else If Name = "streamUrl" Then
DoEvents
streamUrl = Text.ToString 'Link = Text.ToString
Else If Name = "synopsis" Then
DoEvents
synopsis = Text.ToString
Else If Name = "genres" Then
DoEvents
genres = Text.ToString
End If
End If
fullDes = "Genre: "&genres&", Description: "&synopsis
If File.Exists(File.DirAssets, sdImg)= False Then
sdImg = "androidicon.png"
End If
LV1.ScrollingBackgroundColor = Colors.Transparent
LV1.FastScrollEnabled = True
If Name = "item" Then
'File.DirAssets for AssetsDir, ShareSettingsOnly.theDIR for DirExternal/Internal
Try
If File.Exists(File.DirAssets, sdImg) Then
'Log("assets")
LV1.TwoLinesAndBitmap.ItemHeight = 100dip
LV1.TwoLinesAndBitmap.ImageView.Height = 40dip
LV1.TwoLinesAndBitmap.ImageView.Width = 40dip
LV1.TwoLinesAndBitmap.Label.Left = LV1.TwoLinesAndBitmap.ImageView.Width + 6dip
LV1.TwoLinesAndBitmap.Label.Height = 20dip
LV1.TwoLinesAndBitmap.Label.Gravity = Gravity.NO_GRAVITY
LV1.TwoLinesAndBitmap.Label.TextSize = 16
DoEvents
LV1.TwoLinesAndBitmap.SecondLabel.Top = LV1.TwoLinesAndBitmap.ImageView.Height +2dip
LV1.TwoLinesAndBitmap.SecondLabel.Left = 0%y
LV1.TwoLinesAndBitmap.SecondLabel.Height = 50dip
LV1.TwoLinesAndBitmap.SecondLabel.Gravity = Gravity.NO_GRAVITY
LV1.TwoLinesAndBitmap.SecondLabel.TextSize = 14
LV1.AddTwoLinesAndBitmap2(Title, fullDes, LoadBitmap(File.DirAssets, sdImg),streamUrl)
DoEvents
Else
'Log("theDir")
' LV1.TwoLinesAndBitmap.SecondLabel.Height = 60dip
LV1.AddTwoLinesAndBitmap2(Title, fullDes, LoadBitmap(ShareSettingsOnly.theDIR, sdImg),streamUrl)
DoEvents
End If
Catch
'This should only trigger if both fail
Log("Error in retrieving img file: "&LastException.Message& "Image: " &sdImg)
End Try
End If
End Sub