This is working fine for me. I don't find any way to change the size of the calendar (date picker). It is fine on my phone but it would be nice to make it larger on my tablet. Is this possible?
Thanks,
This is working fine for me. I don't find any way to change the size of the calendar (date picker). It is fine on my phone but it would be nice to make it larger on my tablet. Is this possible?
Resize XUI Views Dialog
Referring to B4X XUI Views Dialog https://www.b4x.com/android/forum/threads/b4x-xui-views-cross-platform-views-and-dialogs.100836/ How can I increase the size of dialog window? The buttons are quite small to tap. When I try to use the following code, the buttons inside the panel are not...www.b4x.com
private Sub show_caldialog
Dim devwidth As Int = GetDeviceLayoutValues.Width
Dim devheight As Int = GetDeviceLayoutValues.height - 80dip ' title bar height not included
lblseldate.Text = ""
Dim pnl As B4XView = xui.CreatePanel("")
pnl.RemoveAllViews
pnl.SetLayoutAnimated(0dip, 0dip, 0dip, devwidth, devheight-40dip)
Dim rsub1 As ResumableSub = caldialog.ShowCustom(pnl, "OK", "", "")
pnl.AddView(cal.set_date_picker(displaymonth,displayyear),0,0,pnl.Width,devheight-40dip)
…
Public Sub set_month_panel(mnth As Int, yr As Int) As Panel
… 'after boxheight declaration
' screen adjustments
Dim screensize As Double = GetDeviceLayoutValues.ApproximateScreenSize
Dim devwidth As Int = GetDeviceLayoutValues.Width/2
Dim devheight As Int = GetDeviceLayoutValues.height/2 - 80dip ' title bar height not included
If screensize > 8 Then
Dim devwidth As Int = GetDeviceLayoutValues.Width
Dim devheight As Int = GetDeviceLayoutValues.height - 80dip ' title bar height not included
End If
Private boxwidth As Int = DipToCurrent(devwidth/7)
Private boxheight As Int = DipToCurrent(devheight/8) ' devide by 9 for larger screens
…
Public Sub set_date_picker(intmonth As Int, intyear As Int) As Panel
Dim devwidth As Int = GetDeviceLayoutValues.Width
Dim devheight As Int = GetDeviceLayoutValues.height - 40dip ' title bar height not included
pnlpicker.Initialize("pnlpicker")
pnlpicker.RemoveAllViews
Private btnprev As Button = set_button("PREV",Colors.ARGB(100,182,221,249),"btnprev")
pnlpicker.AddView(btnprev,0dip,0dip,70dip,40dip)
lblseldate = set_label("",Colors.ARGB(100,230,230,230),"")
pnlpicker.AddView(lblseldate,140dip,0dip,devwidth - 210dip,40dip)
Private btnnext As Button = set_button("NEXT",Colors.ARGB(100,182,221,249),"btnnext")
pnlpicker.AddView(btnnext,devwidth - 70dip,0dip,70dip,40dip)
Private pnlmonth As Panel
pnlmonth.Initialize("pnlmonth")
pnlmonth = set_month_panel(intmonth,intyear)
Private btntoday As Button = set_button("NOW",Colors.ARGB(100,182,221,249),"btntoday")
pnlpicker.AddView(btntoday,70dip,0dip,70dip,40dip)
pnlpicker.AddView(pnlmonth,0dip,40dip,devwidth,devheight-40dip)
pnlpicker.SetLayoutAnimated(0dip, 0dip, 0dip, devwidth, devheight-40dip)
Return pnlpicker
End Sub
Private Sub set_background(intcolor As Int) As StateListDrawable
…
sd.AddState(sd.State_Enabled,cd) ' comment out this line for no colors, no borders
…
Thank you Toby and Paul!You need to change related declaration as follows:
B4X:Dim dateTemplate as B4XDateTemplate1 'not the default B4XDateTemplate