Skip to content
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

Try reduce the ABI breaks #10410

Merged
merged 14 commits into from
Sep 30, 2022
3 changes: 3 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Button/Button.Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ public static void MapText(IButtonHandler handler, Button button)
handler.PlatformView?.UpdateText(button);
}

public static void MapText(ButtonHandler handler, Button button) =>
MapText((IButtonHandler)handler, button);

public static void MapLineBreakMode(IButtonHandler handler, Button button)
{
handler.PlatformView?.UpdateLineBreakMode(button);
Expand Down
4 changes: 4 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Button/Button.Standard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
public partial class Button
{
/// <include file="../../../../docs/Microsoft.Maui.Controls/Button.xml" path="//Member[@MemberName='MapText']/Docs/*" />
public static void MapText(ButtonHandler handler, Button button) { }

public static void MapLineBreakMode(ButtonHandler handler, Button button) { }

public static void MapText(IButtonHandler handler, Button button) { }

public static void MapLineBreakMode(IButtonHandler handler, Button button) { }
Expand Down
3 changes: 3 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Button/Button.Tizen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ public static void MapText(IButtonHandler handler, Button button)
handler.PlatformView?.UpdateText(button);
}

public static void MapText(ButtonHandler handler, Button button) =>
MapText((IButtonHandler)handler, button);

public static void MapLineBreakMode(IButtonHandler handler, Button button)
{
switch (button.LineBreakMode)
Expand Down
16 changes: 11 additions & 5 deletions src/Controls/src/Core/HandlerImpl/Button/Button.Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ namespace Microsoft.Maui.Controls
{
public partial class Button
{
public static void MapImageSource(IButtonHandler handler, Button button)
{
ButtonHandler.MapImageSource(handler, button);
button.Handler?.UpdateValue(nameof(Button.ContentLayout));
}
public static void MapImageSource(ButtonHandler handler, Button button) =>
MapImageSource((IButtonHandler)handler, button);

public static void MapText(IButtonHandler handler, Button button)
{
Expand All @@ -26,5 +23,14 @@ public static void MapLineBreakMode(IButtonHandler handler, Button button)
{
handler.PlatformView?.UpdateLineBreakMode(button);
}

public static void MapImageSource(IButtonHandler handler, Button button)
{
ButtonHandler.MapImageSource(handler, button);
button.Handler?.UpdateValue(nameof(Button.ContentLayout));
}

public static void MapText(ButtonHandler handler, Button button) =>
MapText((IButtonHandler)handler, button);
}
}
3 changes: 3 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Button/Button.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ public static void MapContentLayout(IButtonHandler handler, Button button)
{
handler.PlatformView.UpdateContentLayout(button);
}

public static void MapContentLayout(ButtonHandler handler, Button button) =>
MapContentLayout((IButtonHandler)handler, button);
}
}
21 changes: 12 additions & 9 deletions src/Controls/src/Core/HandlerImpl/Button/Button.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,29 @@ namespace Microsoft.Maui.Controls
{
public partial class Button
{
private static void MapPadding(IButtonHandler handler, Button button)
{
handler.PlatformView.UpdatePadding(button);
}

protected override Size ArrangeOverride(Rect bounds)
{
var result = base.ArrangeOverride(bounds);
Handler?.UpdateValue(nameof(ContentLayout));
return result;
}

public static void MapText(IButtonHandler handler, Button button)
{
handler.PlatformView?.UpdateText(button);
}
public static void MapText(ButtonHandler handler, Button button) =>
MapText((IButtonHandler)handler, button);

public static void MapLineBreakMode(IButtonHandler handler, Button button)
{
handler.PlatformView?.UpdateLineBreakMode(button);
}

private static void MapPadding(IButtonHandler handler, Button button)
{
handler.PlatformView.UpdatePadding(button);
}

public static void MapText(IButtonHandler handler, Button button)
{
handler.PlatformView?.UpdateText(button);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ public static void MapUpdateMode(IDatePickerHandler handler, DatePicker datePick
if (handler is DatePickerHandler dph)
dph.UpdateImmediately = datePicker.OnThisPlatform().UpdateMode() == UpdateMode.Immediately;
}

public static void MapUpdateMode(DatePickerHandler handler, DatePicker datePicker) =>
MapUpdateMode((IDatePickerHandler)handler, datePicker);
}
}
3 changes: 3 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Editor/Editor.Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
{
public partial class Editor
{
public static void MapText(EditorHandler handler, Editor editor) =>
MapText((IEditorHandler)handler, editor);

public static void MapText(IEditorHandler handler, Editor editor)
{
Platform.EditTextExtensions.UpdateText(handler.PlatformView, editor);
Expand Down
2 changes: 2 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Editor/Editor.Standard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
{
public partial class Editor
{
public static void MapText(EditorHandler handler, Editor editor) { }

public static void MapText(IEditorHandler handler, Editor editor) { }
}
}
3 changes: 3 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Editor/Editor.Tizen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
{
public partial class Editor
{
public static void MapText(EditorHandler handler, Editor editor) =>
MapText((IEditorHandler)handler, editor);

public static void MapText(IEditorHandler handler, Editor editor)
{
Platform.TextExtensions.UpdateText(handler.PlatformView, editor);
Expand Down
6 changes: 6 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Editor/Editor.Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
{
public partial class Editor
{
public static void MapText(EditorHandler handler, Editor editor) =>
MapText((IEditorHandler)handler, editor);

public static void MapDetectReadingOrderFromContent(EditorHandler handler, Editor editor) =>
MapDetectReadingOrderFromContent((IEditorHandler)handler, editor);

public static void MapText(IEditorHandler handler, Editor editor)
{
Platform.TextBoxExtensions.UpdateText(handler.PlatformView, editor);
Expand Down
3 changes: 3 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Editor/Editor.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
{
public partial class Editor
{
public static void MapText(EditorHandler handler, Editor editor) =>
MapText((IEditorHandler)handler, editor);

public static void MapText(IEditorHandler handler, Editor editor)
{
Platform.TextExtensions.UpdateText(handler.PlatformView, editor);
Expand Down
6 changes: 6 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Entry/Entry.Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ namespace Microsoft.Maui.Controls
{
public partial class Entry
{
public static void MapImeOptions(EntryHandler handler, Entry entry) =>
MapImeOptions((IEntryHandler)handler, entry);

public static void MapText(EntryHandler handler, Entry entry) =>
MapText((IEntryHandler)handler, entry);

public static void MapImeOptions(IEntryHandler handler, Entry entry)
{
Platform.EditTextExtensions.UpdateImeOptions(handler.PlatformView, entry);
Expand Down
2 changes: 2 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Entry/Entry.Standard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
{
public partial class Entry
{
public static void MapText(EntryHandler handler, Entry entry) { }

public static void MapText(IEntryHandler handler, Entry entry) { }
}
}
3 changes: 3 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Entry/Entry.Tizen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
{
public partial class Entry
{
public static void MapText(EntryHandler handler, Entry entry) =>
MapText((IEntryHandler)handler, entry);

public static void MapText(IEntryHandler handler, Entry entry)
{
Platform.TextExtensions.UpdateText(handler.PlatformView, entry);
Expand Down
6 changes: 6 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Entry/Entry.Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@ public static void MapText(IEntryHandler handler, Entry entry)
{
Platform.TextBoxExtensions.UpdateText(handler.PlatformView, entry);
}

public static void MapDetectReadingOrderFromContent(EntryHandler handler, Entry entry) =>
MapDetectReadingOrderFromContent((IEntryHandler)handler, entry);

public static void MapText(EntryHandler handler, Entry entry) =>
MapText((IEntryHandler)handler, entry);
}
}
9 changes: 9 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Entry/Entry.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,14 @@ public static void MapText(IEntryHandler handler, Entry entry)
{
Platform.TextExtensions.UpdateText(handler.PlatformView, entry);
}

public static void MapCursorColor(EntryHandler handler, Entry entry) =>
MapCursorColor((IEntryHandler)handler, entry);

public static void MapAdjustsFontSizeToFitWidth(EntryHandler handler, Entry entry) =>
MapAdjustsFontSizeToFitWidth((IEntryHandler)handler, entry);

public static void MapText(EntryHandler handler, Entry entry) =>
MapText((IEntryHandler)handler, entry);
}
}
5 changes: 5 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Label/Label.Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ private protected override void OnHandlerChangedCore()
}
}

public static void MapTextType(LabelHandler handler, Label label) => MapText((ILabelHandler)handler, label);
public static void MapText(LabelHandler handler, Label label) => MapText((ILabelHandler)handler, label);
public static void MapLineBreakMode(LabelHandler handler, Label label) => MapLineBreakMode((ILabelHandler)handler, label);


public static void MapTextType(ILabelHandler handler, Label label)
{
Platform.TextViewExtensions.UpdateText(handler.PlatformView, label);
Expand Down
6 changes: 6 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Label/Label.Standard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,11 @@ public static void MapText(ILabelHandler handler, Label label) { }

public static void MapLineBreakMode(ILabelHandler handler, Label label) { }
public static void MapMaxLines(ILabelHandler handler, Label label) { }


public static void MapTextType(LabelHandler handler, Label label) => MapText((ILabelHandler)handler, label);
public static void MapText(LabelHandler handler, Label label) => MapText((ILabelHandler)handler, label);
public static void MapLineBreakMode(LabelHandler handler, Label label) => MapLineBreakMode((ILabelHandler)handler, label);
public static void MapMaxLines(LabelHandler handler, Label label) => MapMaxLines((ILabelHandler)handler, label);
}
}
3 changes: 3 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Label/Label.Tizen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ namespace Microsoft.Maui.Controls
{
public partial class Label
{
public static void MapTextType(LabelHandler handler, Label label) => MapText((ILabelHandler)handler, label);
public static void MapText(LabelHandler handler, Label label) => MapText((ILabelHandler)handler, label);

public static void MapTextType(ILabelHandler handler, Label label)
{
Platform.TextExtensions.UpdateText(handler.PlatformView, label);
Expand Down
5 changes: 5 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Label/Label.Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ namespace Microsoft.Maui.Controls
{
public partial class Label
{
public static void MapDetectReadingOrderFromContent(LabelHandler handler, Label label) => MapDetectReadingOrderFromContent((ILabelHandler)handler, label);
public static void MapTextType(LabelHandler handler, Label label) => MapTextType((ILabelHandler)handler, label);
public static void MapText(LabelHandler handler, Label label) => MapText((ILabelHandler)handler, label);


public static void MapDetectReadingOrderFromContent(ILabelHandler handler, Label label) =>
Platform.TextBlockExtensions.UpdateDetectReadingOrderFromContent(handler.PlatformView, label);

Expand Down
9 changes: 9 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Label/Label.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ namespace Microsoft.Maui.Controls
{
public partial class Label
{
public static void MapTextType(LabelHandler handler, Label label) => MapText((ILabelHandler)handler, label);
public static void MapText(LabelHandler handler, Label label) => MapText((ILabelHandler)handler, label);
public static void MapCharacterSpacing(LabelHandler handler, Label label) => MapCharacterSpacing((ILabelHandler)handler, label);
public static void MapTextDecorations(LabelHandler handler, Label label) => MapTextDecorations((ILabelHandler)handler, label);
public static void MapLineHeight(LabelHandler handler, Label label) => MapLineHeight((ILabelHandler)handler, label);
public static void MapFont(LabelHandler handler, Label label) => MapFont((ILabelHandler)handler, label);
public static void MapTextColor(LabelHandler handler, Label label) => MapTextColor((ILabelHandler)handler, label);


public static void MapTextType(ILabelHandler handler, Label label)
{
Platform.LabelExtensions.UpdateText(handler.PlatformView, label);
Expand Down
2 changes: 2 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Layout/Layout.Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ namespace Microsoft.Maui.Controls
{
public partial class Layout
{
public static void MapInputTransparent(LayoutHandler handler, Layout layout) => MapInputTransparent((ILayoutHandler)handler, layout);

public static void MapInputTransparent(ILayoutHandler handler, Layout layout)
{
if (handler.PlatformView is LayoutViewGroup layoutViewGroup)
Expand Down
2 changes: 2 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Layout/Layout.Standard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
{
public partial class Layout
{
public static void MapInputTransparent(LayoutHandler handler, Layout layout) => MapInputTransparent((ILayoutHandler)handler, layout);

public static void MapInputTransparent(ILayoutHandler handler, Layout layout)
{
}
Expand Down
2 changes: 2 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Layout/Layout.Tizen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
{
public partial class Layout
{
public static void MapInputTransparent(LayoutHandler handler, Layout layout) => MapInputTransparent((ILayoutHandler)handler, layout);

public static void MapInputTransparent(ILayoutHandler handler, Layout layout)
{
if (handler.PlatformView == null)
Expand Down
2 changes: 2 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Layout/Layout.Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
{
public partial class Layout
{
public static void MapInputTransparent(LayoutHandler handler, Layout layout) => MapInputTransparent((ILayoutHandler)handler, layout);

public static void MapInputTransparent(ILayoutHandler handler, Layout layout)
{
handler.PlatformView?.UpdateInputTransparent(handler, layout);
Expand Down
3 changes: 3 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Layout/Layout.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
{
public partial class Layout
{
public static void MapInputTransparent(LayoutHandler handler, Layout layout) =>
MapInputTransparent((ILayoutHandler)handler, layout);

public static void MapInputTransparent(ILayoutHandler handler, Layout layout)
{
handler.PlatformView?.UpdateInputTransparent(handler, layout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
{
public partial class NavigationPage
{
public static void MapPrefersLargeTitles(NavigationViewHandler handler, NavigationPage navigationPage) =>
MapPrefersLargeTitles((INavigationViewHandler)handler, navigationPage);

public static void MapIsNavigationBarTranslucent(NavigationViewHandler handler, NavigationPage navigationPage) =>
MapPrefersLargeTitles((INavigationViewHandler)handler, navigationPage);

public static void MapPrefersLargeTitles(INavigationViewHandler handler, NavigationPage navigationPage)
{
if (handler is NavigationViewHandler nvh && nvh.ViewController is ControlsNavigationController navigationController)
Expand Down
3 changes: 3 additions & 0 deletions src/Controls/src/Core/HandlerImpl/Picker/Picker.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ public static void MapUpdateMode(IPickerHandler handler, Picker picker)
if (handler is PickerHandler ph)
ph.UpdateImmediately = picker.OnThisPlatform().UpdateMode() == UpdateMode.Immediately;
}

public static void MapUpdateMode(PickerHandler handler, Picker picker) =>
MapUpdateMode((IPickerHandler)handler, picker);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ namespace Microsoft.Maui.Controls
{
public partial class RadioButton
{
public static void MapContent(RadioButtonHandler handler, RadioButton radioButton)
=> MapContent((IRadioButtonHandler)handler, radioButton);

public static void MapContent(IRadioButtonHandler handler, RadioButton radioButton)
{
if (radioButton.ResolveControlTemplate() != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ public partial class RadioButton
{
static ControlTemplate s_tizenDefaultTemplate;


public static void MapContent(RadioButtonHandler handler, RadioButton radioButton)
=> MapContent((IRadioButtonHandler)handler, radioButton);

public static void MapContent(IRadioButtonHandler handler, RadioButton radioButton)
{
if (radioButton.ResolveControlTemplate() == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ namespace Microsoft.Maui.Controls
{
public partial class RadioButton
{
public static void MapContent(RadioButtonHandler handler, RadioButton radioButton)
=> MapContent((IRadioButtonHandler)handler, radioButton);

public static void MapContent(IRadioButtonHandler handler, RadioButton radioButton)
{
if (radioButton.ResolveControlTemplate() != null)
Expand Down
Loading