Private Sub SetupCustomListView
Dim pad As Int = miPadding
Dim viewW As Int = Max(1dip, mBase.Width - (pad * 2))
Dim viewH As Int = Max(1dip, mBase.Height - (pad * 2))
miListWidth = viewW
' 1. Initialize the class
clv.Initialize(Me, "clv")
' 2. Create the base panel that will house the CustomListView
Dim pnlBase As B4XView = xui.CreatePanel("")
pnlBase.SetLayoutAnimated(0, 0, 0, viewW, viewH)
pnlBase.Color = xui.Color_Transparent
' 3. Create a dummy label so CLV can extract default text styling
Dim dummyLbl As Label
dummyLbl.Initialize("")
Dim xDummy As B4XView = dummyLbl
xDummy.TextColor = xui.Color_Black
xDummy.TextSize = 14
' 4. Construct the properties Map expected by DesignerCreateView
Dim props As Map
props.Initialize
props.Put("ListOrientation", "Vertical")
props.Put("DividerColor", xui.Color_Transparent) ' DaisyList handles its own dividers
props.Put("DividerHeight", 0)
props.Put("PressedColor", xui.Color_LightGray)
props.Put("InsertAnimationDuration", 0)
props.Put("ShowScrollBar", False)
' 5. Force the internal view creation
clv.DesignerCreateView(pnlBase, dummyLbl, props)
' Disable internal animations
clv.AnimationDuration = 0
' 6. Add the now-initialized base panel to your host view instead of clv.AsView
mBase.AddView(pnlBase, pad, pad, viewW, viewH)
#If B4A
ApplyScrollFix
#End If
End Sub