Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into maps-events
Browse files Browse the repository at this point in the history
  • Loading branch information
roubachof committed Oct 30, 2019
2 parents e1d06fa + 4fe1dab commit 6982bd8
Show file tree
Hide file tree
Showing 478 changed files with 16,667 additions and 2,851 deletions.
7 changes: 7 additions & 0 deletions .create-stubs.bat
Expand Up @@ -146,6 +146,13 @@ echo foo > Xamarin.Forms.Platform.UAP\bin\%CONFIG%\FormsEmbeddedPageWrapper.xbf
echo foo > Xamarin.Forms.Platform.UAP\bin\%CONFIG%\StepperControl.xbf
echo foo > Xamarin.Forms.Platform.UAP\bin\%CONFIG%\FormsCheckBoxStyle.xbf

mkdir Xamarin.Forms.Platform.UAP\bin\%CONFIG%\Microsoft.UI.Xaml
mkdir Xamarin.Forms.Platform.UAP\bin\%CONFIG%\Microsoft.UI.Xaml\DensityStyles
echo foo > Xamarin.Forms.Platform.UAP\bin\%CONFIG%\Microsoft.UI.Xaml\DensityStyles\Compact.xbf

mkdir Xamarin.Forms.Platform.UAP\bin\%CONFIG%\Shell
echo foo > Xamarin.Forms.Platform.UAP\bin\%CONFIG%\Shell\ShellStyles.xbf

mkdir Xamarin.Forms.Platform.UAP\bin\%CONFIG%\CollectionView\
echo foo > Xamarin.Forms.Platform.UAP\bin\%CONFIG%\CollectionView\ItemsViewStyles.xbf

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -69,3 +69,4 @@ caketools/
*.binlog
.ionide/**
/.nuspec
.XamarinFormsVersionFile.txt
1 change: 1 addition & 0 deletions .nuspec/Xamarin.Forms.nuspec
Expand Up @@ -225,6 +225,7 @@
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\CollectionView\ItemsViewStyles.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP\CollectionView" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\FormsCheckBoxStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\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$\Shell\ShellStyles.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP\Shell" />

<!--Mac-->
<file src="..\Xamarin.Forms.Core\bin\$Configuration$\netstandard2.0\Xamarin.Forms.Core.dll" target="lib\Xamarin.Mac" />
Expand Down
5 changes: 4 additions & 1 deletion .nuspec/proguard.cfg
@@ -1,4 +1,7 @@
-keep class android.support.v7.widget.FitWindowsFrameLayout { *; }
-dontwarn android.support.v7.widget.FitWindowsFrameLayout
-keep class android.support.design.** { *; }
-keep class android.support.multidex.MultiDexApplication { *; }
-keep class android.support.multidex.MultiDexApplication { *; }
-keep class android.support.design.internal.BaselineLayout { *; }
-dontwarn android.support.design.internal.BaselineLayout
-keep class com.google.firebase.provider.FirebaseInitProvider { *; }
3 changes: 2 additions & 1 deletion EmbeddingTestBeds/Embedding.UWP/Embedding.UWP.csproj
Expand Up @@ -11,8 +11,9 @@
<AssemblyName>Embedding.UWP</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<SkipMicrosoftUIXamlCheckTargetPlatformVersion>true</SkipMicrosoftUIXamlCheckTargetPlatformVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
Expand Down
2 changes: 1 addition & 1 deletion GitInfo.txt
@@ -1 +1 @@
4.4.0
4.5.0
3 changes: 2 additions & 1 deletion PagesGallery/PagesGallery.UWP/PagesGallery.UWP.csproj
Expand Up @@ -11,8 +11,9 @@
<AssemblyName>PagesGallery.UWP</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<SkipMicrosoftUIXamlCheckTargetPlatformVersion>true</SkipMicrosoftUIXamlCheckTargetPlatformVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile>
<FileAlignment>512</FileAlignment>
Expand Down
10 changes: 10 additions & 0 deletions README.md
Expand Up @@ -110,6 +110,16 @@ Make sure you have nuget.exe 4.0 or above and the latest dotnet core sdk (2.0.3)

### UI Tests ###

##### Run Android UI Tests #####

Depending on your environment setup, you might need to configure a few things before being able to debug / run UI tests, especially on Windows.

- If you receive an error about ANDROID_HOME, please make sure to set your environment variable to the Android SDK directory (e.g. C:\Program Files (x86)\Android\android-sdk).
- If you receive an error about JAVA_HOME, please install the latest Java JDK and set your environment variable to the JDK directory (e.g. C:\Program Files\Java\jdk-13).
- If you receive an error about a missing ApkFile, please generate an APK file for Xamarin.Forms.ControlGallery.Android. The easiest way to do this is to right click the project and select "Deploy". Note that if you rebuild the solution, you might lose the APK and will need to generate it again.

After these steps are taken care of, you should be good to go. You can see all UI tests in Test Explorer, search them for your own convenience, and quickly run individual tests.

##### Run UWP UI Tests #####

To run the UWP UI Tests:
Expand Down
21 changes: 14 additions & 7 deletions Stubs/Xamarin.Forms.Platform.cs
Expand Up @@ -51,29 +51,36 @@ internal class _ImageRenderer { }
[RenderWith (typeof (ButtonRenderer))]
internal class _ButtonRenderer { }

#if __ANDROID__
[RenderWith(typeof(ImageButtonRenderer))]
#elif !TIZEN4_0
[RenderWith(typeof(ImageButtonRenderer))]
#endif
internal class _ImageButtonRenderer { }

[RenderWith (typeof (TableViewRenderer))]
internal class _TableViewRenderer { }

[RenderWith (typeof (ListViewRenderer))]
internal class _ListViewRenderer { }
#if !TIZEN4_0
#if !TIZEN4_0
[RenderWith (typeof (CollectionViewRenderer))]
#else
[RenderWith (typeof (ItemsViewRenderer))]
#endif
internal class _CollectionViewRenderer { }

#if !TIZEN4_0
[RenderWith (typeof (CarouselViewRenderer))]
internal class _CarouselViewRenderer { }
#endif
internal class _CarouselViewRenderer { }

[RenderWith (typeof (SliderRenderer))]
internal class _SliderRenderer { }

[RenderWith (typeof (WebViewRenderer))]
#if __IOS__
[RenderWith (typeof (WkWebViewRenderer))]
internal class _WebViewRenderer { }
#else
[RenderWith(typeof(WebViewRenderer))]
internal class _WebViewRenderer { }
#endif

[RenderWith (typeof (SearchBarRenderer))]
internal class _SearchBarRenderer { }
Expand Down
7 changes: 7 additions & 0 deletions Version.targets
Expand Up @@ -55,6 +55,13 @@
</ItemGroup>

<Message Condition="$(CI) and '$(BUILD_REASON)' == 'Schedule'" Importance="high" Text="##vso[build.addbuildtag]$(NightlyTag)"/>
<ItemGroup>
<XamarinFormsVersionFile Include="../.XamarinFormsVersionFile.txt"/>
<XamarinFormsVersionLine Include="$(PackageVersion)"/>
</ItemGroup>

<!-- Occasionally this throws an error from parallel builds writing to this file. It's fine if only one of them wins. -->
<WriteLinesToFile ContinueOnError="WarnAndContinue" File="@(XamarinFormsVersionFile)" Lines="@(XamarinFormsVersionLine)" Overwrite="true" />
<Message Condition="$(CI)" Importance="high" Text="##vso[build.updatebuildnumber]$(PackageVersion)"/>
<Message Condition="$(CI)" Importance="high" Text="##vso[task.setvariable variable=XamarinFormsPackageVersion;isOutput=true;]$(PackageVersion)"/>
</Target>
Expand Down
Expand Up @@ -34,10 +34,9 @@ public static TypeReference GetBindablePropertyType(this FieldReference bpRef, I

public static TypeReference GetBindablePropertyTypeConverter(this FieldReference bpRef, ModuleDefinition module)
{
TypeReference propertyDeclaringType;
var owner = bpRef.DeclaringType;
var bpName = bpRef.Name.EndsWith("Property", StringComparison.Ordinal) ? bpRef.Name.Substring(0, bpRef.Name.Length - 8) : bpRef.Name;
var property = owner.GetProperty(pd => pd.Name == bpName, out propertyDeclaringType);
var property = owner.GetProperty(pd => pd.Name == bpName, out TypeReference propertyDeclaringType);
var propertyType = property?.PropertyType?.ResolveGenericParameters(propertyDeclaringType);
var staticGetter = owner.GetMethods(md => md.Name == $"Get{bpName}" &&
md.IsStatic &&
Expand All @@ -52,8 +51,8 @@ public static TypeReference GetBindablePropertyTypeConverter(this FieldReference
attributes.AddRange(propertyType.ResolveCached().CustomAttributes);
if (staticGetter != null && staticGetter.HasCustomAttributes)
attributes.AddRange(staticGetter.CustomAttributes);
if (staticGetter != null && staticGetter.ReturnType.ResolveCached().HasCustomAttributes)
attributes.AddRange(staticGetter.ReturnType.ResolveCached().CustomAttributes);
if (staticGetter != null && staticGetter.ReturnType.ResolveGenericParameters(bpRef.DeclaringType).ResolveCached().HasCustomAttributes)
attributes.AddRange(staticGetter.ReturnType.ResolveGenericParameters(bpRef.DeclaringType).ResolveCached().CustomAttributes);

return attributes.FirstOrDefault(cad => TypeConverterAttribute.TypeConvertersType.Contains(cad.AttributeType.FullName))?.ConstructorArguments [0].Value as TypeReference;
}
Expand Down
17 changes: 16 additions & 1 deletion Xamarin.Forms.Build.Tasks/SetPropertiesVisitor.cs
Expand Up @@ -495,7 +495,22 @@ static IList<(PropertyDefinition property, TypeReference propDeclTypeRef, string
if (indexArg != null) {
var defaultMemberAttribute = previousPartTypeRef.GetCustomAttribute(module, ("mscorlib", "System.Reflection", "DefaultMemberAttribute"));
var indexerName = defaultMemberAttribute?.ConstructorArguments?.FirstOrDefault().Value as string ?? "Item";
var indexer = previousPartTypeRef.GetProperty(pd => pd.Name == indexerName && pd.GetMethod != null && pd.GetMethod.IsPublic, out var indexerDeclTypeRef);
PropertyDefinition indexer = null;
TypeReference indexerDeclTypeRef = null;
if (int.TryParse(indexArg, out _))
indexer = previousPartTypeRef.GetProperty(pd => pd.Name == indexerName
&& pd.GetMethod != null
&& TypeRefComparer.Default.Equals(pd.GetMethod.Parameters[0].ParameterType.ResolveGenericParameters(previousPartTypeRef), module.ImportReference(("mscorlib", "System", "Int32")))
&& pd.GetMethod.IsPublic, out indexerDeclTypeRef);
indexer = indexer ?? previousPartTypeRef.GetProperty(pd => pd.Name == indexerName
&& pd.GetMethod != null
&& TypeRefComparer.Default.Equals(pd.GetMethod.Parameters[0].ParameterType.ResolveGenericParameters(previousPartTypeRef), module.ImportReference(("mscorlib", "System", "String")))
&& pd.GetMethod.IsPublic, out indexerDeclTypeRef);
indexer = indexer ?? previousPartTypeRef.GetProperty(pd => pd.Name == indexerName
&& pd.GetMethod != null
&& TypeRefComparer.Default.Equals(pd.GetMethod.Parameters[0].ParameterType.ResolveGenericParameters(previousPartTypeRef), module.ImportReference(("mscorlib", "System", "Object")))
&& pd.GetMethod.IsPublic, out indexerDeclTypeRef);

properties.Add((indexer, indexerDeclTypeRef, indexArg));
var indexType = indexer.GetMethod.Parameters[0].ParameterType.ResolveGenericParameters(indexerDeclTypeRef);
if (!TypeRefComparer.Default.Equals(indexType, module.TypeSystem.String) && !TypeRefComparer.Default.Equals(indexType, module.TypeSystem.Int32))
Expand Down
6 changes: 2 additions & 4 deletions Xamarin.Forms.Build.Tasks/TypeReferenceExtensions.cs
Expand Up @@ -11,11 +11,9 @@ class TypeRefComparer : IEqualityComparer<TypeReference>
{
static string GetAssembly(TypeReference typeRef)
{
var md = typeRef.Scope as ModuleDefinition;
if (md != null)
if (typeRef.Scope is ModuleDefinition md)
return md.Assembly.FullName;
var anr = typeRef.Scope as AssemblyNameReference;
if (anr != null)
if (typeRef.Scope is AssemblyNameReference anr)
return anr.FullName;
throw new ArgumentOutOfRangeException(nameof(typeRef));
}
Expand Down
10 changes: 9 additions & 1 deletion Xamarin.Forms.ControlGallery.Android/FormsAppCompatActivity.cs
Expand Up @@ -10,6 +10,7 @@
using Xamarin.Forms.Platform.Android;
using Xamarin.Forms.Platform.Android.AppLinks;
using System.Linq;
using Xamarin.Forms.Internals;

namespace Xamarin.Forms.ControlGallery.Android
{
Expand All @@ -32,6 +33,8 @@ public partial class Activity1 : FormsAppCompatActivity
{
protected override void OnCreate(Bundle bundle)
{
Profile.Start();

ToolbarResource = Resource.Layout.Toolbar;
TabLayoutResource = Resource.Layout.Tabbar;

Expand Down Expand Up @@ -90,7 +93,12 @@ protected override void OnCreate(Bundle bundle)
}
}


protected override void OnResume()
{
base.OnResume();
Profile.Stop();
}

[Export("IsPreAppCompat")]
public bool IsPreAppCompat()
{
Expand Down
13 changes: 11 additions & 2 deletions Xamarin.Forms.ControlGallery.Android/Resources/values/styles.xml
Expand Up @@ -9,7 +9,7 @@
<style name="MyTheme" parent="MyTheme.Base">
</style>
<!-- Base theme applied no matter what API -->
<style name="MyTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="MyTheme.Base" parent="Theme.AppCompat.DayNight.DarkActionBar">
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
<item name="windowNoTitle">true</item>
<!--We will be using the toolbar so no need to show ActionBar-->
Expand All @@ -27,7 +27,12 @@
<item name="windowActionModeOverlay">true</item>

<item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>


<!-- Styles Android.App.AlertDialog -->
<item name="android:alertDialogTheme">@style/DayNightDialogStyle</item>
<!-- Styles Android.Support.V7.App.AlertDialog -->
<item name="alertDialogTheme">@style/DayNightDialogStyle</item>

<!--Uncomment to test exceptionally red button-->
<!--<item name="android:buttonStyle">@style/red_button_style</item>-->
</style>
Expand All @@ -36,6 +41,10 @@
<item name="colorAccent">#FF4081</item>
</style>

<style name="DayNightDialogStyle" parent="Theme.AppCompat.DayNight.Dialog.Alert">
<item name="colorAccent">#00FF21</item>
</style>

<style name="TestStyle" parent="@android:style/Theme.Holo.Light.DarkActionBar">
</style>

Expand Down
Expand Up @@ -23,6 +23,7 @@
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<AndroidEnableMultiDex>true</AndroidEnableMultiDex>
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DefineConstants>HAVE_OPENTK</DefineConstants>
Expand All @@ -40,8 +41,9 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
<EmbedAssembliesIntoApk>False</EmbedAssembliesIntoApk>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<AndroidSupportedAbis>armeabi-v7a;x86</AndroidSupportedAbis>
<Debugger>Xamarin</Debugger>
<DevInstrumentationEnabled>True</DevInstrumentationEnabled>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -53,10 +55,15 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(TF_BUILD)' == 'true' OR '$(CI)' == 'true'">
<AndroidLinkMode>Full</AndroidLinkMode>
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
<AndroidSupportedAbis>armeabi-v7a,x86</AndroidSupportedAbis>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AndroidEnableMultiDex>true</AndroidEnableMultiDex>
</PropertyGroup>
<PropertyGroup Condition=" '$(CI)' == 'True' ">
<AndroidLinkMode>Full</AndroidLinkMode>
Expand Down Expand Up @@ -372,6 +379,11 @@
<ItemGroup>
<AndroidEnvironment Include="Environment.txt" />
</ItemGroup>
<ItemGroup>
<ProguardConfiguration Include="..\.nuspec\proguard.cfg">
<Link>proguard.cfg</Link>
</ProguardConfiguration>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="BeforeBuild">
Expand All @@ -380,4 +392,4 @@
</CreateItem>
<Copy SourceFiles="@(MapsKey)" DestinationFiles="Properties\MapsKey.cs" Condition="!Exists('Properties\MapsKey.cs')" />
</Target>
</Project>
</Project>
Expand Up @@ -29,7 +29,7 @@ protected override void OnElementChanged(Platform.Android.ElementChangedEventArg
var nativeButton = (global::Android.Widget.Button)Control;
nativeButton.SetShadowLayer(0, 0, 0, global::Android.Graphics.Color.Transparent);

nativeButton.Elevation = 0;
Platform.Android.ViewExtensions.SetElevation(nativeButton, 0);
}
}
}
Expand Down
Binary file not shown.
Expand Up @@ -104,6 +104,7 @@
</EmbeddedResource>
<Resource Include="Assets\fontawesome-webfont.ttf" />
<Resource Include="Assets\pickax.ttf" />
<Resource Include="Assets\ionicons.ttf" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down
1 change: 1 addition & 0 deletions Xamarin.Forms.ControlGallery.WindowsUniversal/App.xaml.cs
Expand Up @@ -70,6 +70,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)

rootFrame.NavigationFailed += OnNavigationFailed;

Forms.SetFlags("Shell_UWP_Experimental");
Forms.Init (e);
//FormsMaps.Init (Controls.App.Config["UWPMapsAuthKey"]);

Expand Down
Binary file not shown.

0 comments on commit 6982bd8

Please sign in to comment.