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
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,4 @@
<MicrosoftiOSSdkPackageVersion>$(MicrosoftiOSSdknet90_180PackageVersion)</MicrosoftiOSSdkPackageVersion>
<MicrosofttvOSSdkPackageVersion>$(MicrosofttvOSSdknet90_180PackageVersion)</MicrosofttvOSSdkPackageVersion>
</PropertyGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using CoreGraphics;
using Foundation;
using Microsoft.Maui.Controls.Compatibility;
using Microsoft.Maui.Controls.Compatibility.iOS.Resources;
Expand Down Expand Up @@ -33,19 +34,15 @@ static ContextActionsCell()
{
var rect = new RectangleF(0, 0, 1, 1);
var size = rect.Size;

UIGraphics.BeginImageContext(size);
var context = UIGraphics.GetCurrentContext();
context.SetFillColor(Microsoft.Maui.Platform.ColorExtensions.Red.CGColor);
context.FillRect(rect);
DestructiveBackground = UIGraphics.GetImageFromCurrentImageContext();

context.SetFillColor(Microsoft.Maui.Platform.ColorExtensions.LightGray.CGColor);
context.FillRect(rect);

NormalBackground = UIGraphics.GetImageFromCurrentImageContext();

context.Dispose();
using var renderer = new UIGraphicsImageRenderer(size);
DestructiveBackground = renderer.CreateImage((UIGraphicsImageRendererContext ctx) =>
{
FillRect(ctx, rect, ColorExtensions.Red.CGColor);
});
NormalBackground = renderer.CreateImage((UIGraphicsImageRendererContext ctx) =>
{
FillRect(ctx, rect, ColorExtensions.LightGray.CGColor);
});
}

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

static void FillRect(UIGraphicsImageRendererContext ctx, RectangleF rect, CGColor color)
{
var context = ctx.CGContext;
context.SetFillColor(color);
context.FillRect(rect);
}

public override void LayoutSubviews()
{
base.LayoutSubviews();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static UIImage GetBackgroundImage(this UIView control, Brush brush)

var backgroundLayer = control.GetBackgroundLayer(brush);

if (backgroundLayer is null)
if (backgroundLayer is null || backgroundLayer.Bounds.Size.Width <= 0 || backgroundLayer.Bounds.Size.Height <= 0)
{
return null;
}
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.None, 26593, "Table View ContextActionCell Test")]
public class ContextActionCellTest : TestContentPage
{
TableSection dataSection;
TableView tableView;

protected override void Init()
{
dataSection = new TableSection {
new TextCell{ Text = "Text Cell", ContextActions = { new MenuItem{ Text = "Save" } } },
new TextCell{ Text = "Text Cell 1" },
new SwitchCell { Text = "Switch Cell", On = true },
};

tableView = new TableView
{
Root = new TableRoot { dataSection }
};

Content = tableView;
}
}
51 changes: 51 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/FlyoutTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.None, 26593, "FlyoutTest", PlatformAffected.iOS)]
public partial class FlyoutTest : TestShell
{

Tab tabOne = new Tab { Title = "TabOne" };
Tab tabTwo = new Tab { Title = "TabTwo " };
protected override void Init()
{
var tabOnePage = new ContentPage();
var stackLayout = new StackLayout();
stackLayout.Children.Add(new Label { Text = "Tab 1 Page", AutomationId = "Tab1Page", HorizontalOptions = LayoutOptions.Center });
tabOnePage.Content = stackLayout;
tabOne.Items.Add(tabOnePage);

var button = new Button();
button.Text = "Change Flyout Background";
button.AutomationId = "ChangeFlyoutBackground";
button.Clicked += ButtonClicked;
stackLayout.Children.Add(button);

var tabTwoPage = new ContentPage();
var stackLayout2 = new StackLayout();
stackLayout2.Children.Add(new Label { Text = "Tab 2 Page", HorizontalOptions = LayoutOptions.Center });
tabTwoPage.Content = stackLayout2;
tabTwo.Items.Add(tabTwoPage);

var flyoutItem = new FlyoutItem
{
Title = "Tab 1",
Icon = "bank.png",
Items = { tabOne }
};

var flyoutItem2 = new FlyoutItem
{
Title = "Tab 2",
Icon = "coffee.png",
Items = { tabTwo }
};
Items.Add(flyoutItem);
Items.Add(flyoutItem2);
}

private void ButtonClicked(object sender, EventArgs e)
{
SetValue(Shell.FlyoutBackgroundProperty, Colors.LightBlue);
}

}
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
@@ -0,0 +1,29 @@
#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST // Using ActivateContextMenu internally does a right click and is not working correctly.
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class ContextActionCellTest : _IssuesUITest
{
public ContextActionCellTest(TestDevice testDevice) : base(testDevice)
{
}

public override string Issue => "Table View ContextActionCell Test";

[Test]
[Category(UITestCategories.TableView)]
public void VerifyContextActionCell()
{
App.WaitForElement("Text Cell");
#if IOS
App.SwipeRightToLeft("Text Cell", 25, 500);
#elif ANDROID
App.LongPress("Text Cell");
#endif
VerifyScreenshot();
}
}
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class FlyoutTest : _IssuesUITest
{
public override string Issue => "FlyoutTest";

public FlyoutTest(TestDevice device)
: base(device)
{ }

[Test]
[Category(UITestCategories.Shell), Order(1)]
public void VerifyHamburgerIcon()
{
App.WaitForElement("Tab1Page");
VerifyScreenshot();
}

[Test]
[Category(UITestCategories.Shell), Order(2)]
public void VerifyFlyoutBackgroundColor()
{
App.WaitForElement("Tab1Page");
App.Tap("ChangeFlyoutBackground");
App.TapShellFlyoutIcon();
VerifyScreenshot();
}
}
}
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