зеркало из https://github.com/DeGsoft/maui-linux.git
Merge branch '15-5'
This commit is contained in:
Коммит
c2f576abe1
|
@ -16,7 +16,7 @@
|
|||
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
|
||||
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
|
|
|
@ -46,9 +46,14 @@ namespace Xamarin.Forms.Build.Tasks
|
|||
}
|
||||
}
|
||||
|
||||
if (parentNode is IElementNode && IsResourceDictionary((IElementNode)parentNode))
|
||||
//Only proceed further if the node is a keyless RD
|
||||
if ( parentNode is IElementNode
|
||||
&& IsResourceDictionary((IElementNode)parentNode)
|
||||
&& !((IElementNode)parentNode).Properties.ContainsKey(XmlName.xKey))
|
||||
node.Accept(new SetPropertiesVisitor(Context, stopOnResourceDictionary: false), parentNode);
|
||||
else if (parentNode is ListNode && IsResourceDictionary((IElementNode)parentNode.Parent))
|
||||
else if ( parentNode is ListNode
|
||||
&& IsResourceDictionary((IElementNode)parentNode.Parent)
|
||||
&& !((IElementNode)parentNode.Parent).Properties.ContainsKey(XmlName.xKey))
|
||||
node.Accept(new SetPropertiesVisitor(Context, stopOnResourceDictionary: false), parentNode);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
using Xamarin.Forms.CustomAttributes;
|
||||
using Xamarin.Forms.Internals;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#if UITEST
|
||||
using Xamarin.UITest;
|
||||
using NUnit.Framework;
|
||||
#endif
|
||||
|
||||
namespace Xamarin.Forms.Controls.Issues
|
||||
{
|
||||
[Preserve(AllMembers = true)]
|
||||
[Issue(IssueTracker.Bugzilla, 60563, "ActivityIndicator in ListView causes SIGSEGV crash in iOS 8", PlatformAffected.iOS)]
|
||||
public class Bugzilla60563 : TestNavigationPage
|
||||
{
|
||||
const string btnGoToList = "btnGoToList";
|
||||
const string spinner = "spinner";
|
||||
|
||||
protected override void Init()
|
||||
{
|
||||
Navigation.PushAsync(new NavigationPage(new StartPage()));
|
||||
}
|
||||
|
||||
[Preserve(AllMembers = true)]
|
||||
class ListPage : ContentPage
|
||||
{
|
||||
public ListPage()
|
||||
{
|
||||
Title = "List";
|
||||
Content = new ListView
|
||||
{
|
||||
HasUnevenRows = false,
|
||||
RowHeight = 50,
|
||||
ItemTemplate = new DataTemplate(() => { return new SpinnerViewCell(); }),
|
||||
ItemsSource = new List<int> { 1, 2, 3, 4, 5 },
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
[Preserve(AllMembers = true)]
|
||||
class SpinnerViewCell : ViewCell
|
||||
{
|
||||
public SpinnerViewCell()
|
||||
{
|
||||
var indicator = new ActivityIndicator
|
||||
{
|
||||
IsRunning = true,
|
||||
AutomationId = spinner
|
||||
};
|
||||
var layout = new RelativeLayout();
|
||||
layout.Children.Add(indicator, x: () => 0, y: () => 0);
|
||||
View = indicator;
|
||||
}
|
||||
}
|
||||
|
||||
[Preserve(AllMembers = true)]
|
||||
class StartPage : ContentPage
|
||||
{
|
||||
public StartPage()
|
||||
{
|
||||
var button = new Button
|
||||
{
|
||||
Text = "Go To List",
|
||||
BackgroundColor = Color.Beige,
|
||||
HeightRequest = 40,
|
||||
WidthRequest = 100,
|
||||
VerticalOptions = LayoutOptions.Center,
|
||||
HorizontalOptions = LayoutOptions.Center,
|
||||
AutomationId = btnGoToList
|
||||
};
|
||||
button.Clicked += (sender, e) => Navigation.PushAsync(new ListPage());
|
||||
|
||||
Title = "Home";
|
||||
Content = new StackLayout { Children = { new Label { Text = "Click the button to go to a ListView with an ActivityIndicator, then go back to this page. If the app does not crash, this test has passed." }, button } };
|
||||
}
|
||||
}
|
||||
|
||||
#if UITEST && __IOS__
|
||||
[Test]
|
||||
public void Bugzilla60563Test()
|
||||
{
|
||||
RunningApp.WaitForElement(q => q.Marked(btnGoToList));
|
||||
RunningApp.Tap(q => q.Marked(btnGoToList));
|
||||
RunningApp.WaitForElement(q => q.Marked(spinner));
|
||||
RunningApp.Back();
|
||||
RunningApp.WaitForElement(q => q.Marked(btnGoToList));
|
||||
RunningApp.Tap(q => q.Marked(btnGoToList));
|
||||
RunningApp.WaitForElement(q => q.Marked(spinner));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -102,10 +102,19 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
void DisposeSubviews(UIView view)
|
||||
{
|
||||
foreach (UIView subView in view.Subviews)
|
||||
DisposeSubviews(subView);
|
||||
var ver = view as IVisualElementRenderer;
|
||||
|
||||
if (ver == null)
|
||||
{
|
||||
// VisualElementRenderers should implement their own dispose methods that will appropriately dispose and remove their child views.
|
||||
// Attempting to do this work twice could cause a SIGSEGV (only observed in iOS8), so don't do this work here.
|
||||
// Non-renderer views, such as separator lines, etc., can be removed here.
|
||||
foreach (UIView subView in view.Subviews)
|
||||
DisposeSubviews(subView);
|
||||
|
||||
view.RemoveFromSuperview();
|
||||
}
|
||||
|
||||
view.RemoveFromSuperview();
|
||||
view.Dispose();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="Xamarin.Forms.Xaml.UnitTests.Bz60788">
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary x:Key="RedTextBlueBackground">
|
||||
<Style TargetType="StackLayout">
|
||||
<Setter Property="BackgroundColor" Value="Blue" />
|
||||
</Style>
|
||||
<Style TargetType="Label">
|
||||
<Setter Property="TextColor" Value="Red" />
|
||||
</Style>
|
||||
<Color x:Key="notpink">Purple</Color>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="BlueTextRedBackground">
|
||||
<Style TargetType="StackLayout">
|
||||
<Setter Property="BackgroundColor" Value="Red" />
|
||||
</Style>
|
||||
<Style TargetType="Label">
|
||||
<Setter Property="TextColor" Value="Blue" />
|
||||
</Style>
|
||||
<Color x:Key="notpink">Purple</Color>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
</ContentPage>
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using NUnit.Framework;
|
||||
using Xamarin.Forms.Core.UnitTests;
|
||||
|
||||
namespace Xamarin.Forms.Xaml.UnitTests
|
||||
{
|
||||
public partial class Bz60788 : ContentPage
|
||||
{
|
||||
public Bz60788()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public Bz60788(bool useCompiledXaml)
|
||||
{
|
||||
//this stub will be replaced at compile time
|
||||
}
|
||||
|
||||
[TestFixture]
|
||||
class Tests
|
||||
{
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
Device.PlatformServices = new MockPlatformServices();
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
Device.PlatformServices = null;
|
||||
}
|
||||
|
||||
[TestCase(true), TestCase(false)]
|
||||
public void KeyedRDWithImplicitStyles(bool useCompiledXaml)
|
||||
{
|
||||
var layout = new Bz60788(useCompiledXaml);
|
||||
Assert.That(layout.Resources.Count, Is.EqualTo(2));
|
||||
Assert.That(((ResourceDictionary)layout.Resources["RedTextBlueBackground"]).Count, Is.EqualTo(3));
|
||||
Assert.That(((ResourceDictionary)layout.Resources["BlueTextRedBackground"]).Count, Is.EqualTo(3));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -47,10 +47,14 @@ namespace Xamarin.Forms.Xaml
|
|||
}
|
||||
}
|
||||
|
||||
//Only proceed further if the node is a RD
|
||||
if (parentNode is IElementNode && typeof(ResourceDictionary).IsAssignableFrom(Context.Types[((IElementNode)parentNode)]))
|
||||
//Only proceed further if the node is a keyless RD
|
||||
if ( parentNode is IElementNode
|
||||
&& typeof(ResourceDictionary).IsAssignableFrom(Context.Types[((IElementNode)parentNode)])
|
||||
&& !((IElementNode)parentNode).Properties.ContainsKey(XmlName.xKey))
|
||||
node.Accept(new ApplyPropertiesVisitor(Context, stopOnResourceDictionary: false), parentNode);
|
||||
else if (parentNode is ListNode && typeof(ResourceDictionary).IsAssignableFrom(Context.Types[((IElementNode)parentNode.Parent)]))
|
||||
else if ( parentNode is ListNode
|
||||
&& typeof(ResourceDictionary).IsAssignableFrom(Context.Types[((IElementNode)parentNode.Parent)])
|
||||
&& !((IElementNode)parentNode.Parent).Properties.ContainsKey(XmlName.xKey))
|
||||
node.Accept(new ApplyPropertiesVisitor(Context, stopOnResourceDictionary: false), parentNode);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче