Class module
Sub Class_Globals
Private Gradient1 As GradientDrawable
Private Clrs(5) As Int
Private Clrs1(5) As Int
End Sub
'Initializes the object. You can add parameters to this method if needed.
Sub Initialize
Clrs(0) = Colors.DarkGray
Clrs(1) = Colors.LightGray
Clrs(2)=Colors.LightGray
Clrs(3)=Colors.LightGray
Clrs(4)=Colors.DarkGray
Clrs1(0) = Colors.LightGray
Clrs1(1) = Colors.DarkGray
Clrs1(2)=Colors.Black
Clrs1(3)=Colors.DarkGray
Clrs1(4)=Colors.LightGray
End Sub
Sub gradientview(view0 As View)
If view0 Is Label Then ' This is True by pass Label and Button
Gradient1.Initialize("TOP_BOTTOM", Clrs1)
Log("is label")
Else
Log("no label")
Gradient1.Initialize("TOP_BOTTOM", Clrs)
End If
Gradient1.CornerRadius = 5dip
view0.Background=Gradient1
End Sub