Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[net7.0] Update dependencies from xamarin/xamarin-macios #9663

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
<Uri>https://github.com/xamarin/xamarin-android</Uri>
<Sha>caf6f3cd02fef236dbe7bd5a1dae5d073a3e40c5</Sha>
</Dependency>
<Dependency Name="Microsoft.MacCatalyst.Sdk" Version="15.4.1006-rc.1">
<Dependency Name="Microsoft.MacCatalyst.Sdk" Version="15.4.1009-rc.1">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
<Sha>0e53b999d279ef18eb8c27fc72f596d002882365</Sha>
<Sha>3198941d450cfc98491cc71c322b1c86b3d6a5fa</Sha>
</Dependency>
<Dependency Name="Microsoft.iOS.Sdk" Version="15.4.1006-rc.1">
<Dependency Name="Microsoft.iOS.Sdk" Version="15.4.1009-rc.1">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
<Sha>0e53b999d279ef18eb8c27fc72f596d002882365</Sha>
<Sha>3198941d450cfc98491cc71c322b1c86b3d6a5fa</Sha>
</Dependency>
<Dependency Name="Microsoft.tvOS.Sdk" Version="15.4.1006-rc.1">
<Dependency Name="Microsoft.tvOS.Sdk" Version="15.4.1009-rc.1">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
<Sha>0e53b999d279ef18eb8c27fc72f596d002882365</Sha>
<Sha>3198941d450cfc98491cc71c322b1c86b3d6a5fa</Sha>
</Dependency>
<Dependency Name="Microsoft.macOS.Sdk" Version="12.3.1006-rc.1">
<Dependency Name="Microsoft.macOS.Sdk" Version="12.3.1009-rc.1">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
<Sha>0e53b999d279ef18eb8c27fc72f596d002882365</Sha>
<Sha>3198941d450cfc98491cc71c322b1c86b3d6a5fa</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Workload.Emscripten.Manifest-7.0.100" Version="7.0.0-rc.1.22362.2" CoherentParentDependency="Microsoft.NETCore.App.Ref">
<Uri>https://github.com/dotnet/emsdk</Uri>
Expand Down
8 changes: 4 additions & 4 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
<!-- xamarin/xamarin-android -->
<MicrosoftAndroidSdkWindowsPackageVersion>33.0.0-rc.1.125</MicrosoftAndroidSdkWindowsPackageVersion>
<!-- xamarin/xamarin-macios -->
<MicrosoftiOSSdkPackageVersion>15.4.1006-rc.1</MicrosoftiOSSdkPackageVersion>
<MicrosoftMacCatalystSdkPackageVersion>15.4.1006-rc.1</MicrosoftMacCatalystSdkPackageVersion>
<MicrosoftmacOSSdkPackageVersion>12.3.1006-rc.1</MicrosoftmacOSSdkPackageVersion>
<MicrosofttvOSSdkPackageVersion>15.4.1006-rc.1</MicrosofttvOSSdkPackageVersion>
<MicrosoftiOSSdkPackageVersion>15.4.1009-rc.1</MicrosoftiOSSdkPackageVersion>
<MicrosoftMacCatalystSdkPackageVersion>15.4.1009-rc.1</MicrosoftMacCatalystSdkPackageVersion>
<MicrosoftmacOSSdkPackageVersion>12.3.1009-rc.1</MicrosoftmacOSSdkPackageVersion>
<MicrosofttvOSSdkPackageVersion>15.4.1009-rc.1</MicrosofttvOSSdkPackageVersion>
<!-- Samsung/Tizen.NET -->
<SamsungTizenSdkPackageVersion>7.0.100-rc.1.22</SamsungTizenSdkPackageVersion>
<!-- emsdk -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public MyViewCell()
Label label = new Label { Text = "Click the image to resize", VerticalOptions = LayoutOptions.Center };

var tapGestureRecognizer = new TapGestureRecognizer();
tapGestureRecognizer.Tapped += (object sender, EventArgs e) =>
tapGestureRecognizer.Tapped += (sender, e) =>
{
if (_image.HeightRequest < 250)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,26 @@ public class TapGestureGalleryPage : BasePage
{
Command TapCommand;
Label changeColorBoxView;
Label windowPosition = new Label();
Label relativeToToggleButtonPosition = new Label();
Label relativeToContainerPosition = new Label();
Button toggleButton;

public TapGestureGalleryPage()
{
TapCommand = new Command<Color>(HandleTapCommand);

var vertical = new VerticalStackLayout
{
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.Center,
Spacing = 40
};

vertical.Add(windowPosition);
vertical.Add(relativeToToggleButtonPosition);
vertical.Add(relativeToContainerPosition);

var horizontal = new HorizontalStackLayout
{
Spacing = 20,
Expand All @@ -38,6 +47,7 @@ public TapGestureGalleryPage()
CommandParameter = Colors.PaleGreen,
NumberOfTapsRequired = 1,
};
singleTapGesture.Tapped += OnTapped;
singleTapLabel.GestureRecognizers.Add(singleTapGesture);
horizontal.Add(singleTapLabel);

Expand All @@ -52,6 +62,7 @@ public TapGestureGalleryPage()
CommandParameter = Colors.Aqua,
NumberOfTapsRequired = 2,
};
doubleTapGesture.Tapped += OnTapped;
doubleTapLabel.GestureRecognizers.Add(doubleTapGesture);
horizontal.Add(doubleTapLabel);

Expand All @@ -65,8 +76,7 @@ public TapGestureGalleryPage()
};
vertical.Add(changeColorBoxView);


vertical.Add(new Button()
toggleButton = new Button()
{
Text = "Toggle Single Tap Gesture",
Command = new Command(() =>
Expand All @@ -76,15 +86,77 @@ public TapGestureGalleryPage()
else
singleTapLabel.GestureRecognizers.Add(singleTapGesture);
})
});
};

vertical.Add(toggleButton);

var tripleClicklabel = new Label
{
Text = "Triple click me!!!",
BackgroundColor = Colors.Olive
};
var tripleClickGesture = new TapGestureRecognizer
{
Command = TapCommand,
CommandParameter = Colors.Olive,
NumberOfTapsRequired = 3,
Buttons = ButtonsMask.Primary
};
tripleClickGesture.Tapped += OnTapped;
tripleClicklabel.GestureRecognizers.Add(tripleClickGesture);
horizontal.Children.Add(tripleClicklabel);

var rightClickLabel = new Label
{
Text = "Right click me¡",
BackgroundColor = Colors.Coral
};
var rigthClickGesture = new TapGestureRecognizer
{
Command = TapCommand,
CommandParameter = Colors.Coral,
NumberOfTapsRequired = 1,
Buttons = ButtonsMask.Secondary
};
rigthClickGesture.Tapped += OnTapped;
rightClickLabel.GestureRecognizers.Add(rigthClickGesture);
horizontal.Children.Add(rightClickLabel);


var rightorLeftClickLabel = new Label
{
Text = "Right or Left click me¡",
BackgroundColor = Colors.Green
};
var rigthOrLeftClickGesture = new TapGestureRecognizer
{
Command = TapCommand,
CommandParameter = Colors.Green,
NumberOfTapsRequired = 1,
Buttons = ButtonsMask.Secondary | ButtonsMask.Primary
};

rigthOrLeftClickGesture.Tapped += OnTapped;
rightorLeftClickLabel.GestureRecognizers.Add(rigthOrLeftClickGesture);
horizontal.Children.Add(rightorLeftClickLabel);


Content = vertical;
}

async void HandleTapCommand(Color backgroundColor)
void OnTapped(object sender, System.EventArgs e)
{
var args = (TappedEventArgs)e;
var view = (View)sender;

windowPosition.Text = $"Position inside window: {args.GetPosition(null)}";
relativeToToggleButtonPosition.Text = $"Position relative to toggle button: {args.GetPosition(toggleButton)}";
relativeToContainerPosition.Text = $"Position inside my view: {args.GetPosition(view)}";
}

void HandleTapCommand(Color backgroundColor)
{
changeColorBoxView.BackgroundColor = backgroundColor;
await DisplayAlert("Tapped", "Tap Command Fired", "Close");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ protected override IEnumerable<SectionModel> CreateItems() => new[]
"Pan Gesture."),
new SectionModel(typeof(SwipeGestureGalleryPage), "Swipe Gesture",
"Swipe Gesture."),
new SectionModel(typeof(TapGestureGalleryPage), "Click Gesture",
"Click Gesture."),
new SectionModel(typeof(TapGestureGalleryPage), "Tap Gesture",
"Tap Gesture."),
};
}
}
16 changes: 16 additions & 0 deletions src/Controls/src/Core/ButtonsMask.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.ComponentModel;
using System.Windows.Input;

namespace Microsoft.Maui.Controls
{
/// <include file="../../docs/Microsoft.Maui.Controls/ButtonsMask.xml" path="Type[@FullName='Microsoft.Maui.Controls.ButtonsMask']/Docs" />
[Flags]
public enum ButtonsMask
{
/// <include file="../../docs/Microsoft.Maui.Controls/ButtonsMask.xml" path="//Member[@MemberName='Primary']/Docs" />
Primary = 1 << 0,
/// <include file="../../docs/Microsoft.Maui.Controls/ButtonsMask.xml" path="//Member[@MemberName='Secondary']/Docs" />
Secondary = 1 << 1
}
}
10 changes: 0 additions & 10 deletions src/Controls/src/Core/ClickGestureRecognizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@

namespace Microsoft.Maui.Controls
{
/// <include file="../../docs/Microsoft.Maui.Controls/ButtonsMask.xml" path="Type[@FullName='Microsoft.Maui.Controls.ButtonsMask']/Docs" />
[Flags]
public enum ButtonsMask
{
/// <include file="../../docs/Microsoft.Maui.Controls/ButtonsMask.xml" path="//Member[@MemberName='Primary']/Docs" />
Primary = 1 << 0,
/// <include file="../../docs/Microsoft.Maui.Controls/ButtonsMask.xml" path="//Member[@MemberName='Secondary']/Docs" />
Secondary = 1 << 1
}

/// <include file="../../docs/Microsoft.Maui.Controls/ClickGestureRecognizer.xml" path="Type[@FullName='Microsoft.Maui.Controls.ClickGestureRecognizer']/Docs" />
public sealed class ClickGestureRecognizer : GestureRecognizer
{
Expand Down
10 changes: 5 additions & 5 deletions src/Controls/src/Core/Platform/Android/InnerGestureListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal class InnerGestureListener : Object, GestureDetector.IOnGestureListener
Func<bool> _scrollCompleteDelegate;
Func<float, float, int, bool> _scrollDelegate;
Func<int, bool> _scrollStartedDelegate;
Func<int, Point, bool> _tapDelegate;
Func<int, MotionEvent, bool> _tapDelegate;
Func<int, IEnumerable<TapGestureRecognizer>> _tapGestureRecognizers;

public InnerGestureListener(
Expand Down Expand Up @@ -74,15 +74,15 @@ bool GestureDetector.IOnDoubleTapListener.OnDoubleTap(MotionEvent e)

if (HasDoubleTapHandler())
{
return _tapDelegate(2, new Point(e.GetX(), e.GetY()));
return _tapDelegate(2, e);
}

if (HasSingleTapHandler())
{
// If we're registering double taps and we don't actually have a double-tap handler,
// but we _do_ have a single-tap handler, then we're really just seeing two singles in a row
// Fire off the delegate for the second single-tap (OnSingleTapUp already did the first one)
return _tapDelegate(1, new Point(e.GetX(), e.GetY()));
return _tapDelegate(1, e);
}

return false;
Expand Down Expand Up @@ -149,7 +149,7 @@ bool GestureDetector.IOnGestureListener.OnSingleTapUp(MotionEvent e)

// A single tap has occurred and there's no handler for double tap to worry about,
// so we can go ahead and run the delegate
return _tapDelegate(1, new Point(e.GetX(), e.GetY()));
return _tapDelegate(1, e);
}

bool GestureDetector.IOnDoubleTapListener.OnSingleTapConfirmed(MotionEvent e)
Expand All @@ -166,7 +166,7 @@ bool GestureDetector.IOnDoubleTapListener.OnSingleTapConfirmed(MotionEvent e)

// Since there was a double-tap handler, we had to wait for OnSingleTapConfirmed;
// Now that we're sure it's a single tap, we can run the delegate
return _tapDelegate(1, new Point(e.GetX(), e.GetY()));
return _tapDelegate(1, e);
}

protected override void Dispose(bool disposing)
Expand Down
20 changes: 16 additions & 4 deletions src/Controls/src/Core/Platform/Android/PanGestureHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,23 @@ namespace Microsoft.Maui.Controls.Platform
{
internal class PanGestureHandler
{
readonly Func<double, double> _pixelTranslation;
Func<double, double> PixelTranslation
{
get
{
return (input) =>
{
var context = GetView()?.Handler?.MauiContext?.Context;
if (context == null)
return 0;

return context.FromPixels(input);
};
}
}

public PanGestureHandler(Func<View> getView, Func<double, double> pixelTranslation)
public PanGestureHandler(Func<View> getView)
{
_pixelTranslation = pixelTranslation;
GetView = getView;
}

Expand All @@ -27,7 +39,7 @@ public bool OnPan(float x, float y, int pointerCount)
foreach (PanGestureRecognizer panGesture in
view.GestureRecognizers.GetGesturesFor<PanGestureRecognizer>(g => g.TouchPoints == pointerCount))
{
((IPanGestureController)panGesture).SendPan(view, _pixelTranslation(x), _pixelTranslation(y), PanGestureRecognizer.CurrentId.Value);
((IPanGestureController)panGesture).SendPan(view, PixelTranslation(x), PixelTranslation(y), PanGestureRecognizer.CurrentId.Value);
result = true;
}

Expand Down
20 changes: 16 additions & 4 deletions src/Controls/src/Core/Platform/Android/SwipeGestureHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,23 @@ namespace Microsoft.Maui.Controls.Platform
{
internal class SwipeGestureHandler
{
readonly Func<double, double> _pixelTranslation;
Func<double, double> PixelTranslation
{
get
{
return (input) =>
{
var context = GetView()?.Handler?.MauiContext?.Context;
if (context == null)
return 0;

return context.FromPixels(input);
};
}
}

public SwipeGestureHandler(Func<View> getView, Func<double, double> pixelTranslation)
public SwipeGestureHandler(Func<View> getView)
{
_pixelTranslation = pixelTranslation;
GetView = getView;
}

Expand All @@ -27,7 +39,7 @@ public bool OnSwipe(float x, float y)
foreach (SwipeGestureRecognizer swipeGesture in
view.GestureRecognizers.GetGesturesFor<SwipeGestureRecognizer>())
{
((ISwipeGestureController)swipeGesture).SendSwipe(view, _pixelTranslation(x), _pixelTranslation(y));
((ISwipeGestureController)swipeGesture).SendSwipe(view, PixelTranslation(x), PixelTranslation(y));
result = true;
}

Expand Down
Loading