Android Question Nested DateDialog into a CustomDialog

antonomase

Active Member
Licensed User
Longtime User
Hi,
When I call a DateDialog nested into a CustomDialog, the DateDialog is truncated in height by the height of the CustomDialog. If the CustomDialog is not high enough, the OK and Cancel buttons are not displayed.

Is there any way of fixing this other than making the CustomDialog panel high enough?

B4X:
Private Sub ShowCustomDialog
    Dim p As B4XView = xui.CreatePanel("")
   ' Minimal Height = 250dip
    p.SetLayoutAnimated(100, 0, 0, 80%x, 250dip)
...
    Dim rs As ResumableSub = CustomDialog.ShowCustom(p, "OK", "", "CANCEL")
...

B4X:
Private Sub lblCustomDate_Click
    DateDialog.Initialize(CustomDialog.Base)
    DateTemplate.Initialize

    Dim Result As Object = DateDialog.ShowTemplate(DateTemplate, "OK", "", "CANCEL")
    Wait For (Result) Complete (Success As Int)
...
End Sub

Thank you for your answers
 

antonomase

Active Member
Licensed User
Longtime User
Exactly, the first box is a customized B4XDialog CustomDialog with several fields, including a label lblCustomDate.

Clicking on this label opens DateDialog, a box with a B4XDateTemplate.

B4X:
    Private CustomDialog As B4XDialog
    Private LblCustomDate As Label
    
    Private DateDialog As B4XDialog
    Private DateTemplate As B4XDateTemplate

Since DateDialog is initialized with CustomDialog.Base, it appears to be cropped to the dimensions of DateDialog
 
Upvote 0

antonomase

Active Member
Licensed User
Longtime User
First, because when I searched the forum for customizable dialogs, I never got the answer about B4XPreferencesDialog.

Secondly, I just looked at B4XPreferencesDialog, but nowhere did I see that it supports nested.

And why have so many libraries all doing the same thing. Wouldn't it be simpler to reduce their number and mark the older ones as obsolete so that they're not used for new developments?

It's been several years since I've done any development in B4A, but it's still so complicated to get information on what libraries are doing. Just one example: I had seen that DialogBox has a function ButtonsOrder.
1747289634909.png

It took me a very long time to find out how to use it and what its arguments are, because neither the https://www.b4x.com/android/help/xuiviews.html nor the https://www.b4x.com/android/forum/threads/b4x-xui-views-cross-platform-views-and-dialogs.100836/ documentation really helped.
 
Upvote 0
Top