Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/CommunityToolkit.Maui.Camera/CameraManager.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,20 +273,20 @@ public override void OnCaptureSuccess(IImageProxy image)
{
base.OnCaptureSuccess(image);
var img = image.Image;

if (img is null)
{
return;
}

var buffer = GetFirstPlane(img.GetPlanes())?.Buffer;

if (buffer is null)
{
image.Close();
return;
}

var imgData = new byte[buffer.Remaining()];
try
{
Expand Down
4 changes: 2 additions & 2 deletions src/CommunityToolkit.Maui.UnitTests/BaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ protected enum TestDuration
protected BaseTest()
{
CompatibilityCheck.UseCompatibility();

defaultCulture = Thread.CurrentThread.CurrentCulture;
defaultUiCulture = Thread.CurrentThread.CurrentUICulture;

DeviceDisplay.SetCurrent(null);
DeviceInfo.SetCurrent(null);
AppInfo.SetCurrent(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public AppThemeTests()
{
const AppTheme initialAppTheme = AppTheme.Light;
AppInfo.SetCurrent(mockAppInfo = new() { RequestedTheme = initialAppTheme });

Application.Current = app = new Application();

SetAppTheme(initialAppTheme);
Expand Down Expand Up @@ -121,7 +121,7 @@ public void AppThemeResourceUpdatesLabelText()
{
Content = label
};

Assert.Equal("Light Theme", label.Text);

SetAppTheme(AppTheme.Dark);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public MockApplication(IServiceProvider serviceProvider)
DependencyService.Register<ISystemResourcesProvider, MockResourcesProvider>();
#pragma warning restore CS0612 // Type or member is obsolete
}

public IApplication Application => this;
public IServiceProvider Services { get; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public void ImageSourceParentSize_WhenStrokeShapeSet()
avatarView.Layout(new Rect(0, 0, 73, 73));
avatarView.ImageSource.Should().NotBeNull();
avatarView.Content.Should().BeOfType<Image>();

if (avatarView.Content is not Image avatarImage)
{
throw new InvalidCastException($"{nameof(avatarView.Content)} must be of type {nameof(Image)}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public BindingBase ProvideValue(IServiceProvider serviceProvider)
var xmlLineInfo = serviceProvider.GetService(typeof(IXmlLineInfoProvider)) is IXmlLineInfoProvider xmlLineInfoProvider ? xmlLineInfoProvider.XmlLineInfo : null;
throw new XamlParseException($"Resource not found for key {Key}", xmlLineInfo);
}

switch (resource)
{
case AppThemeColor color:
Expand Down