I'm looping through the views on a tab and when it comes to a button, it is dropping into the label logic.
v is the view. When the view coming through is a button, it is dropping into the "v is Label" code. Why?
v is the view. When the view coming through is a button, it is dropping into the "v is Label" code. Why?
B4X:
Select Case True
Case v Is TabHost
Dim th As TabHost
Dim i As Int
Dim x As Int
th = v
For i = 0 To th.TabCount - 1
th.CurrentTab = i
Dim r As Reflector
r.Target = th
Dim tabParentPanel As Panel
tabParentPanel = r.RunMethod("getTabContentView")
For x = 0 To tabParentPanel.NumberOfViews - 1
SetViewColors(tabParentPanel.GetView(x))
Next
Next
Case v Is Label
Dim lab As Label
lab = v
If lab.Tag="CAPTION" Then
lab.Color=cColors.GetBG("CAPTION")
lab.TextColor=cColors.GetFG("CAPTION")
Else
lab.Color=cColors.GetBG("LABEL")
lab.TextColor=cColors.GetFG("LABEL")
End If
Case v Is CheckBox
Dim chk As CheckBox
chk = v
chk.Color=cColors.GetBG("CHECKBOX")
chk.TextColor=cColors.GetFG("CHECKBOX")
Case v Is EditText
Dim txt As EditText
txt = v
txt.Color=cColors.GetBG("TEXTBOX")
txt.TextColor=cColors.GetFG("TEXTBOX")
Case v Is RadioButton
Dim rad As RadioButton
rad = v
rad.Color=cColors.GetBG("RADIOBUTTON")
rad.TextColor=cColors.GetFG("RADIOBUTTON")
Case v Is Button
Dim but As Button
but = v
but.Color=cColors.GetBG("BUTTON")
but.TextColor=cColors.GetFG("BUTTON")
Case v Is Spinner
Dim spi As Spinner
spi = v
spi.Color=cColors.GetBG("LISTBOX")
spi.TextColor=cColors.GetFG("LISTBOX")
Case v Is Panel
Dim pnl As Panel
pnl = v
'pnl.Color=cColors.GetBG("BACKGROUND")
For i = 0 To pnl.NumberOfViews - 1
SetViewColors(pnl.GetView(i))
Next
End Select