-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Implement iOS Platform Specifics #5879
Changes from all commits
e3b01ac
22d7c4e
8e408d6
d824e05
158771e
94b3532
f5bff4c
dbc459b
c507569
365576f
b2792fd
5267a5b
6637456
6b9d4ab
aa63543
30bf597
9c140c9
3a4cb68
467e501
f509d9a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class DatePicker | ||
{ | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class DatePicker : IDatePicker | ||
{ | ||
Font ITextStyle.Font => this.ToFont(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class DatePicker | ||
{ | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class DatePicker | ||
{ | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class DatePicker | ||
{ | ||
public static IPropertyMapper<IDatePicker, DatePickerHandler> ControlsDatePickerMapper = new PropertyMapper<DatePicker, DatePickerHandler>(DatePickerHandler.Mapper) | ||
{ | ||
#if IOS | ||
[PlatformConfiguration.iOSSpecific.DatePicker.UpdateModeProperty.PropertyName] = MapUpdateMode, | ||
#endif | ||
}; | ||
|
||
internal static new void RemapForControls() | ||
{ | ||
// Adjust the mappings to preserve Controls.DatePicker legacy behaviors | ||
DatePickerHandler.Mapper = ControlsDatePickerMapper; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Microsoft.Maui.Controls.Platform; | ||
using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; | ||
|
||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class DatePicker | ||
{ | ||
public static void MapUpdateMode(DatePickerHandler handler, DatePicker datePicker) | ||
{ | ||
handler.UpdateImmediately = datePicker.OnThisPlatform().UpdateMode() == UpdateMode.Immediately; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,17 @@ | |
{ | ||
public partial class Entry | ||
{ | ||
public static void MapText(EntryHandler handler, Entry entry) | ||
public static void MapCursorColor(EntryHandler handler, Entry entry) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Entry Cursor Color on iOS https://docs.microsoft.com/en-us/xamarin/xamarin-forms/platform/ios/entry-cursor-color |
||
{ | ||
Platform.TextExtensions.UpdateCursorColor(handler.PlatformView, entry); | ||
} | ||
|
||
public static void MapAdjustsFontSizeToFitWidth(EntryHandler handler, Entry entry) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Entry Font Size on iOS https://docs.microsoft.com/en-us/xamarin/xamarin-forms/platform/ios/entry-font-size |
||
{ | ||
Platform.TextExtensions.UpdateAdjustsFontSizeToFitWidth(handler.PlatformView, entry); | ||
} | ||
|
||
public static void MapText(EntryHandler handler, Entry entry) | ||
{ | ||
Platform.TextExtensions.UpdateText(handler.PlatformView, entry); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class NavigationPage | ||
{ | ||
public static IPropertyMapper<IStackNavigationView, NavigationViewHandler> ControlsNavigationPageMapper = | ||
new PropertyMapper<NavigationPage, NavigationViewHandler>(NavigationViewHandler.Mapper) | ||
{ | ||
#if IOS | ||
[PlatformConfiguration.iOSSpecific.NavigationPage.PrefersLargeTitlesProperty.PropertyName] = MapPrefersLargeTitles, | ||
[PlatformConfiguration.iOSSpecific.NavigationPage.IsNavigationBarTranslucentProperty.PropertyName] = MapIsNavigationBarTranslucent, | ||
#endif | ||
}; | ||
|
||
internal static new void RemapForControls() | ||
{ | ||
// Adjust the mappings to preserve Controls.NavigationPage legacy behaviors | ||
NavigationViewHandler.Mapper = ControlsNavigationPageMapper; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class NavigationPage | ||
{ | ||
public static void MapPrefersLargeTitles(NavigationViewHandler handler, NavigationPage navigationPage) | ||
{ | ||
if (handler.ViewController is ControlsNavigationController navigationController) | ||
Platform.NavigationPageExtensions.UpdatePrefersLargeTitles(navigationController, navigationPage); | ||
} | ||
|
||
public static void MapIsNavigationBarTranslucent(NavigationViewHandler handler, NavigationPage navigationPage) | ||
{ | ||
if (handler.ViewController is ControlsNavigationController navigationController) | ||
Platform.NavigationPageExtensions.UpdateIsNavigationBarTranslucent(navigationController, navigationPage); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class Picker | ||
{ | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class Picker | ||
{ | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class Picker | ||
{ | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class Picker | ||
{ | ||
public static IPropertyMapper<IPicker, PickerHandler> ControlsPickerMapper = new PropertyMapper<Picker, PickerHandler>(PickerHandler.Mapper) | ||
{ | ||
#if IOS | ||
[PlatformConfiguration.iOSSpecific.Picker.UpdateModeProperty.PropertyName] = MapUpdateMode, | ||
#endif | ||
}; | ||
|
||
internal static new void RemapForControls() | ||
{ | ||
// Adjust the mappings to preserve Controls.Picker legacy behaviors | ||
PickerHandler.Mapper = ControlsPickerMapper; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Microsoft.Maui.Controls.Platform; | ||
using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific; | ||
|
||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class Picker | ||
{ | ||
public static void MapUpdateMode(PickerHandler handler, Picker picker) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Picker Item Selection on iOS https://docs.microsoft.com/en-us/xamarin/xamarin-forms/platform/ios/picker-selection |
||
{ | ||
handler.UpdateImmediately = picker.OnThisPlatform().UpdateMode() == UpdateMode.Immediately; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class ScrollView | ||
{ | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class ScrollView | ||
{ | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class ScrollView | ||
{ | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class ScrollView | ||
{ | ||
public static IPropertyMapper<IScrollView, ScrollViewHandler> ControlsScrollViewMapper = | ||
new PropertyMapper<ScrollView, ScrollViewHandler>(ScrollViewHandler.Mapper) | ||
{ | ||
#if IOS | ||
[PlatformConfiguration.iOSSpecific.ScrollView.ShouldDelayContentTouchesProperty.PropertyName] = MapShouldDelayContentTouches, | ||
#endif | ||
}; | ||
|
||
internal static new void RemapForControls() | ||
{ | ||
// Adjust the mappings to preserve Controls.ScrollView legacy behaviors | ||
ScrollViewHandler.Mapper = ControlsScrollViewMapper; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class ScrollView | ||
{ | ||
public static void MapShouldDelayContentTouches(ScrollViewHandler handler, ScrollView scrollView) | ||
{ | ||
Platform.ScrollViewExtensions.UpdateShouldDelayContentTouches(handler.PlatformView, scrollView); | ||
} | ||
} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Microsoft.Maui.Controls | ||
{ | ||
public partial class TimePicker | ||
{ | ||
|
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DatePicker item selection on iOS https://docs.microsoft.com/en-us/xamarin/xamarin-forms/platform/ios/datepicker-selection