Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0998efa
[create-pull-request] automated change (#30150)
github-actions[bot] Jun 24, 2025
79de13b
[Testing] Feature Matrix UITest Cases for ProgressBar Control (#29980)
TamilarasanSF4853 Jun 24, 2025
d2aa066
[Testing] Feature matrix UITest Cases for ImageButton Control (#29968)
NafeelaNazhir Jun 24, 2025
20f3d00
[Testing] Fix for flaky device test BlazorWebViewUsesStartPath on Win…
Jun 24, 2025
4471b4e
[Android, iOS] Fix for the Resize method does not dispose the origina…
SyedAbdulAzeemSF4852 Jun 24, 2025
8d533fb
[Testing] Feature matrix UITest Cases for Image Control (#29832)
NafeelaNazhir Jun 24, 2025
d27c94e
[iOS] SwipeView Closes when Content Changes - fix (#29088)
kubaflo Jun 24, 2025
158ed8b
[Android] Removing outdated menu items as Android can delete them aft…
VitalyKnyazev Jun 24, 2025
3ddd054
[Testing] Migration of Compatibility.Core platform-specific unit test…
nivetha-nagalingam Jun 24, 2025
f42ad36
Fix for Handler not disconnected when removing a non-visible page fro…
praveenkumarkarunanithi Jun 24, 2025
7db70b5
[create-pull-request] automated change (#30184)
github-actions[bot] Jun 25, 2025
4e76fae
[Android] Controls Disappear When WebView is Used with Hardware Accel…
praveenkumarkarunanithi Jun 25, 2025
d81425a
[create-pull-request] automated change (#30232)
github-actions[bot] Jun 25, 2025
7fe69a3
[Testing] Feature matrix UITest Cases for Entry Control (#30033)
LogishaSelvarajSF4525 Jun 26, 2025
7f2d2e0
[Testing] Feature Matrix UITest Cases for Switch Control (#29950)
TamilarasanSF4853 Jun 26, 2025
6023e3e
Update Permissions.ios.tvos.watchos.cs (#29180)
kubaflo Jun 26, 2025
ab24f10
Skip useless handler mappings calls while connecting (#27259)
albyrock87 Jun 27, 2025
44c47ef
[Android] Fix OnIdiom threading issue by removing using statements in…
Copilot Jun 27, 2025
9068a17
[iOS] Fix for CarouselView ItemSpacing property in ItemsLayout not wo…
Ahamed-Ali Jun 28, 2025
427d7e6
[iOS] Assign PresentationController.Delegate to handle swipe-to-dismi…
bhavanesh2001 Jun 29, 2025
a11e5bf
Fixed Test case failure in PR 30306 - [6/30/2025] Candidate (#30315)
LogishaSelvarajSF4525 Jul 1, 2025
ef395b4
Fixed Test case(Issue28798) failure in PR 30306 - [6/30/2025] Candida…
LogishaSelvarajSF4525 Jul 4, 2025
e442d5d
Merge branch 'inflight/candidate' into maybe_candidate_into_sr9_no_pr…
PureWeen Jul 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions src/BlazorWebView/tests/MauiDeviceTests/WebViewHelpers.Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ public static async Task WaitForWebViewReady(WebView2 wv2)
{
CoreWebView2 coreWebView2 = null;

// Ensure that the WebView2 runtime is installed and initialized and has a CoreWebView2 instance.
if (wv2?.CoreWebView2 == null)
{
string version = CoreWebView2Environment.GetAvailableBrowserVersionString(null);
if (string.IsNullOrEmpty(version))
{
throw new InvalidOperationException("WebView2 runtime is not installed.");
}
await wv2.EnsureCoreWebView2Async();
}

await Retry(() =>
{
coreWebView2 = wv2.CoreWebView2;
Expand Down
3 changes: 3 additions & 0 deletions src/Controls/src/Core/Element/Element.Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ public partial class Element
{
public static void MapAutomationPropertiesIsInAccessibleTree(IElementHandler handler, Element element)
{
if (handler.IsConnectingHandler() && element.GetValue(AutomationProperties.IsInAccessibleTreeProperty) is null)
return;

Platform.AccessibilityExtensions.SetAutomationPropertiesAccessibilityView(
handler.PlatformView as Microsoft.UI.Xaml.FrameworkElement, element);
}
Expand Down
10 changes: 5 additions & 5 deletions src/Controls/src/Core/Handlers/Items/iOS/ItemsViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ public override void ViewWillLayoutSubviews()
}

base.ViewWillLayoutSubviews();

if (needsCellLayout || // A cell changed its measure
!_laidOut || // We have never laid out
// With no cells, nothing will trigger a layout when bounds change,
// but we still need to properly lay out supplementary views
ItemsSource.ItemCount == 0)
!_laidOut || // We have never laid out
// With no cells, nothing will trigger a layout when bounds change,
// but we still need to properly lay out supplementary views
ItemsSource.ItemCount == 0)
{
// We don't want to mess up with ContentOffset while refreshing, given that's also gonna cause
// a change in the content's offset Y.
Expand Down
6 changes: 4 additions & 2 deletions src/Controls/src/Core/Handlers/Items2/iOS/LayoutFactory2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ public static UICollectionViewLayout CreateCarouselLayout(
NSCollectionLayoutDimension itemHeight = NSCollectionLayoutDimension.CreateFractionalHeight(1);
NSCollectionLayoutDimension groupWidth = NSCollectionLayoutDimension.CreateFractionalWidth(1);
NSCollectionLayoutDimension groupHeight = NSCollectionLayoutDimension.CreateFractionalHeight(1);
nfloat itemSpacing = 0;
NSCollectionLayoutGroup group = null;

var layout = new UICollectionViewCompositionalLayout((sectionIndex, environment) =>
Expand Down Expand Up @@ -325,7 +324,10 @@ public static UICollectionViewLayout CreateCarouselLayout(
}

var section = NSCollectionLayoutSection.Create(group: group);
section.InterGroupSpacing = itemSpacing;
if (itemsView.ItemsLayout is LinearItemsLayout linearItemsLayout)
{
section.InterGroupSpacing = (nfloat)linearItemsLayout.ItemSpacing;
}
section.OrthogonalScrollingBehavior = isHorizontal
? UICollectionLayoutSectionOrthogonalScrollingBehavior.GroupPagingCentered
: UICollectionLayoutSectionOrthogonalScrollingBehavior.None;
Expand Down
11 changes: 10 additions & 1 deletion src/Controls/src/Core/Label/Label.Mapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public partial class Label

// these are really a single property
LabelHandler.Mapper.ReplaceMapping<Label, ILabelHandler>(nameof(Text), MapText);
LabelHandler.Mapper.ReplaceMapping<Label, ILabelHandler>(nameof(FormattedText), MapText);
LabelHandler.Mapper.ReplaceMapping<Label, ILabelHandler>(nameof(FormattedText), MapFormattedText);

LabelHandler.Mapper.ReplaceMapping<Label, ILabelHandler>(nameof(LineBreakMode), MapLineBreakMode);
LabelHandler.Mapper.ReplaceMapping<Label, ILabelHandler>(nameof(MaxLines), MapMaxLines);
Expand Down Expand Up @@ -54,8 +54,17 @@ public static void MapTextType(ILabelHandler handler, Label label) =>
MapTextOrFormattedText(handler, label);
static void MapTextTransform(ILabelHandler handler, Label label) =>
MapTextOrFormattedText(handler, label);
static void MapFormattedText(ILabelHandler handler, Label label)
{
if (label.IsConnectingHandler()) return;

MapText(handler, label);
}

static void MapTextOrFormattedText(ILabelHandler handler, Label label)
{
if (label.IsConnectingHandler()) return;

if (label.HasFormattedTextSpans)
handler.UpdateValue(nameof(FormattedText));
else
Expand Down
1 change: 1 addition & 0 deletions src/Controls/src/Core/NavigationProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ protected virtual void OnRemovePage(Page page)
{
currentInner.RemovePage(page);
}
page?.DisconnectHandlers();
}

Page Pop()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,22 @@ public static void UpdateMenuItems(this AToolbar toolbar,
if (sortedToolbarItems == null || previousMenuItems == null)
return;

var context = mauiContext.Context;
var menu = toolbar.Menu;

// menu items can be deleted by Android after switching activities, removing outdated menu items first
if (menu != null)
{
for (var j = previousMenuItems.Count - 1; j >= 0; j--)
{
var previousMenuItem = previousMenuItems[j];
if (menu.FindItem(previousMenuItem.ItemId) == null)
{
previousMenuItem.Dispose();
previousMenuItems.RemoveAt(j);
}
}
}

foreach (var toolbarItem in previousToolBarItems)
toolbarItem.PropertyChanged -= toolbarItemChanged;

Expand Down
11 changes: 11 additions & 0 deletions src/Controls/tests/DeviceTests/ControlsHandlerTestBase.Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,17 @@ protected bool IsBackButtonVisible(IElementHandler handler)
return false;
}

protected void AssertTranslationMatches(Android.Views.View nativeView, double expectedTranslationX, double expectedTranslationY)
{
var context = nativeView?.Context ?? throw new InvalidOperationException("Context cannot be null.");

var expectedXInPixels = context.ToPixels(expectedTranslationX);
Assert.Equal(expectedXInPixels, nativeView.TranslationX, precision: 1);

var expectedYInPixels = context.ToPixels(expectedTranslationY);
Assert.Equal(expectedYInPixels, nativeView.TranslationY, precision: 1);
}

class WindowTestFragment : Fragment
{
TaskCompletionSource<bool> _taskCompletionSource = new TaskCompletionSource<bool>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,26 @@ Task<bool> GetPlatformIsVisible(ShapeViewHandler boxViewViewHandler)
return nativeView.Visibility == Android.Views.ViewStates.Visible;
});
}

//src/Compatibility/Core/tests/Android/TranslationTests.cs
[Fact]
[Description("The Translation property of a BoxView should match with native Translation")]
public async Task BoxViewTranslationConsistent()
{
var boxView = new BoxView()
{
HeightRequest = 100,
WidthRequest = 200,
TranslationX = 50,
TranslationY = -20
};

var handler = await CreateHandlerAsync<ShapeViewHandler>(boxView);
var nativeView = GetNativeBoxView(handler);
await InvokeOnMainThreadAsync(() =>
{
AssertTranslationMatches(nativeView, boxView.TranslationX, boxView.TranslationY);
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,25 @@ public async Task RotationConsistent()
var platformRotation = await InvokeOnMainThreadAsync(() => platformButton.Rotation);
Assert.Equal(expected, platformRotation);
}

//src/Compatibility/Core/tests/Android/TranslationTests.cs
[Fact]
[Description("The Translation property of a Button should match with native Translation")]
public async Task ButtonTranslationConsistent()
{
var button = new Button()
{
Text = "Button Test",
TranslationX = 50,
TranslationY = -20
};

var handler = await CreateHandlerAsync<ButtonHandler>(button);
var nativeView = GetPlatformButton(handler);
await InvokeOnMainThreadAsync(() =>
{
AssertTranslationMatches(nativeView, button.TranslationX, button.TranslationY);
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,24 @@ Task<bool> GetPlatformIsVisible(CheckBoxHandler checkBoxHandler)
return nativeView.Visibility == Android.Views.ViewStates.Visible;
});
}

//src/Compatibility/Core/tests/Android/TranslationTests.cs
[Fact]
[Description("The Translation property of a CheckBox should match with native Translation")]
public async Task CheckBoxTranslationConsistent()
{
var checkBox = new CheckBox()
{
TranslationX = 50,
TranslationY = -20
};

var handler = await CreateHandlerAsync<CheckBoxHandler>(checkBox);
var nativeView = GetNativeCheckBox(handler);
await InvokeOnMainThreadAsync(() =>
{
AssertTranslationMatches(nativeView, checkBox.TranslationX, checkBox.TranslationY);
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,25 @@ await InvokeOnMainThreadAsync(() =>
Assert.Equal(expectedValue, isEnabled);
});
}

//src/Compatibility/Core/tests/Android/TranslationTests.cs
[Fact]
[Description("The Translation property of a Editor should match with native Translation")]
public async Task EditorTranslationConsistent()
{
var editor = new Editor()
{
Text = "Editor Test",
TranslationX = 50,
TranslationY = -20
};

var handler = await CreateHandlerAsync<EditorHandler>(editor);
var nativeView = GetPlatformControl(handler);
await InvokeOnMainThreadAsync(() =>
{
AssertTranslationMatches(nativeView, editor.TranslationX, editor.TranslationY);
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,5 +164,25 @@ public async Task RotationConsistent()
var platformRotation = await InvokeOnMainThreadAsync(() => platformEntry.Rotation);
Assert.Equal(expected, platformRotation);
}

//src/Compatibility/Core/tests/Android/TranslationTests.cs
[Fact]
[Description("The Translation property of a Entry should match with native Translation")]
public async Task EntryTranslationConsistent()
{
var entry = new Entry()
{
Text = "Entry Test",
TranslationX = 50,
TranslationY = -20
};

var handler = await CreateHandlerAsync<EntryHandler>(entry);
var nativeView = GetPlatformControl(handler);
await InvokeOnMainThreadAsync(() =>
{
AssertTranslationMatches(nativeView, entry.TranslationX, entry.TranslationY);
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,26 @@ await InvokeOnMainThreadAsync(() =>
});
}

//src/Compatibility/Core/tests/Android/TranslationTests.cs
[Fact]
[Description("The Translation property of a Label should match with native Translation")]
public async Task LabelTranslationConsistent()
{
var label = new Label()
{
Text = "Label Test",
TranslationX = 50,
TranslationY = -20
};

var handler = await CreateHandlerAsync<LabelHandler>(label);
var nativeView = GetPlatformLabel(handler);
await InvokeOnMainThreadAsync(() =>
{
AssertTranslationMatches(nativeView, label.TranslationX, label.TranslationY);
});
}

TextView GetPlatformLabel(LabelHandler labelHandler) =>
labelHandler.PlatformView;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,25 @@ Task<bool> GetPlatformIsVisible(SearchBarHandler searchBarHandler)
return nativeView.Visibility == Android.Views.ViewStates.Visible;
});
}

//src/Compatibility/Core/tests/Android/TranslationTests.cs
[Fact]
[Description("The Translation property of a SearchBar should match with native Translation")]
public async Task SearchBarTranslationConsistent()
{
var searchBar = new SearchBar()
{
Text = "SearchBar Test",
TranslationX = 50,
TranslationY = -20
};

var handler = await CreateHandlerAsync<SearchBarHandler>(searchBar);
var nativeView = GetPlatformControl(handler);
await InvokeOnMainThreadAsync(() =>
{
AssertTranslationMatches(nativeView, searchBar.TranslationX, searchBar.TranslationY);
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,25 @@ await InvokeOnMainThreadAsync(() =>
});
}

//src/Compatibility/Core/tests/Android/TranslationTests.cs
[Fact]
[Description("The Translation property of a SwipeView should match with native Translation")]
public async Task SwipeViewTranslationConsistent()
{
var swipeView = new SwipeView()
{
TranslationX = 50,
TranslationY = -20
};

var handler = await CreateHandlerAsync<SwipeViewHandler>(swipeView);
var nativeView = GetPlatformControl(handler);
await InvokeOnMainThreadAsync(() =>
{
AssertTranslationMatches(nativeView, swipeView.TranslationX, swipeView.TranslationY);
});
}

[Fact]
[Description("The IsEnabled of a SwipeView should match with native IsEnabled")]
public async Task VerifySwipeViewIsEnabledProperty()
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ public override string ToString()
new GalleryPageFactory(() => new KeyboardScrollingGridGallery(), "Keyboard Scrolling Gallery - Grid with Star Row"),
new GalleryPageFactory(() => new KeyboardScrollingNonScrollingPageLargeTitlesGallery(), "Keyboard Scrolling Gallery - NonScrolling Page / Large Titles"),
new GalleryPageFactory(() => new KeyboardScrollingNonScrollingPageSmallTitlesGallery(), "Keyboard Scrolling Gallery - NonScrolling Page / Small Titles"),
new GalleryPageFactory(() => new KeyboardScrollingScrollingPageLargeTitlesGallery(), "Keyboard Scrolling Gallery - Scrolling Page / Large Titles"),
new GalleryPageFactory(() => new KeyboardScrollingScrollingPageLargeTitlesGallery(), "Keyboard Scrolling Gallery - Scrolling Page / Large Titles"),
new GalleryPageFactory(() => new KeyboardScrollingScrollingPageSmallTitlesGallery(), "Keyboard Scrolling Gallery - Scrolling Page / Small Titles"),
new GalleryPageFactory(() => new LabelCoreGalleryPage(), "Label Gallery"),
new GalleryPageFactory(() => new ListViewCoreGalleryPage(), "ListView Gallery"),
new GalleryPageFactory(() => new PickerCoreGalleryPage(), "Picker Gallery"),
new GalleryPageFactory(() => new ProgressBarControlPage(), "ProgressBar Feature Matrix"),
new GalleryPageFactory(() => new ProgressBarCoreGalleryPage(), "Progress Bar Gallery"),
new GalleryPageFactory(() => new RadioButtonControlPage(), "RadioButton Feature Matrix"),
new GalleryPageFactory(() => new RadioButtonCoreGalleryPage(), "RadioButton Gallery"),
Expand All @@ -77,6 +78,7 @@ public override string ToString()
new GalleryPageFactory(() => new SliderCoreGalleryPage(), "Slider Gallery"),
new GalleryPageFactory(() => new StepperControlPage(), "Stepper Feature Matrix"),
new GalleryPageFactory(() => new StepperCoreGalleryPage(), "Stepper Gallery"),
new GalleryPageFactory(() => new SwitchControlPage(), "Switch Feature Matrix"),
new GalleryPageFactory(() => new SwitchCoreGalleryPage(), "Switch Gallery"),
new GalleryPageFactory(() => new SwipeViewCoreGalleryPage(), "SwipeView Gallery"),
new GalleryPageFactory(() => new TimePickerCoreGalleryPage(), "Time Picker Gallery"),
Expand All @@ -86,6 +88,9 @@ public override string ToString()
new GalleryPageFactory(() => new CollectionViewFeaturePage(), "CollectionView Feature Matrix"),
new GalleryPageFactory(() => new LabelControlPage(), "Label Feature Matrix"),
new GalleryPageFactory(() => new CarouselViewFeaturePage(), "CarouselView Feature Matrix"),
new GalleryPageFactory(() => new EntryControlPage(), "Entry Feature Matrix"),
new GalleryPageFactory(() => new ImageControlPage(), "Image Feature Matrix"),
new GalleryPageFactory(() => new ImageButtonControlPage(), "ImageButton Feature Matrix"),
new GalleryPageFactory(() => new BoxViewControlPage(), "BoxView Feature Matrix"),
};

Expand Down
Loading