Merge branch '4.0.0' into 4.1.0

This commit is contained in:
Rui Marinho 2019-06-29 15:18:41 +01:00
Родитель 4d09f7698a 40961c12b6
Коммит de5e14c8b6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 924E81B5DB553385
5 изменённых файлов: 70 добавлений и 7 удалений

Просмотреть файл

@ -0,0 +1,55 @@
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.Forms.Core.UITests;
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 6614, "[Android] Tabindex Calculation crashing when calculating on Layout", PlatformAffected.Android)]
public class Issue6614 : TestContentPage
{
Button _button = null;
string _instruction1 = "Turn on Screen Reader and click me.";
protected override void Init()
{
_button = new Button()
{
Text = _instruction1,
Command = new Command(() =>
{
if(Content is ContentView currentContentView)
{
var currentContent = currentContentView.Content;
currentContentView.Content = null;
this.Content = currentContent;
_button.Text = "Success";
}
else
{
var currentContent = this.Content;
var contentView = new ContentView();
this.Content = contentView;
contentView.Content = currentContent;
_button.Text = "Click me one more time";
}
}),
TabIndex = 1
};
Content = new StackLayout()
{
Children =
{
_button
}
};
}
}
}

Просмотреть файл

@ -977,6 +977,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Issue6368.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue6077.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue3548.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue6614.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Bugzilla22229.xaml">
@ -1272,7 +1273,7 @@
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue5268.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
</Project>

Просмотреть файл

@ -187,7 +187,13 @@ namespace Xamarin.Forms
OnPropertyChanging();
if (RealParent != null)
{
((IElement)RealParent).RemoveResourcesChangedListener(OnParentResourcesChanged);
if(value != null && (RealParent is Layout || RealParent is IControlTemplated))
Log.Warning("Element", $"{this} is already a child of {RealParent}. Remove {this} from {RealParent} before adding to {value}.");
}
RealParent = value;
if (RealParent != null)
{

Просмотреть файл

@ -16,7 +16,7 @@ namespace Xamarin.Forms
{
countChildrensWithTabStopWithoutThis = 0;
Element parentPage = (element as NavigableElement).Parent;
Element parentPage = (element as Element)?.Parent;
while (parentPage != null && !(parentPage is Page))
parentPage = parentPage.Parent;
@ -26,7 +26,7 @@ namespace Xamarin.Forms
descendantsOnPage = shell.Items;
if (descendantsOnPage == null)
return null;
return new Dictionary<int, List<ITabStopElement>>();
var childrensWithTabStop = new List<ITabStopElement>();
foreach (var descendant in descendantsOnPage)
@ -34,8 +34,9 @@ namespace Xamarin.Forms
if (descendant is ITabStopElement visualElement && visualElement.IsTabStop)
childrensWithTabStop.Add(visualElement);
}
if (checkContainsElement && !childrensWithTabStop.Contains(element))
return null;
return new Dictionary<int, List<ITabStopElement>>();
countChildrensWithTabStopWithoutThis = childrensWithTabStop.Count - 1;
return childrensWithTabStop.GroupToDictionary(c => c.TabIndex);

Просмотреть файл

@ -1,10 +1,10 @@
namespace Xamarin.Forms.Platform.iOS
namespace Xamarin.Forms.Platform.iOS
{
public class CarouselViewRenderer
public class CarouselViewRenderer : ItemsViewRenderer
{
public CarouselViewRenderer()
{
CollectionView.VerifyCollectionViewFlagEnabled(nameof(CarouselViewRenderer));
}
}
}
}