i want to show modal bottom sheet when user click on edittext in other to select plan,when the code is executed it does not show anything only shows Semi-transparent background, this is my code
B4X:
Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
Private btn_action As Button
Private overlay As B4XView
End Sub
Sub ShowModalBottomSheet
' Create the overlay
overlay = xui.CreatePanel("overlay")
overlay.SetColorAndBorder(xui.Color_ARGB(100, 0, 0, 0), 0, 0, 0) ' Semi-transparent background
Root.AddView(overlay, 0, 0, Root.Width, Root.Height)
' Load the BottomSheet layout
Dim BottomSheetPanel As B4XView = xui.CreatePanel("")
BottomSheetPanel.LoadLayout("data_plan_modal") ' Corrected: Only 1 parameter
' Add the BottomSheet to the overlay
overlay.AddView(BottomSheetPanel, 0, Root.Height, Root.Width, 300dip)
' Animate the BottomSheet to slide up
BottomSheetPanel.SetLayoutAnimated(300, 0, Root.Height - 300dip, Root.Width, 300dip)
End Sub
Last edited: