Skip to content

Commit

Permalink
Merge branch 'main' into net7.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	eng/Version.Details.xml
  • Loading branch information
mattleibow committed Sep 12, 2022
2 parents 3145349 + e31ac8b commit dcd91ec
Show file tree
Hide file tree
Showing 17 changed files with 159 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
"version": "1.0.0-prerelease.22451.1",
"version": "1.0.0-prerelease.22456.1",
"commands": [
"xharness"
]
Expand Down
12 changes: 6 additions & 6 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,17 @@
<Uri>https://github.com/dotnet/templating</Uri>
<Sha>3f4da9ced34942d83054e647f3b1d9d7dde281e8</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="1.0.0-prerelease.22429.1">
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="1.0.0-prerelease.22456.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>919daad8a314e5b0e16f15db62352c367a306c85</Sha>
<Sha>55e8420fb913c035522bbb30e28d4fd7181ecd69</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.22451.1">
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.22456.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>919daad8a314e5b0e16f15db62352c367a306c85</Sha>
<Sha>55e8420fb913c035522bbb30e28d4fd7181ecd69</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="1.0.0-prerelease.22451.1">
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="1.0.0-prerelease.22456.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>919daad8a314e5b0e16f15db62352c367a306c85</Sha>
<Sha>55e8420fb913c035522bbb30e28d4fd7181ecd69</Sha>
</Dependency>
</ProductDependencies>
</Dependencies>
8 changes: 4 additions & 4 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<!-- must be kept in sync with the binding library version to it here: -->
<_XamarinAndroidGlideVersion>4.13.2.2</_XamarinAndroidGlideVersion>
<_XamarinAndroidXSecurityVersion>1.1.0-alpha03</_XamarinAndroidXSecurityVersion>
<_XamarinGoogleCryptoTinkAndroidVersion>1.6.1.7</_XamarinGoogleCryptoTinkAndroidVersion>
<_XamarinGoogleCryptoTinkAndroidVersion>1.7.0</_XamarinGoogleCryptoTinkAndroidVersion>
<!-- Android Maps -->
<XamarinGooglePlayServicesMaps>117.0.0</XamarinGooglePlayServicesMaps>
<!--
Expand All @@ -61,9 +61,9 @@
<_HarfBuzzSharpVersion>2.8.2.2</_HarfBuzzSharpVersion>
<_SkiaSharpNativeAssetsVersion>0.0.0-commit.193b587552cb0ed39372a049d7e6c692db98c267.483</_SkiaSharpNativeAssetsVersion>
<MicrosoftTemplateEngineTasksVersion>7.0.100-preview.5.22226.1</MicrosoftTemplateEngineTasksVersion>
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>1.0.0-prerelease.22451.1</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>1.0.0-prerelease.22451.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.22451.1</MicrosoftDotNetXHarnessCLIVersion>
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>1.0.0-prerelease.22456.1</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>1.0.0-prerelease.22456.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.22456.1</MicrosoftDotNetXHarnessCLIVersion>
<TizenUIExtensionsVersion>0.9.0</TizenUIExtensionsVersion>
<SvgSkiaPackageVersion>0.5.13</SvgSkiaPackageVersion>
<FizzlerPackageVersion>1.2.0</FizzlerPackageVersion>
Expand Down
2 changes: 2 additions & 0 deletions eng/pipelines/common/device-tests-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ steps:

- pwsh: ./build.ps1 --target=dotnet --configuration="Release" --verbosity=diagnostic
displayName: 'Install .NET'
retryCountOnTaskFailure: 3
env:
DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token)
PRIVATE_BUILD: $(PrivateBuild)
Expand All @@ -32,6 +33,7 @@ steps:

- pwsh: ./build.ps1 -Script eng/devices/${{ parameters.platform }}.cake --project="${{ parameters.path }}" --device=${{ parameters.device }} --results="$(TestResultsDirectory)" --binlog="$(LogDirectory)" ${{ parameters.cakeArgs }}
displayName: $(Agent.JobName)
retryCountOnTaskFailure: 2

- task: PublishTestResults@2
displayName: Publish the $(System.PhaseName) test results
Expand Down
5 changes: 0 additions & 5 deletions eng/pipelines/common/sdk-insertion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ jobs:
vmImage: ${{ parameters.vmImage }}
steps:
- checkout: self
- task: DownloadPipelineArtifact@2
continueOnError: true
inputs:
artifactName: library-packs
downloadPath: $(Build.StagingDirectory)\nuget
- task: DownloadPipelineArtifact@2
inputs:
artifactName: nuget
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Text="AspectFit"
Style="{StaticResource Headline}"/>
<ImageButton
x:Name="ImageButton01"
HorizontalOptions="Center"
WidthRequest="200"
Clicked="OnImageButtonClicked"
Expand All @@ -24,6 +25,7 @@
Text="AspectFill"
Style="{StaticResource Headline}"/>
<ImageButton
x:Name="ImageButton02"
HorizontalOptions="Center"
WidthRequest="200"
HeightRequest="100"
Expand All @@ -36,6 +38,7 @@
Text="Fill"
Style="{StaticResource Headline}"/>
<ImageButton
x:Name="ImageButton03"
HorizontalOptions="Center"
WidthRequest="200"
HeightRequest="100"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ public ImageButtonPage()
InitializeComponent();

BindingContext = new ImageButtonPageViewModel();

ImageButton01.PropertyChanged += (s, e) =>
{
if (e.PropertyName == ImageButton.IsLoadingProperty.PropertyName)
Debug.WriteLine($"{e.PropertyName}: {ImageButton01.IsLoading}");
};
}

void OnImageButtonClicked(object sender, EventArgs e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public BorderPage()
var descriptionLabel =
new Label { Text = "Border Galleries", Margin = new Thickness(2, 2, 2, 2) };

Title = "Border Galleries";
Title = "Border Galleries";

Content = new ScrollView
{
Expand All @@ -26,7 +26,7 @@ public BorderPage()
GalleryBuilder.NavButton("Border using styles", () =>
new BorderStyles(), Navigation),
}
}
}
};
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Controls/src/Core/CheckBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public partial class CheckBox : View, IElementConfiguration<CheckBox>, IBorderEl
BindableProperty.Create(nameof(IsChecked), typeof(bool), typeof(CheckBox), false,
propertyChanged: (bindable, oldValue, newValue) =>
{
((CheckBox)bindable).Handler?.UpdateValue(nameof(ICheckBox.Foreground));
((CheckBox)bindable).CheckedChanged?.Invoke(bindable, new CheckedChangedEventArgs((bool)newValue));
((CheckBox)bindable).ChangeVisualState();
}, defaultBindingMode: BindingMode.TwoWay);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Graphics;

namespace Microsoft.Maui.Controls
{
/// <include file="../../../../docs/Microsoft.Maui.Controls/ImageButton.xml" path="Type[@FullName='Microsoft.Maui.Controls.ImageButton']/Docs/*" />
public partial class ImageButton : IImageButton
{
void IImageSourcePart.UpdateIsLoading(bool isLoading) { }
void IImageSourcePart.UpdateIsLoading(bool isLoading)
{
((IImageController)this)?.SetIsLoading(isLoading);
}

bool IImageSourcePart.IsAnimationPlaying => false;

Expand Down
13 changes: 10 additions & 3 deletions src/Core/src/Platform/Android/WebViewExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@ public static void UpdateSource(this AWebView platformWebView, IWebView webView)

public static void UpdateSource(this AWebView platformWebView, IWebView webView, IWebViewDelegate? webViewDelegate)
{
if (webViewDelegate != null)
IWebViewSource? source = webView.Source;

if (source != null)
{
webView.Source?.Load(webViewDelegate);
if (webViewDelegate != null)
{
source.Load(webViewDelegate);

platformWebView.UpdateCanGoBackForward(webView);
platformWebView.UpdateCanGoBackForward(webView);
}
}
else
platformWebView.LoadUrl("about:blank");
}

public static void UpdateSettings(this AWebView platformWebView, IWebView webView, bool javaScriptEnabled, bool domStorageEnabled)
Expand Down
57 changes: 31 additions & 26 deletions src/Core/src/Platform/iOS/PlatformTouchGraphicsView.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using Foundation;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Graphics.Platform;
Expand All @@ -10,69 +8,76 @@ namespace Microsoft.Maui.Platform
{
public class PlatformTouchGraphicsView : PlatformGraphicsView
{
IGraphicsView? _graphicsView;
UIHoverGestureRecognizer? _hoverGesture;
RectF _rect;
bool _pressedContained = false;

IGraphicsView? graphicsView;
UIHoverGestureRecognizer? hoverGesture;
RectF rect;
bool pressedContained = false;
public PlatformTouchGraphicsView()
{
Opaque = false;
BackgroundColor = null;
}

public override void LayoutSubviews()
{
base.LayoutSubviews();
rect = this.Bounds.AsRectangleF();
_rect = Bounds.AsRectangleF();
}

public void Connect(IGraphicsView graphicsView)
{
this.graphicsView = graphicsView;
_graphicsView = graphicsView;

if (OperatingSystem.IsIOSVersionAtLeast(13))
AddGestureRecognizer(hoverGesture = new UIHoverGestureRecognizer(OnHover));
AddGestureRecognizer(_hoverGesture = new UIHoverGestureRecognizer(OnHover));
}

public void Disconnect()
{
RemoveGestureRecognizer(hoverGesture!);
hoverGesture = null;
graphicsView = null;
RemoveGestureRecognizer(_hoverGesture!);
_hoverGesture = null;
_graphicsView = null;
}

void OnHover()
{
if (hoverGesture!.State == UIGestureRecognizerState.Began)
if (_hoverGesture!.State == UIGestureRecognizerState.Began)
{
var touch = hoverGesture.LocationInView(this);
graphicsView?.StartHoverInteraction(new[] { (PointF)touch.ToPoint() });
var touch = _hoverGesture.LocationInView(this);
_graphicsView?.StartHoverInteraction(new[] { (PointF)touch.ToPoint() });
}
else if (hoverGesture.State == UIGestureRecognizerState.Changed)
else if (_hoverGesture.State == UIGestureRecognizerState.Changed)
{
var touch = hoverGesture.LocationInView(this);
graphicsView?.MoveHoverInteraction(new[] { (PointF)touch.ToPoint() });
var touch = _hoverGesture.LocationInView(this);
_graphicsView?.MoveHoverInteraction(new[] { (PointF)touch.ToPoint() });
}
else
graphicsView?.EndHoverInteraction();
_graphicsView?.EndHoverInteraction();
}

public override void TouchesBegan(NSSet touches, UIEvent? evt)
{
if (!IsFirstResponder)
BecomeFirstResponder();
var viewPoints = this.GetPointsInView(evt);
graphicsView?.StartInteraction(viewPoints);
pressedContained = true;
_graphicsView?.StartInteraction(viewPoints);
_pressedContained = true;
}

public override void TouchesMoved(NSSet touches, UIEvent? evt)
{
var viewPoints = this.GetPointsInView(evt);
pressedContained = rect.ContainsAny(viewPoints);
graphicsView?.DragInteraction(viewPoints);
_pressedContained = _rect.ContainsAny(viewPoints);
_graphicsView?.DragInteraction(viewPoints);
}
public override void TouchesEnded(NSSet touches, UIEvent? evt) =>
graphicsView?.EndInteraction(this.GetPointsInView(evt), pressedContained);
_graphicsView?.EndInteraction(this.GetPointsInView(evt), _pressedContained);

public override void TouchesCancelled(NSSet touches, UIEvent? evt)
{
pressedContained = false;
graphicsView?.CancelInteraction();
_pressedContained = false;
_graphicsView?.CancelInteraction();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public async Task IsCheckedInitializesCorrectly(bool isChecked)
await ValidatePropertyInitValue(checkBoxStub, () => checkBoxStub.IsChecked, GetNativeIsChecked, checkBoxStub.IsChecked);
}

[Fact(DisplayName = "Foreground Updates Correctly")]
public async Task ForegroundUpdatesCorrectly()
[Fact(DisplayName = "Foreground Initializes Correctly")]
public async Task ForegroundInitializesCorrectly()
{
var checkBoxStub = new CheckBoxStub()
{
Expand All @@ -33,5 +33,22 @@ public async Task ForegroundUpdatesCorrectly()

await ValidateColor(checkBoxStub, Colors.Red);
}

[Theory(DisplayName = "Foreground Updates Correctly")]
[InlineData(0xFF0000)]
[InlineData(0x0000FF)]
public async Task ForegroundUpdatesCorrectly(uint color)
{
var checkBoxStub = new CheckBoxStub
{
Foreground = new SolidPaint(Colors.Black),
IsChecked = true
};

var expected = Color.FromUint(color);
checkBoxStub.Foreground = new SolidPaint(expected);

await ValidateColor(checkBoxStub, expected);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,8 @@ Task ValidateHasColor(IImageButton imageButton, Color color, Action action = nul
platformImageButton.AssertContainsColor(color);
});
}

bool ImageSourceLoaded(ImageButtonHandler imageButtonHandler) =>
imageButtonHandler.PlatformView.Drawable != null;
}
}
Loading

0 comments on commit dcd91ec

Please sign in to comment.