Private Sub AddSpinner()
Dim dblNextTop As Double
PopupPanel.Initialize("ScrollView")
PopupPanel.Color = Colors.ARGB( 121, 0, 0, 0 )
PopupPanel.Elevation = 20dip
pnlMain.AddView( PopupPanel, 0, 0, 100%x, 100%y)
Dim lbl As Label
lbl.Initialize("")
lbl.Color = Colors.RGB(250,250,250)
lbl.Text = "Title"
lbl.TextColor = Colors.Black
lbl.TextSize = 18
lbl.Gravity = Gravity.CENTER
lbl.Typeface = Typeface.DEFAULT_BOLD
PopupPanel.AddView( lbl, 10%x, 20%y, 80%X, 8%y)
dblNextTop = lbl.Top + lbl.Height
Dim btnBackground As Button
btnBackground.Initialize ("")
btnBackground.Tag = "btnBackground"
btnBackground.Color = Colors.Gray
PopupPanel.AddView( btnBackground, 10%x, dblNextTop, 80%x, 30%y)
'*********** How to duplicate the issue
'**** if Visible = true and SetApplicationAttribute(android:theme, "@android:style/Theme.Holo") then no problem
'**** if Visible = true and CreateResourceFromFile(Macro, Themes.LightTheme), then scrollview doesn't move in front of the button, I tried sendtoback doesn't make a difference
btnBackground.Visible = True
Dim svSpinnerPanel As ScrollView
svSpinnerPanel.Initialize2(30%y, "svSpinnerPanel")
svSpinnerPanel.Panel.Height = 0
PopupPanel.AddView( svSpinnerPanel, 10%x, dblNextTop, 80%x, 30%y)
Dim PanelColors(4) As Long = Array As Long ( Colors.blue, Colors.Green, Colors.Red, Colors.Yellow)
For iPanelIndex = 0 To 3
Dim pp1 As Panel
pp1.Initialize("Permission" )
pp1.Tag = "pnl_" & iPanelIndex
pp1.Color = PanelColors( iPanelIndex)
svSpinnerPanel.Panel.AddView(pp1, 0, iPanelIndex * svSpinnerPanel.Height/4, 100%x, svSpinnerPanel.Height/4)
pp1.BringToFront
svSpinnerPanel.Panel.Height = svSpinnerPanel.Panel.Height + svSpinnerPanel.Height/4
' AddSpinnerPanelToScrollView( svSpinnerPanel, iPanelIndex )
Next
svSpinnerPanel.Panel.Height = svSpinnerPanel.Panel.Height + 10%y
dblNextTop = btnBackground.Top + btnBackground.Height
Dim btnDone As Button
btnDone.Initialize ("btnDone")
btnDone.Tag = "btnDone"
PopupPanel.AddView( btnDone, 10%x, dblNextTop, 80%x, 10%y)
btnDone.Color = Colors.White
btnDone.Enabled = True
btnDone.Text = "Done"
btnDone.TextColor = Colors.Green
btnDone.BringToFront
End Sub
Private Sub btnDone_Click
PopupPanel.RemoveAllViews
PopupPanel.RemoveView
End Sub