Skip to content

Commit

Permalink
Merge branch 'main' into label-linebreakmode
Browse files Browse the repository at this point in the history
  • Loading branch information
jsuarezruiz authored Mar 10, 2021
2 parents 058e15d + 318f959 commit 6d23291
Show file tree
Hide file tree
Showing 117 changed files with 1,373 additions and 662 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

.nuspec/**/*.dll
.nuspec/**/*.dylib
.nuspec/**/*.so
.XamarinFormsVersionFile.txt

# User-specific files
Expand Down
2 changes: 1 addition & 1 deletion .nuspec/package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ param ($configuration)
dotnet pack $PSScriptRoot\..\Microsoft.Maui-net6.sln `
-c:$configuration `
-p:SymbolPackageFormat=snupkg `
-bl:$PSScriptRoot\..\artifacts\maui.binlog
-bl:$PSScriptRoot/../artifacts/maui.binlog
7 changes: 7 additions & 0 deletions Microsoft.Maui-net6.sln
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Maui.Controls.Sample.Droid-
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Maui.Controls.Sample.iOS-net6", "src\Controls\samples\Controls.Sample.iOS\Maui.Controls.Sample.iOS-net6.csproj", "{1C3439E6-73D7-4F8E-A64A-5448F5CB18DE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Maui.Controls.Sample.MacCatalyst-net6", "src\Controls\samples\Controls.Sample.MacCatalyst\Maui.Controls.Sample.MacCatalyst-net6.csproj", "{D7FE9FD0-144A-4199-93FC-3AD62325F1D6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Maui.Controls.Sample.SingleProject", "src\Controls\samples\Controls.Sample.SingleProject\Maui.Controls.Sample.SingleProject.csproj", "{CB495F62-CFE6-4975-AED8-F26B6C5D0113}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compatibility", "Compatibility", "{123AA89E-1638-4E0E-B828-B8F9F9F906A2}"
Expand Down Expand Up @@ -83,6 +85,10 @@ Global
{1C3439E6-73D7-4F8E-A64A-5448F5CB18DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C3439E6-73D7-4F8E-A64A-5448F5CB18DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1C3439E6-73D7-4F8E-A64A-5448F5CB18DE}.Release|Any CPU.Build.0 = Release|Any CPU
{D7FE9FD0-144A-4199-93FC-3AD62325F1D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7FE9FD0-144A-4199-93FC-3AD62325F1D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7FE9FD0-144A-4199-93FC-3AD62325F1D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7FE9FD0-144A-4199-93FC-3AD62325F1D6}.Release|Any CPU.Build.0 = Release|Any CPU
{CB495F62-CFE6-4975-AED8-F26B6C5D0113}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB495F62-CFE6-4975-AED8-F26B6C5D0113}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB495F62-CFE6-4975-AED8-F26B6C5D0113}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -124,6 +130,7 @@ Global
{B8DC1324-977C-46F1-B697-9064ADE6099A} = {E1082E26-D700-4127-9329-66D673FD2D55}
{BE50FAEF-4096-48B5-B9CE-EE0C38F15A18} = {E1082E26-D700-4127-9329-66D673FD2D55}
{1C3439E6-73D7-4F8E-A64A-5448F5CB18DE} = {E1082E26-D700-4127-9329-66D673FD2D55}
{D7FE9FD0-144A-4199-93FC-3AD62325F1D6} = {E1082E26-D700-4127-9329-66D673FD2D55}
{CB495F62-CFE6-4975-AED8-F26B6C5D0113} = {E1082E26-D700-4127-9329-66D673FD2D55}
{75C380E0-CE53-4C01-B89F-CF685331DE18} = {459BF674-83CB-46F6-881F-A2D2117DBF4D}
{39B47A3C-21CA-4B28-9250-14FD957EB0FC} = {94F3C036-A5F4-4ACC-A028-8506802ADB88}
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/common/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ steps:
provisioning_script: $(provisionator.path)
provisioning_extra_args: $(provisionator.extraArguments)

- pwsh: |
- powershell: |
$(System.DefaultWorkingDirectory)/build.ps1 --target provision --TeamProject="$(System.TeamProject)"
displayName: 'Cake Provision'
condition: eq(variables['provisioningCake'], 'true')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-android</TargetFrameworks>
<RootNamespace>Microsoft.Maui.Controls.Android</RootNamespace>
<AssemblyName>Microsoft.Maui.Controls.Android.FormsViewGroup</AssemblyName>
<RootNamespace>Microsoft.Maui.Controls.Compatibility.Android</RootNamespace>
<AssemblyName>Microsoft.Maui.Controls.Compatibility.Android.FormsViewGroup</AssemblyName>
<OutputType>Library</OutputType>
<Nullable>disable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedJar Include="Jars\formsviewgroup.jar" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<TransformFile Include="Transforms\Metadata.xml" />
<EmbeddedJar Include="Jars\*.jar" />
<TransformFile Include="Transforms\*.xml" />
</ItemGroup>
</Project>

Original file line number Diff line number Diff line change
@@ -1,63 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="MSBuild.Sdk.Extras">
<PropertyGroup>
<TargetFrameworks>$(AndroidTargetFrameworks)</TargetFrameworks>
<RootNamespace>Microsoft.Maui.Controls.Compatibility.Android</RootNamespace>
<AssemblyName>Microsoft.Maui.Controls.Compatibility.Android.FormsViewGroup</AssemblyName>
<AndroidCodeGenTarget>XAJavaInterop1</AndroidCodeGenTarget>
<RootNamespace>Microsoft.Maui.Controls.Android</RootNamespace>
</PropertyGroup>
<PropertyGroup>
<AndroidClassParser>class-parse</AndroidClassParser>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3B72465B-ACAE-43AE-9327-10F372FE5F80}</ProjectGuid>
<ProjectTypeGuids>{10368E6C-D01B-4462-8E8B-01FC667A7035};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FormsViewGroup</RootNamespace>
<AssemblyName>FormsViewGroup</AssemblyName>
<FileAlignment>512</FileAlignment>
<TargetFrameworkVersion>v10.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>CS0109</NoWarn>
<IsBindingProject>true</IsBindingProject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>CS0109</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedJar Include="Jars\formsviewgroup.jar" />
</ItemGroup>
<ItemGroup>
<TransformFile Include="Transforms\Metadata.xml" />
<EmbeddedJar Include="Jars\*.jar" />
<TransformFile Include="Transforms\*.xml" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.Bindings.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='CursorLoader']/method[@name='loadInBackground']" />
-->

<attr path="/api/package[@name='com.xamarin.forms.platform.android']" name="managedName">Microsoft.Maui.Controls.Android</attr>
<attr path="/api/package[@name='com.xamarin.formsviewgroup']" name="managedName">Microsoft.Maui.Controls.Android</attr>
<attr path="/api/package[@name='com.xamarin.forms.platform.android']" name="managedName">Microsoft.Maui.Controls.Compatibility</attr>
<attr path="/api/package[@name='com.xamarin.formsviewgroup']" name="managedName">Microsoft.Maui.Controls.Compatibility</attr>
</metadata>
4 changes: 4 additions & 0 deletions src/Compatibility/Core/src/Android/Renderers/EntryRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ void ITextWatcher.BeforeTextChanged(ICharSequence s, int start, int count, int a
{
}

[PortHandler]
void ITextWatcher.OnTextChanged(ICharSequence s, int start, int before, int count)
{
Internals.TextTransformUtilites.SetPlainText(Element, s?.ToString());
Expand Down Expand Up @@ -212,6 +213,7 @@ protected override void Dispose(bool disposing)
base.Dispose(disposing);
}

[PortHandler]
protected virtual void UpdatePlaceHolderText()
{
if (EditText.Hint == Element.Placeholder)
Expand Down Expand Up @@ -516,6 +518,7 @@ void SetSelectionLengthFromRenderer(int selectionLength)
}
}

[PortHandler]
protected virtual void UpdateIsReadOnly()
{
bool isReadOnly = !Element.IsReadOnly;
Expand All @@ -524,6 +527,7 @@ protected virtual void UpdateIsReadOnly()
EditText.Focusable = isReadOnly;
}

[PortHandler("Ported Text setter")]
void UpdateText()
{
var text = Element.UpdateFormsText(Element.Text, Element.TextTransform);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using AndroidX.Core.View;
using Microsoft.Maui.Controls.Compatibility.Platform.Android.FastRenderers;
using AView = Android.Views.View;
using Microsoft.Maui.Controls.Android;
using Microsoft.Maui.Controls.Internals;

namespace Microsoft.Maui.Controls.Compatibility.Platform.Android
Expand Down
6 changes: 3 additions & 3 deletions src/Compatibility/Core/src/Android/VisualElementTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void UpdateLayout()
var width = Math.Max(0, (int)_context.ToPixels(view.Width));
var height = Math.Max(0, (int)_context.ToPixels(view.Height));

var formsViewGroup = aview as Controls.Android.FormsViewGroup;
var formsViewGroup = aview as FormsViewGroup;
if (formsViewGroup == null)
{
Performance.Start(reference, "Measure");
Expand Down Expand Up @@ -348,7 +348,7 @@ void UpdateNativeView(object sender, EventArgs e)
VisualElement view = _renderer.Element;
AView aview = _renderer.View;

if (aview is Controls.Android.FormsViewGroup formsViewGroup)
if (aview is FormsViewGroup formsViewGroup)
{
formsViewGroup.SendBatchUpdate((float)(view.AnchorX * _context.ToPixels(view.Width)),
(float)(view.AnchorY * _context.ToPixels(view.Height)),
Expand All @@ -365,7 +365,7 @@ void UpdateNativeView(object sender, EventArgs e)
}
else
{
Controls.Android.FormsViewGroup.SendViewBatchUpdate(aview,
FormsViewGroup.SendViewBatchUpdate(aview,
(float)(view.AnchorX * _context.ToPixels(view.Width)),
(float)(view.AnchorY * _context.ToPixels(view.Height)),
(int)(view.IsVisible ? ViewStates.Visible : ViewStates.Invisible),
Expand Down
5 changes: 5 additions & 0 deletions src/Compatibility/Core/src/iOS/Renderers/EntryRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,14 @@ void OnEditingBegan(object sender, EventArgs e)
ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, true);
}

[PortHandler("Ported Text setter")]
void OnEditingChanged(object sender, EventArgs eventArgs)
{
ElementController.SetValueFromRenderer(Entry.TextProperty, Control.Text);
UpdateCursorFromControl(null);
}

[PortHandler("Ported Text setter")]
void OnEditingEnded(object sender, EventArgs e)
{
// Typing aid changes don't always raise EditingChanged event
Expand Down Expand Up @@ -334,6 +336,7 @@ void UpdatePassword()
Control.SecureTextEntry = Element.IsPassword;
}

[PortHandler]
protected virtual void UpdatePlaceholder()
{
var formatted = (FormattedString)Element.Placeholder;
Expand Down Expand Up @@ -361,6 +364,7 @@ protected virtual void UpdatePlaceholder()
protected virtual void UpdateAttributedPlaceholder(NSAttributedString nsAttributedString) =>
Control.AttributedPlaceholder = nsAttributedString;

[PortHandler]
void UpdateText()
{
var text = Element.UpdateFormsText(Element.Text, Element.TextTransform);
Expand Down Expand Up @@ -546,6 +550,7 @@ void SetSelectionLengthFromRenderer(int selectionLength)
}
}

[PortHandler]
void UpdateIsReadOnly()
{
Control.UserInteractionEnabled = !Element.IsReadOnly;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,34 +68,15 @@
<ItemGroup>
<Compile Include="MainActivity.cs" />
<Compile Include="MainApplication.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Properties\AndroidManifest.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\values\colors.xml" />
<AndroidResource Include="Resources\values\dimens.xml" />
<AndroidResource Include="Resources\values\ic_launcher_background.xml" />
<AndroidResource Include="Resources\values\strings.xml" />
<AndroidResource Include="Resources\values\styles.xml" />
<AndroidResource Include="Resources\mipmap-anydpi-v26\ic_launcher.xml" />
<AndroidResource Include="Resources\mipmap-anydpi-v26\ic_launcher_round.xml" />
<AndroidResource Include="Resources\mipmap-hdpi\ic_launcher.png" />
<AndroidResource Include="Resources\mipmap-hdpi\ic_launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-hdpi\ic_launcher_round.png" />
<AndroidResource Include="Resources\mipmap-mdpi\ic_launcher.png" />
<AndroidResource Include="Resources\mipmap-mdpi\ic_launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-mdpi\ic_launcher_round.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\ic_launcher.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\ic_launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\ic_launcher_round.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\ic_launcher.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\ic_launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\ic_launcher_round.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\ic_launcher.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\ic_launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\ic_launcher_round.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-android</TargetFramework>
<OutputType>Exe</OutputType>
<RootNamespace>Maui.Controls.Sample.Droid</RootNamespace>
<AssemblyName>Maui.Controls.Sample.Droid</AssemblyName>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Properties\AssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\Core\src\Core-net6.csproj" />
<ProjectReference Include="..\..\..\Compatibility\Core\src\Compatibility-net6.csproj" />
<ProjectReference Include="..\Controls.Sample\Maui.Controls.Sample-net6.csproj" />
<PackageReference Include="Xamarin.AndroidX.Browser" />
</ItemGroup>

<!--
The linker resolves some assembly references too eagerly, and
fails when it can't find them, so work around this by referencing
Expand All @@ -32,4 +32,5 @@
<PackageReference Include="System.Security.Permissions" Version="$(_DotNetPackageVersion)" />
<PackageReference Include="System.Threading.AccessControl" Version="$(_DotNetPackageVersion)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.microsoft.maui">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"></application>
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:label="@string/app_name" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true" android:theme="@style/AppTheme"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="app_name">Maui</string>
<string name="app_name">Controls</string>
<string name="action_settings">Settings</string>
</resources>
Loading

0 comments on commit 6d23291

Please sign in to comment.