Sub PP_Format_Layout(MyActivity As Activity,sTheme As String)
Dim lbl As Label
Dim txt As EditText
Dim btn As Button
Dim sp As Spinner
Dim pnl As Panel
Dim Act As Activity
Dim ilblred,ilblgreen,ilblblue,ilbltitlered,ilbltitlegreen,ilbltitleblue As Int
Dim ibtnred,ibtngreen,ibtnblue As Int
Dim itxtred,itxtgreen,itxtblue As Int
Dim iActivityred,iActivitygreen,iActivityblue As Int
'pink
If sTheme="pink_green" Then
iActivityred=232:iActivitygreen=232:iActivityblue=216 'lightest gray
ilbltitlered=255:ilbltitlegreen=20:ilbltitleblue=147 'pink
ilblred=232:ilblgreen=232:ilblblue=216 'lightest gray
itxtred=216:itxtgreen=216:itxtblue=216 'dark gray
ibtnred=146:ibtngreen=208:ibtnblue=80 'green
End If
If sTheme="brown_blue" Then
iActivityred=255:iActivitygreen=20:iActivityblue=147
ilbltitlered=255:ilbltitlegreen=20:ilbltitleblue=147
ilblred=255:ilblgreen=20:ilblblue=147
itxtred=255:itxtgreen=20:itxtblue=147
ibtnred=255:ibtngreen=20:ibtnblue=147
End If
If sTheme="voilet_green" Then
iActivityred=255:iActivitygreen=20:iActivityblue=147
ilbltitlered=255:ilbltitlegreen=20:ilbltitleblue=147
ilblred=255:ilblgreen=20:ilblblue=147
itxtred=255:itxtgreen=20:itxtblue=147
ibtnred=255:ibtngreen=20:ibtnblue=147
End If
MyActivity.Color=Colors.ARGB(255,iActivityred,iActivitygreen,iActivityblue)
Dim n As Int
For Each v As View In MyActivity.GetAllViewsRecursive
n=n+1
If v Is Activity Then
Act=v
Act.Color=Colors.ARGB(255,iActivityred,iActivitygreen,iActivityblue)
End If
If v Is Panel Then
pnl=v
pnl.Color=Colors.ARGB(255,iActivityred,iActivitygreen,iActivityblue)
End If
If v Is Label Then
lbl=v
If StringIsNull(lbl.Tag)=False Then
If lbl.Tag="title" Then
lbl.Color=Colors.ARGB(255,ilbltitlered,ilbltitlegreen,ilbltitleblue)
lbl.TextColor=Colors.white
lbl.TextSize=18
Else
If lbl.Text="Name" Then
n=2
End If
lbl.Color=Colors.ARGB(255,ilblred,ilblgreen,ilblblue)
lbl.TextColor=Colors.Gray
lbl.TextSize=15
End If
End If
End If
If v Is Button Then
btn=v
If StringIsNull(btn.tag)=False Then
Dim tmpTag As String=btn.Tag
If tmpTag.Contains("btn") Then
btn.Color=Colors.ARGB(255,ibtnred,ibtngreen,ibtnblue)
btn.TextColor=Colors.White
btn.TextSize=16
End If
End If
End If
If v Is EditText Then
txt=v
txt.Color=Colors.ARGB(255,itxtred,itxtgreen,itxtblue)
txt.TextColor=Colors.DarkGray
txt.TextSize=15
End If
If v Is Spinner Then
sp=v
sp.Color=Colors.ARGB(255,itxtred,itxtgreen,itxtblue)
sp.DropdownBackgroundColor=Colors.argb(255,itxtred,itxtgreen,itxtblue)
sp.TextColor=Colors.DarkGray
sp.TextSize=15
End If
Next
End Sub