Skip to content

Commit

Permalink
The button names for the previous month, current month and next month…
Browse files Browse the repository at this point in the history
… are given differently.
  • Loading branch information
sebarslan committed Dec 21, 2024
1 parent beb0d6f commit bd95d19
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Maui.NullableDateTimePicker.Samples/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public static MauiApp CreateMauiApp()
#endif

// Remove Entry control underline, padding and background color
Microsoft.Maui.Handlers.EntryHandler.Mapper.AppendToMapping("NullableDateTimePickerCustomization", (handler, view) =>
Microsoft.Maui.Handlers.EntryHandler.Mapper.AppendToMapping("NullableDateTimePickerEntryCustomization", (handler, view) =>
{
if (view is Maui.NullableDateTimePicker.NullableDateTimePickerEntry)
{
#if ANDROID
handler.PlatformView.SetBackgroundColor(Android.Graphics.Color.Transparent);
handler.PlatformView.SetPadding(0,0,0,0);
handler.PlatformView.SetPadding(0, 0, 0, 0);
#if NET8_0_OR_GREATER
handler.PlatformView.BackgroundTintList = Android.Content.Res.ColorStateList.ValueOf(view.Background.ToColor().ToPlatform());
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ await MainThreadHelper.SafeInvokeOnMainThreadAsync(() =>
for (int day = 1; day <= daysInMonth; day++)
{
var dayButton = _dayButtons[day - 1];
dayButton.AutomationId = $"{_options.AutomationId}_CalendarDayButton_{_currentDate.Year}_{_currentDate.Month}_{day}";

if (dayButton.Style != _dayStyle)
{
Expand Down Expand Up @@ -394,7 +393,7 @@ await MainThreadHelper.SafeInvokeOnMainThreadAsync(() =>
int dayInLastMonth = daysInLastMonth - i;
Button lastMonthDayButton = new()
{
AutomationId = $"{_options.AutomationId}_CalendarDayButton_{lastMonthDate.Year}_{lastMonthDate.Month}_{dayInLastMonth}",
AutomationId = $"{_options.AutomationId}_CalendarLastMonthDayButton_{lastMonthDate.Year}_{lastMonthDate.Month}_{dayInLastMonth}",
Text = dayInLastMonth.ToString(),
Style = _otherMonthDayStyle
};
Expand All @@ -414,7 +413,7 @@ await MainThreadHelper.SafeInvokeOnMainThreadAsync(() =>
int dayInNextMonth = i + 1;
Button nextMonthDayButton = new()
{
AutomationId = $"{_options.AutomationId}_CalendarDayButton_{nextMonthDate.Year}_{nextMonthDate.Month}_{dayInNextMonth}",
AutomationId = $"{_options.AutomationId}_CalendarNextMonthDayButton_{nextMonthDate.Year}_{nextMonthDate.Month}_{dayInNextMonth}",
Text = dayInNextMonth.ToString(),
Style = _otherMonthDayStyle
};
Expand Down Expand Up @@ -784,6 +783,7 @@ private async Task InitContent()
{
Button button = new()
{
AutomationId = $"{_options.AutomationId}_CalendarCurrentMothDayButton_{day}",
Text = day.ToString(),
Style = _dayStyle,
IsEnabled = true
Expand Down

0 comments on commit bd95d19

Please sign in to comment.