Skip to content

Commit b095e3d

Browse files
authored
[2025/06/02] Candidate - In Flight Branch (#29754)
For more information about inflight process check https://github.com/dotnet/maui/wiki/Inflight-Branch-Process
2 parents cc8b096 + 2b2b6d0 commit b095e3d

File tree

348 files changed

+4423
-476
lines changed

Some content is hidden

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

348 files changed

+4423
-476
lines changed

Directory.Build.targets

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,7 @@
125125
</ItemGroup>
126126
</Target>
127127

128+
<!-- Tell typescript to stop deleting everything before building the next TFM -->
129+
<Target Name="TypeScriptDeleteOutputFromOtherConfigs" />
130+
128131
</Project>

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,4 @@
216216
<MicrosoftiOSSdkPackageVersion>$(MicrosoftiOSSdknet90_180PackageVersion)</MicrosoftiOSSdkPackageVersion>
217217
<MicrosofttvOSSdkPackageVersion>$(MicrosofttvOSSdknet90_180PackageVersion)</MicrosofttvOSSdkPackageVersion>
218218
</PropertyGroup>
219-
</Project>
219+
</Project>

eng/pipelines/common/ui-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ parameters:
3131
- 'ScrollView,SearchBar,Shape,Slider,SoftInput,Stepper,Switch,SwipeView'
3232
- 'Shell'
3333
- 'TabbedPage,TableView,TimePicker,TitleView,ToolbarItem'
34-
- 'ViewBaseTests,Visual,WebView,Window'
34+
- 'Shadow,ViewBaseTests,Visual,WebView,Window'
3535

3636
projects:
3737
- name: name

src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
<ItemGroup>
7979
<EmbeddedResource Include="Resources\Embedded\*" />
8080
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
81+
<MauiAsset Include="..\..\..\Core\src\Handlers\HybridWebView\HybridWebView.js" LogicalName="HybridSamplePage\scripts\HybridWebView.js" />
8182
<MauiImage Include="Resources\Images\*" />
8283
<MauiImage Update="Resources\Images\*.gif" Resize="false" />
8384
<MauiIcon Include="Resources\AppIcons\appicon.svg" ForegroundFile="Resources\AppIcons\appicon_foreground.svg" />

src/Controls/samples/Controls.Sample/Resources/Raw/HybridSamplePage/scripts/HybridWebView.js

Lines changed: 0 additions & 145 deletions
This file was deleted.

src/Controls/src/Core/Compatibility/Handlers/ListView/iOS/ContextActionCell.cs

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Collections.Generic;
44
using System.Collections.Specialized;
55
using System.ComponentModel;
6+
using CoreGraphics;
67
using Foundation;
78
using Microsoft.Maui.Controls.Compatibility;
89
using Microsoft.Maui.Controls.Compatibility.iOS.Resources;
@@ -33,19 +34,15 @@ static ContextActionsCell()
3334
{
3435
var rect = new RectangleF(0, 0, 1, 1);
3536
var size = rect.Size;
36-
37-
UIGraphics.BeginImageContext(size);
38-
var context = UIGraphics.GetCurrentContext();
39-
context.SetFillColor(Microsoft.Maui.Platform.ColorExtensions.Red.CGColor);
40-
context.FillRect(rect);
41-
DestructiveBackground = UIGraphics.GetImageFromCurrentImageContext();
42-
43-
context.SetFillColor(Microsoft.Maui.Platform.ColorExtensions.LightGray.CGColor);
44-
context.FillRect(rect);
45-
46-
NormalBackground = UIGraphics.GetImageFromCurrentImageContext();
47-
48-
context.Dispose();
37+
using var renderer = new UIGraphicsImageRenderer(size);
38+
DestructiveBackground = renderer.CreateImage((UIGraphicsImageRendererContext ctx) =>
39+
{
40+
FillRect(ctx, rect, ColorExtensions.Red.CGColor);
41+
});
42+
NormalBackground = renderer.CreateImage((UIGraphicsImageRendererContext ctx) =>
43+
{
44+
FillRect(ctx, rect, ColorExtensions.LightGray.CGColor);
45+
});
4946
}
5047

5148
public ContextActionsCell() : base(UITableViewCellStyle.Default, Key)
@@ -84,6 +81,13 @@ public void Close()
8481
_scroller.ContentOffset = new PointF(0, 0);
8582
}
8683

84+
static void FillRect(UIGraphicsImageRendererContext ctx, RectangleF rect, CGColor color)
85+
{
86+
var context = ctx.CGContext;
87+
context.SetFillColor(color);
88+
context.FillRect(rect);
89+
}
90+
8791
public override void LayoutSubviews()
8892
{
8993
base.LayoutSubviews();

src/Controls/src/Core/Compatibility/Handlers/Shell/Android/SearchHandlerAppearanceTracker.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public SearchHandlerAppearanceTracker(IShellSearchView searchView, IShellContext
3838
UpdateHorizontalTextAlignment();
3939
UpdateVerticalTextAlignment();
4040
UpdateInputType();
41+
UpdateCharacterSpacing();
4142
}
4243

4344
protected virtual void SearchHandlerPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
@@ -90,6 +91,17 @@ protected virtual void SearchHandlerPropertyChanged(object sender, System.Compon
9091
{
9192
UpdateText();
9293
}
94+
else if (e.Is(SearchHandler.CharacterSpacingProperty))
95+
{
96+
UpdateCharacterSpacing();
97+
}
98+
}
99+
void UpdateCharacterSpacing()
100+
{
101+
if (_editText is not null)
102+
{
103+
_editText.LetterSpacing = _searchHandler.CharacterSpacing.ToEm();
104+
}
93105
}
94106

95107
void UpdateText()

src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellToolbarTracker.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,8 @@ protected virtual async void UpdateLeftBarButtonItem(Context context, AToolbar t
410410
var text = backButtonHandler.GetPropertyIfSet(BackButtonBehavior.TextOverrideProperty, String.Empty);
411411
var command = backButtonHandler.GetPropertyIfSet<ICommand>(BackButtonBehavior.CommandProperty, null);
412412
bool isEnabled = _shell.Toolbar.BackButtonEnabled;
413-
var image = GetFlyoutIcon(backButtonHandler, page);
413+
//Add the FlyoutIcon only if the FlyoutBehavior is Flyout
414+
var image = _flyoutBehavior == FlyoutBehavior.Flyout ? GetFlyoutIcon(backButtonHandler, page) : null;
414415
var backButtonVisible = _toolbar.BackButtonVisible;
415416

416417
DrawerArrowDrawable icon = null;

src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ void SearchHandlerPropertyChanged(object sender, System.ComponentModel.PropertyC
119119
{
120120
UpdateText(_uiSearchBar.FindDescendantView<UITextField>());
121121
}
122+
else if (e.Is(SearchHandler.CharacterSpacingProperty))
123+
{
124+
UpdateCharacterSpacing(_uiSearchBar.FindDescendantView<UITextField>());
125+
}
122126
}
123127

124128
void UpdateText(UITextField uiTextField)
@@ -128,6 +132,27 @@ void UpdateText(UITextField uiTextField)
128132

129133
uiTextField.Text = _searchHandler.Query;
130134
UpdateTextTransform(uiTextField);
135+
UpdateCharacterSpacing(uiTextField);
136+
}
137+
138+
void UpdateCharacterSpacing(UITextField textField)
139+
{
140+
if (textField is null)
141+
{
142+
return;
143+
}
144+
145+
var attributedText = textField.AttributedText?.WithCharacterSpacing(_searchHandler.CharacterSpacing);
146+
if (attributedText is not null)
147+
{
148+
textField.AttributedText = attributedText;
149+
}
150+
151+
var placeholderAttributedText = textField.AttributedPlaceholder?.WithCharacterSpacing(_searchHandler.CharacterSpacing);
152+
if (placeholderAttributedText is not null)
153+
{
154+
textField.AttributedPlaceholder = placeholderAttributedText;
155+
}
131156
}
132157

133158
void GetDefaultSearchBarColors(UISearchBar searchBar)

src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellPageRendererTracker.cs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,11 @@ void UpdateLeftToolbarItems()
336336

337337
if (String.IsNullOrWhiteSpace(text) && image == null)
338338
{
339-
image = _context.Shell.FlyoutIcon;
339+
//Add the FlyoutIcon only if the FlyoutBehavior is Flyout
340+
if (_flyoutBehavior == FlyoutBehavior.Flyout)
341+
{
342+
image = _context.Shell.FlyoutIcon;
343+
}
340344
}
341345

342346
if (!IsRootPage)
@@ -803,7 +807,14 @@ void SearchButtonClicked(object sender, EventArgs e)
803807

804808
void SetSearchBarIcon(UISearchBar searchBar, ImageSource source, UISearchBarIcon icon)
805809
{
806-
source.LoadImage(source.FindMauiContext(), image =>
810+
var mauiContext = source.FindMauiContext(true);
811+
812+
if (mauiContext is null)
813+
{
814+
return;
815+
}
816+
817+
source.LoadImage(mauiContext, image =>
807818
{
808819
var result = image?.Value;
809820
if (result != null)
@@ -829,6 +840,11 @@ void OnPageLoaded(object sender, EventArgs e)
829840
}
830841

831842
UpdateToolbarItemsInternal();
843+
844+
//UIKIt will try to override our colors when the SearchController is inside the NavigationBar
845+
//Best way was to force them to be set again when page is loaded / ViewDidLoad
846+
_searchHandlerAppearanceTracker?.UpdateSearchBarColors();
847+
832848
CheckAppeared();
833849
}
834850

@@ -850,9 +866,6 @@ void SetAppeared()
850866
return;
851867

852868
_isVisiblePage = true;
853-
//UIKIt will try to override our colors when the SearchController is inside the NavigationBar
854-
//Best way was to force them to be set again when page is Appearing / ViewDidLoad
855-
_searchHandlerAppearanceTracker?.UpdateSearchBarColors();
856869
UpdateShellToMyPage();
857870

858871
if (_context.Shell.Toolbar != null)

0 commit comments

Comments
 (0)