Private Sub CreateCard(Width As Int, Title As String, Image As String, Content As String) As Panel
Dim p As B4XView = xui.CreatePanel("")
SetAlpha(p, 0.3)
B4X:
'Level between 0 (transparent) to 1 (opaque)
Public Sub SetAlpha (View As B4XView, Level As Float)
#if B4A
Dim jo As JavaObject = View
Dim alpha As Float = Level
jo.RunMethod("setAlpha", Array(alpha))
#Else If B4J
Dim n As Node = View
n.Alpha = Level
#else if B4i
Dim v As View = View
v.Alpha = Level
#End If
End Sub
Hi everyone, I'm experimenting some modern UI techniques... is it possibile to have a panel with transparent color and keeping the shadow? At the moment i'm achieving the shadow using the "Elevation" but if i put Color to transpartent the shadow disappears. Is there a better way to apply a...
Private Sub CreateCard(Width As Int, Title As String, Image As String, Content As String) As Panel
Dim p As B4XView = xui.CreatePanel("")
SetAlpha(p, 0.3)
B4X:
'Level between 0 (transparent) to 1 (opaque)
Public Sub SetAlpha (View As B4XView, Level As Float)
#if B4A
Dim jo As JavaObject = View
Dim alpha As Float = Level
jo.RunMethod("setAlpha", Array(alpha))
#Else If B4J
Dim n As Node = View
n.Alpha = Level
#else if B4i
Dim v As View = View
v.Alpha = Level
#End If
End Sub
Hi everyone, I'm experimenting some modern UI techniques... is it possibile to have a panel with transparent color and keeping the shadow? At the moment i'm achieving the shadow using the "Elevation" but if i put Color to transpartent the shadow disappears. Is there a better way to apply a...
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim ColorSelected, ColorUnselected As ColorDrawable
Private CLV1 As CustomListView
Private ImageFlower As B4XView
Private LabelTitle As B4XView
Private LabelBody As B4XView
Private LabelAction As B4XView
Private Panel1 As B4XView
End Sub
Private Sub CreateCard(Width As Int, Title As String, Image As String, Content As String) As Panel
Dim p As B4XView = xui.CreatePanel("")
Dim height As Int = 280dip
If GetDeviceLayoutValues.ApproximateScreenSize < 4.5 Then
height = 310dip
End If
'height = 200dip
p.SetLayoutAnimated(0, 0, 0, Width, height)
p.LoadLayout("Card")
Panel1.SetColorAndBorder(0x7EF0FFFF, 1dip, 0x7EF0FFFF, 8dip)
SetShadow(Panel1, 8dip, 0x7EF0FFFF)