This commit is contained in:
Shane Neuville 2019-12-19 10:33:17 -07:00
Родитель adcff975e8 44dd779647
Коммит 1cf7a4bf71
13 изменённых файлов: 149 добавлений и 45 удалений

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

@ -182,30 +182,11 @@
<!--UWP-->
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP.dll" target="lib\uap10.0" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP.*pdb" target="lib\uap10.0" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP.pri" target="lib\uap10.0" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\Xamarin.Forms.Platform.UAP.xr.xml" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform\bin\$Configuration$\netstandard1.0\Xamarin.Forms.Platform.dll" target="lib\uap10.0" />
<file src="..\Xamarin.Forms.Platform\bin\$Configuration$\netstandard1.0\Xamarin.Forms.Platform.*pdb" target="lib\uap10.0" />
<file src="..\Xamarin.Forms.Platform.UAP\Properties\Xamarin.Forms.Platform.UAP.rd.xml" target="lib\uap10.0\Xamarin.Forms.Platform.UAP\Properties" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\FormsFlyout.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\FormsCommandBarStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\FormsProgressBarStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\Resources.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\FormsTextBoxStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\AutoSuggestStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\SliderStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\MasterDetailControlStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\PageControlStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\TabbedPageStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\FormsEmbeddedPageWrapper.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\StepperControl.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\CollectionView\ItemsViewStyles.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP\CollectionView" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\FormsCheckBoxStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\Microsoft.UI.Xaml\DensityStyles\Compact.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP\Microsoft.UI.Xaml\DensityStyles\" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\Shell\ShellStyles.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP\Shell" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\PickerStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP\Microsoft.UI.Xaml\Themes\generic.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP\Microsoft.UI.Xaml\Themes\" />
<file src="..\Xamarin.Forms.Platform.UAP\Properties\Xamarin.Forms.Platform.UAP.rd.xml" target="lib\uap10.0\Properties" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\uap10.0.14393\Xamarin.Forms.Platform.UAP.pri" target="lib\uap10.0" />
<!--Mac-->
<file src="..\Xamarin.Forms.Core\bin\$Configuration$\netstandard2.0\Xamarin.Forms.Core.dll" target="lib\Xamarin.Mac" />

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

@ -0,0 +1,65 @@
using Xamarin.Forms.Internals;
using Xamarin.Forms.CustomAttributes;
#if UITEST
using Xamarin.Forms.Core.UITests;
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.Button)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 7875, "Button size changes when setting Accessibility properties", PlatformAffected.Android)]
public class Issue7875 : TestContentPage
{
public Issue7875()
{
Title = "Issue 7875";
var layout = new Grid();
layout.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
layout.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
layout.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
var instructions = new Label
{
BackgroundColor = Color.Black,
TextColor = Color.White,
Text = "If the buttons below have the same size, the test has passed."
};
layout.Children.Add(instructions, 0, 0);
var button = new Button
{
BackgroundColor = Color.Gray,
HorizontalOptions = LayoutOptions.Center,
ImageSource = "calculator.png",
Text = "Text"
};
layout.Children.Add(button, 0, 1);
var accesibilityButton = new Button
{
BackgroundColor = Color.Gray,
HorizontalOptions = LayoutOptions.Center,
ImageSource = "calculator.png",
Text = "Text"
};
accesibilityButton.SetValue(AutomationProperties.NameProperty, "AccesibilityButton");
accesibilityButton.SetValue(AutomationProperties.HelpTextProperty, "Help Large Text");
layout.Children.Add(accesibilityButton, 0, 2);
Content = layout;
}
protected override void Init()
{
}
}
}

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

@ -1204,6 +1204,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Issue8672.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue8326.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue8449.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue7875.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Bugzilla22229.xaml">

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

@ -8,7 +8,6 @@
<SkipMicrosoftUIXamlCheckTargetPlatformVersion>true</SkipMicrosoftUIXamlCheckTargetPlatformVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<GenerateLibraryLayout>true</GenerateLibraryLayout>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>

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

@ -1,3 +1,4 @@
using Android.Content;
using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
namespace Xamarin.Forms.Platform.Android
@ -11,9 +12,7 @@ namespace Xamarin.Forms.Platform.Android
return;
}
var iec = element as IElementConfiguration<VisualElement>;
var elevation = iec?.On<PlatformConfiguration.Android>().GetElevation();
var elevation = GetElevation(element, view.Context);
if (!elevation.HasValue)
{
return;
@ -32,7 +31,7 @@ namespace Xamarin.Forms.Platform.Android
return view.Elevation;
}
internal static float? GetElevation(VisualElement element)
internal static float? GetElevation(VisualElement element, Context context)
{
if (element == null || !Forms.IsLollipopOrNewer)
{
@ -42,7 +41,10 @@ namespace Xamarin.Forms.Platform.Android
var iec = element as IElementConfiguration<VisualElement>;
var elevation = iec?.On<PlatformConfiguration.Android>().GetElevation();
return elevation;
if (elevation == null)
return elevation;
return context.ToPixels(elevation.Value);
}
}
}

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

@ -124,7 +124,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
return false;
}
if (Element is Picker)
if (Element is Picker || Element is Button)
{
return false;
}

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

@ -82,10 +82,26 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
{
((IElementController)Button).SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, hasFocus);
}
SizeRequest IVisualElementRenderer.GetDesiredSize(int widthConstraint, int heightConstraint)
{
return _buttonLayoutManager.GetDesiredSize(widthConstraint, heightConstraint);
if (_isDisposed)
{
return new SizeRequest();
}
var hint = Control.Hint;
if (!string.IsNullOrWhiteSpace(hint))
{
Control.Hint = string.Empty;
}
var result = _buttonLayoutManager.GetDesiredSize(widthConstraint, heightConstraint);
Control.Hint = hint;
return result;
}
void IVisualElementRenderer.SetElement(VisualElement element)

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

@ -177,7 +177,7 @@ namespace Xamarin.Forms.Platform.Android
if (Forms.IsLollipopOrNewer)
{
var elevation = ElevationHelper.GetElevation(r.View) ?? 0;
var elementElevation = ElevationHelper.GetElevation(element);
var elementElevation = ElevationHelper.GetElevation(element, r.View.Context);
if (elementElevation == null)
{

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

@ -216,6 +216,8 @@ namespace Xamarin.Forms.Platform.UWP
void UpdateTitle()
{
Control.Header = null;
Control.HeaderTemplate = string.IsNullOrEmpty(Element.Title) ? null : (Windows.UI.Xaml.DataTemplate)Windows.UI.Xaml.Application.Current.Resources["ComboBoxHeader"];
Control.DataContext = Element;
}
}

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

@ -8,7 +8,7 @@
<SkipMicrosoftUIXamlCheckTargetPlatformVersion>true</SkipMicrosoftUIXamlCheckTargetPlatformVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<GenerateLibraryLayout>true</GenerateLibraryLayout>
<GenerateLibraryLayout Condition="'$(MSBuildAssemblyVersion)' != '16.0'">true</GenerateLibraryLayout>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>

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

@ -70,6 +70,21 @@ jobs:
buildConfiguration: $(DefaultBuildConfiguration)
buildPlatform: $(DefaultBuildPlatform)
provisionatorPath : 'build/provisioning/provisioning.csx'
includeUwp: 'false'
- template: build/steps/build-windows.yml
parameters:
name: win_2019
displayName: Build UWP Phase
vmImage: $(win2019VmImage)
targetFolder: Xamarin.Forms.ControlGallery.Android/legacyRenderers/
msbuildExtraArguments: '/nowarn:VSX1000 /p:CreateAllAndroidTargets=true'
buildConfiguration: $(DefaultBuildConfiguration)
buildPlatform: $(DefaultBuildPlatform)
provisionatorPath : 'build/provisioning/provisioning.csx'
slnPath: '.Xamarin.Forms.UAP.nuget.sln'
includeNonUwp: 'false'
- template: build/steps/build-android.yml
parameters:
@ -125,6 +140,7 @@ jobs:
displayName: Nuget Phase
dependsOn:
- win
- win_2019
condition: succeeded()
pool:
name: $(winVmImage)

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

@ -222,6 +222,11 @@ Task("Build")
{
try{
MSBuild("./Xamarin.Forms.sln", GetMSBuildSettings().WithRestore());
MSBuild("./Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj",
GetMSBuildSettings()
.WithRestore()
.WithProperty("DisableEmbeddedXbf", "true"));
}
catch(Exception)
{

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

@ -8,6 +8,7 @@ parameters:
preBuildSteps: [] # any steps to run before the build
postBuildSteps: [] # any additional steps to run after the build
slnPath : 'Xamarin.Forms.sln'
csprojPath : 'Xamarin.Forms.Platform.UAP\Xamarin.Forms.Platform.UAP.csproj'
buildConfiguration : 'Debug'
releaseBuildConfiguration : 'Release'
buildPlatform : 'any cpu'
@ -16,6 +17,8 @@ parameters:
artifactsName: 'win_build'
nunitTestAdapterFolder: 'packages/NUnitTestAdapter.AnyVersion/build/'
nunitTestFolder: '$(build.sourcesdirectory)'
includeUwp: 'true'
includeNonUwp: 'true'
jobs:
- job: ${{ parameters.name }}
@ -73,6 +76,15 @@ jobs:
configuration: '$(BuildConfiguration)'
msbuildArguments: ${{ parameters.msbuildExtraArguments }} /bl:$(Build.ArtifactStagingDirectory)\win-$(BuildConfiguration).binlog
- task: MSBuild@1
displayName: 'Embed XBF into PRI'
condition: eq(${{ parameters.includeUwp }}, 'true')
name: winbuild_pri_embed
inputs:
solution: ${{ parameters.csprojPath }}
configuration: '$(BuildConfiguration)'
msbuildArguments: ${{ parameters.msbuildExtraArguments }} /t:rebuild /p:DisableEmbeddedXbf=false /bl:$(Build.ArtifactStagingDirectory)\win-$(BuildConfiguration)-csproj.binlog
- task: VSTest@2
displayName: 'Unit Tests'
inputs:
@ -84,11 +96,11 @@ jobs:
codeCoverageEnabled: true
testRunTitle: '$(BuildConfiguration)_UnitTests'
configuration: '$(BuildConfiguration)'
vsTestVersion: '15.0'
diagnosticsEnabled: true
- task: CopyFiles@2
displayName: 'Copy Files dlls'
condition: eq(${{ parameters.includeNonUwp }}, 'true')
inputs:
Contents: |
Stubs/**/bin/**/*.dll
@ -123,13 +135,6 @@ jobs:
Xamarin.Forms.Material.Tizen/bin/$(BuildConfiguration)/**/*.dll
Xamarin.Forms.Material.Tizen/bin/$(BuildConfiguration)/**/*.pdb
Xamarin.Forms.Material.Tizen/bin/$(BuildConfiguration)/**/*.mdb
Xamarin.Forms.Platform.WP8/bin/$(BuildConfiguration)/**/*.dll
Xamarin.Forms.Platform.UAP/bin/$(BuildConfiguration)/**/*.pdb
Xamarin.Forms.Platform.UAP/bin/$(BuildConfiguration)/**/*.dll
Xamarin.Forms.Platform.UAP/bin/$(BuildConfiguration)/**/*.pri
Xamarin.Forms.Platform.UAP/bin/$(BuildConfiguration)/**/*.xr.xml
Xamarin.Forms.Platform.UAP/bin/$(BuildConfiguration)/**/*.xbf
Xamarin.Forms.Platform.UAP/Properties/Xamarin.Forms.Platform.UAP.rd.xml
Xamarin.Forms.Platform.MacOS/bin/$(BuildConfiguration)/**/*.dll
Xamarin.Forms.Platform.MacOS/bin/$(BuildConfiguration)/**/*.mdb
Xamarin.Forms.Maps/bin/$(BuildConfiguration)/**/*.dll
@ -138,11 +143,6 @@ jobs:
Xamarin.Forms.Maps.Android/bin/$(BuildConfiguration)/**/*.dll
Xamarin.Forms.Maps.iOS/bin/iPhoneSimulator/$(BuildConfiguration)/**/*.dll
Xamarin.Forms.Maps.MacOS/bin/$(BuildConfiguration)/**/*.dll
Xamarin.Forms.Maps.WP8/bin/$(BuildConfiguration)/**/*.dll
Xamarin.Forms.Maps.UWP/bin/$(BuildConfiguration)/**/*.dll
Xamarin.Forms.Maps.UWP/bin/$(BuildConfiguration)/**/*.pdb
Xamarin.Forms.Maps.UWP/bin/$(BuildConfiguration)/**/*.pri
Xamarin.Forms.Maps.UWP/bin/$(BuildConfiguration)/**/*.xbf
Xamarin.Forms.Pages/bin/$(BuildConfiguration)/**/*.dll
Xamarin.Forms.Pages/bin/$(BuildConfiguration)/**/*.pdb
Xamarin.Forms.Pages/bin/$(BuildConfiguration)/**/*.mdb
@ -183,6 +183,23 @@ jobs:
TargetFolder: ${{ parameters.artifactsTargetFolder }}
- task: CopyFiles@2
displayName: 'Copy UWP'
condition: eq(${{ parameters.includeUwp }}, 'true')
inputs:
Contents: |
Xamarin.Forms.Platform.UAP/bin/$(BuildConfiguration)/**/*.pdb
Xamarin.Forms.Platform.UAP/bin/$(BuildConfiguration)/**/*.dll
Xamarin.Forms.Platform.UAP/bin/$(BuildConfiguration)/**/*.pri
Xamarin.Forms.Platform.UAP/bin/$(BuildConfiguration)/**/*.xr.xml
Xamarin.Forms.Platform.UAP/Properties/Xamarin.Forms.Platform.UAP.rd.xml
Xamarin.Forms.Maps.UWP/bin/$(BuildConfiguration)/**/*.dll
Xamarin.Forms.Maps.UWP/bin/$(BuildConfiguration)/**/*.pdb
Xamarin.Forms.Maps.UWP/bin/$(BuildConfiguration)/**/*.pri
Xamarin.Forms.Maps.UWP/bin/$(BuildConfiguration)/**/*.xbf
TargetFolder: ${{ parameters.artifactsTargetFolder }}
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: ${{ parameters.artifactsName }}'
condition: always()