Skip to content

Commit 92a697f

Browse files
[create-pull-request] automated change
1 parent 8cd9239 commit 92a697f

File tree

1,829 files changed

+75029
-1960
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,829 files changed

+75029
-1960
lines changed

src/BlazorWebView/src/Maui/Windows/BlazorWebView.Windows.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ protected override void OnPropertyChanging(string? propertyName = null)
1010
base.OnPropertyChanging(propertyName);
1111

1212
if (propertyName == nameof(Window) && Window is not null)
13+
{
1314
Window.Destroying -= Window_Destroying;
15+
}
1416
}
1517

1618
/// <inheritdoc/>
@@ -19,7 +21,9 @@ protected override void OnPropertyChanged(string? propertyName = null)
1921
base.OnPropertyChanged(propertyName);
2022

2123
if (propertyName == nameof(Window) && Window is not null)
24+
{
2225
Window.Destroying += Window_Destroying;
26+
}
2327
}
2428

2529
private void Window_Destroying(object? sender, EventArgs e)

src/BlazorWebView/src/Maui/iOS/IOSWebViewManager.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ private static string GetJsAlertTitle(WKWebView webView)
143143
// The scheme and host are used unless local html content is what the webview is displaying,
144144
// in which case the bundle file name is used.
145145
if (webView.Url != null && webView.Url.AbsoluteString != $"file://{NSBundle.MainBundle.BundlePath}/")
146+
{
146147
return $"{webView.Url.Scheme}://{webView.Url.Host}";
148+
}
147149

148150
return new NSString(NSBundle.MainBundle.BundlePath).LastPathComponent;
149151
}
@@ -173,13 +175,19 @@ private static void PresentAlertController(
173175
var controller = UIAlertController.Create(GetJsAlertTitle(webView), message, UIAlertControllerStyle.Alert);
174176

175177
if (defaultText != null)
178+
{
176179
controller.AddTextField((textField) => textField.Text = defaultText);
180+
}
177181

178182
if (okAction != null)
183+
{
179184
AddOkAction(controller, () => okAction(controller));
185+
}
180186

181187
if (cancelAction != null)
188+
{
182189
AddCancelAction(controller, () => cancelAction(controller));
190+
}
183191

184192
#pragma warning disable CA1416, CA1422 // TODO: 'UIApplication.Windows' is unsupported on: 'ios' 15.0 and later
185193
GetTopViewController(UIApplication.SharedApplication.Windows.FirstOrDefault(m => m.IsKeyWindow)?.RootViewController)?
@@ -190,13 +198,19 @@ private static void PresentAlertController(
190198
private static UIViewController? GetTopViewController(UIViewController? viewController)
191199
{
192200
if (viewController is UINavigationController navigationController)
201+
{
193202
return GetTopViewController(navigationController.VisibleViewController);
203+
}
194204

195205
if (viewController is UITabBarController tabBarController)
206+
{
196207
return GetTopViewController(tabBarController.SelectedViewController!);
208+
}
197209

198210
if (viewController?.PresentedViewController != null)
211+
{
199212
return GetTopViewController(viewController.PresentedViewController);
213+
}
200214

201215
return viewController;
202216
}

src/Compatibility/Android.AppLinks/src/AndroidAppLinks.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ public class AndroidAppLinks : IAppLinks, IDisposable
2323
public static void Init(Activity activity)
2424
{
2525
if (IsInitialized)
26+
{
2627
return;
28+
}
29+
2730
IsInitialized = true;
2831

2932
Context = activity;

src/Compatibility/Android.AppLinks/src/ContextExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ internal static class ContextExtensions
88
public static AActivity GetActivity(this Context context)
99
{
1010
if (context == null)
11+
{
1112
return null;
13+
}
1214

1315
if (context is AActivity activity)
16+
{
1417
return activity;
18+
}
1519

1620
if (context is ContextWrapper contextWrapper)
21+
{
1722
return contextWrapper.BaseContext.GetActivity();
23+
}
1824

1925
return null;
2026
}

src/Compatibility/ControlGallery/src/Issues.Shared/Issue2143.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ namespace Microsoft.Maui.Controls.ControlGallery.Issues
1010
{
1111
[Preserve(AllMembers = true)]
1212
[Issue(IssueTracker.Github, 2143, "Picker on windows phone", PlatformAffected.WinPhone)]
13-
#if UITEST
13+
#if UITEST
1414
[NUnit.Framework.Category(Compatibility.UITests.UITestCategories.TableView)]
15-
#endif
15+
#endif
1616
public class Issue2143 : ContentPage
1717
{
1818
public Issue2143()

src/Compatibility/ControlGallery/src/Issues.Shared/Issue22246_BZ.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ namespace Microsoft.Maui.Controls.ControlGallery.Issues
1111
{
1212
[Preserve(AllMembers = true)]
1313
[Issue(IssueTracker.Bugzilla, 22246, "Entry in Grid nested in ViewCell isn't expanding", PlatformAffected.WinPhone, NavigationBehavior.PushModalAsync)]
14-
#if UITEST
14+
#if UITEST
1515
[NUnit.Framework.Category(Compatibility.UITests.UITestCategories.TableView)]
16-
#endif
16+
#endif
1717
public class Issue22246Bz : ContentPage
1818
{
1919
public Issue22246Bz()

src/Compatibility/ControlGallery/src/Issues.Shared/Issue2615.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ namespace Microsoft.Maui.Controls.ControlGallery.Issues
66
{
77
[Preserve(AllMembers = true)]
88
[Issue(IssueTracker.Github, 2615, "iOS Cell Reuse screws up when cells are both ViewCell with different children", PlatformAffected.iOS)]
9-
#if UITEST
9+
#if UITEST
1010
[NUnit.Framework.Category(Compatibility.UITests.UITestCategories.TableView)]
11-
#endif
11+
#endif
1212
public class Issue2615 : ContentPage
1313
{
1414
public Issue2615()

src/Compatibility/ControlGallery/src/Issues.Shared/Issue5555.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ namespace Microsoft.Maui.Controls.ControlGallery.Issues
1313
{
1414
[Preserve(AllMembers = true)]
1515
[Issue(IssueTracker.Github, 5555, "Memory leak when SwitchCell or EntryCell", PlatformAffected.iOS)]
16-
#if UITEST
16+
#if UITEST
1717
[NUnit.Framework.Category(Compatibility.UITests.UITestCategories.TableView)]
18-
#endif
18+
#endif
1919
public class Issue5555 : TestContentPage
2020
{
2121
[Preserve(AllMembers = true)]

src/Compatibility/Core/src/Android/AppCompat/ButtonRenderer.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ protected override AppCompatButton CreateNativeControl()
6262
protected override void Dispose(bool disposing)
6363
{
6464
if (_isDisposed)
65+
{
6566
return;
67+
}
6668

6769
_isDisposed = true;
6870

@@ -117,16 +119,24 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE
117119
}
118120

119121
if (e.PropertyName == Button.TextColorProperty.PropertyName)
122+
{
120123
UpdateTextColor();
124+
}
121125
else if (e.PropertyName == VisualElement.IsEnabledProperty.PropertyName)
126+
{
122127
UpdateEnabled();
128+
}
123129
else if (e.PropertyName == FontElement.FontAttributesProperty.PropertyName
124130
|| e.PropertyName == FontElement.FontAutoScalingEnabledProperty.PropertyName
125131
|| e.PropertyName == FontElement.FontFamilyProperty.PropertyName
126132
|| e.PropertyName == FontElement.FontSizeProperty.PropertyName)
133+
{
127134
UpdateFont();
135+
}
128136
else if (e.PropertyName == Button.CharacterSpacingProperty.PropertyName)
137+
{
129138
UpdateCharacterSpacing();
139+
}
130140

131141
base.OnElementPropertyChanged(sender, e);
132142
}
@@ -135,7 +145,9 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE
135145
protected override void UpdateBackgroundColor()
136146
{
137147
if (Element == null || Control == null)
148+
{
138149
return;
150+
}
139151

140152
_backgroundTracker?.UpdateDrawable();
141153
}
@@ -162,7 +174,9 @@ void UpdateFont()
162174
Font font = (button as ITextStyle).Font;
163175

164176
if (font == Font.Default && _defaultFontSize == 0f)
177+
{
165178
return;
179+
}
166180

167181
if (_defaultFontSize == 0f)
168182
{

src/Compatibility/Core/src/Android/AppCompat/CarouselPageRenderer.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ void ViewPager.IOnPageChangeListener.OnPageScrollStateChanged(int state)
3939
void IManageFragments.SetFragmentManager(FragmentManager childFragmentManager)
4040
{
4141
if (_fragmentManager == null)
42+
{
4243
_fragmentManager = childFragmentManager;
44+
}
4345
}
4446

4547
void ViewPager.IOnPageChangeListener.OnPageSelected(int position)
@@ -60,7 +62,9 @@ protected override void Dispose(bool disposing)
6062
_disposed = true;
6163

6264
if (Element != null)
65+
{
6366
PageController.InternalChildren.CollectionChanged -= OnChildrenCollectionChanged;
67+
}
6468

6569
if (_viewPager != null)
6670
{
@@ -100,7 +104,10 @@ protected override void OnAttachedToWindow()
100104
{
101105
base.OnAttachedToWindow();
102106
if (Parent is PageContainer pageContainer && (pageContainer.IsInFragment || pageContainer.Visibility == ViewStates.Gone))
107+
{
103108
return;
109+
}
110+
104111
PageController.SendAppearing();
105112
Element.CurrentPage?.SendAppearing();
106113
}
@@ -109,7 +116,10 @@ protected override void OnDetachedFromWindow()
109116
{
110117
base.OnDetachedFromWindow();
111118
if (Parent is PageContainer pageContainer && pageContainer.IsInFragment)
119+
{
112120
return;
121+
}
122+
113123
Element.CurrentPage?.SendDisappearing();
114124
PageController.SendDisappearing();
115125
}
@@ -121,7 +131,9 @@ protected override void OnElementChanged(ElementChangedEventArgs<CarouselPage> e
121131
var activity = Context.GetActivity();
122132

123133
if (e.OldElement != null)
134+
{
124135
((IPageController)e.OldElement).InternalChildren.CollectionChanged -= OnChildrenCollectionChanged;
136+
}
125137

126138
if (e.NewElement != null)
127139
{
@@ -161,7 +173,9 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE
161173
base.OnElementPropertyChanged(sender, e);
162174

163175
if (e.PropertyName == nameof(Element.CurrentPage))
176+
{
164177
ScrollToCurrentPage();
178+
}
165179
}
166180

167181
protected override void OnLayout(bool changed, int l, int t, int r, int b)

0 commit comments

Comments
 (0)