Android Question Datedialog that I can configure its colors

vecino

Well-Known Member
Licensed User
Longtime User
Hi, which datedialog do you recommend that I can configure the background color, title, days, buttons, etc.
Thank you.
 

Mahares

Expert
Licensed User
Longtime User
which datedialog do you recommend that I can configure the background color, title, days, buttons, etc.
B4XateTemplate from XUI Views library is my choice. Here is some of what you can do with some of the color changes:
B4X:
DateTemplate.lblYear.Font = XUI.CreateDefaultBoldFont(24)  'change year font
    DateTemplate.lblmonth.Font = XUI.CreateDefaultBoldFont(24)  'change month font
    DateTemplate.lblYear.TextColor = XUI.Color_Yellow
    DateTemplate.lblmonth.TextColor = XUI.Color_Magenta
    DateTemplate.DaysInMonthColor=XUI.Color_Yellow
    DateTemplate.DaysInWeekColor=XUI.Color_Cyan
    DateTemplate.SelectedColor =XUI.Color_Red
    Dialog.BackgroundColor= XUI.Color_Blue
    Dialog.ButtonsTextColor =XUI.Color_Green
 

Attachments

  • DateTemplateAfterChanges.png
    DateTemplateAfterChanges.png
    13.1 KB · Views: 124
  • DateTemplateBeforeChanges.png
    DateTemplateBeforeChanges.png
    12.4 KB · Views: 134
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Hello, the datedialog is displayed below the buttons and other views.
Seeing the snapshot in your above post it looks like you are not using B4XDateTemplate of XUI Views. See the link below for a full example by Erel of most of XUI Views and among them the B4XDateTemplate button 'Select Date'. You will see how it works. You can extract the code relevant to the B4XDateTemplate and use it in your project if you like. You can add the code I put in post# 2 to change colors or use the link Erel gave you in post #3 for a light theme which has easy to the eye light colors.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Thanks for the advice.
What I don't understand is that it is necessary to write a lot of code to customize a "simple" datedialog, and if there are several datedialog then the code multiplies.
Isn't there some class or library that can be used for all datedialogs, without having to write so much code for each one?
Thanks.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
I'm getting the hang of it, I'm just not very clear with "xui", "datetemplate", "dialog", etc.
Thank you.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Ok, now I understand how it works.
Thank you.
 

Attachments

  • datedialog.png
    datedialog.png
    24.4 KB · Views: 104
Upvote 0
Top