Bug in B4A 2.0 Beta 1.95

monki

Active Member
Licensed User
Longtime User
Problem with 2.0 Beta

During my first beta test of the 2.0, I noticed the following problem.
The comparison of the type of view is the label is also true for the view type button.

Is this a Bug?

B4X:
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
 
Top