Sub Globals
Private Label1 As Label
Private Label2 As Label
Private Label3 As Label
Private Label4 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
MakeViewBackgroundTransparent(Label1, 50)
MakeViewBackgroundTransparent(Label2, 100)
MakeViewBackgroundTransparent(Label3, 150)
MakeViewBackgroundTransparent(Label4, 250)
End Sub
Private Sub MakeViewBackgroundTransparent(View As B4XView, Alpha As Int)
Dim clr As Int = View.Color
If clr = 0 Then
Log("Cannot get background color.")
Return
End If
View.Color = Bit.Or(Bit.And(0x00ffffff, clr), Bit.ShiftLeft(Alpha, 24))
End Sub