Fixed files: - SkiaImageButton.cs: Added SVG support with multi-path search - SkiaNavigationPage.cs: Added LinuxApplication.IsGtkMode check - SkiaRefreshView.cs: Added ICommand support (Command, CommandParameter) - SkiaTemplatedView.cs: Added missing using statements Extracted embedded types to separate files (matching decompiled pattern): - From SkiaMenuBar.cs: MenuBarItem, MenuItem, SkiaMenuFlyout, MenuItemClickedEventArgs - From SkiaNavigationPage.cs: NavigationEventArgs - From SkiaTabbedPage.cs: TabItem - From SkiaVisualStateManager.cs: SkiaVisualStateGroupList, SkiaVisualStateGroup, SkiaVisualState, SkiaVisualStateSetter - From SkiaSwipeView.cs: SwipeItem, SwipeStartedEventArgs, SwipeEndedEventArgs - From SkiaFlyoutPage.cs: FlyoutLayoutBehavior (already separate) - From SkiaIndicatorView.cs: IndicatorShape (already separate) - From SkiaBorder.cs: SkiaFrame - From SkiaCarouselView.cs: PositionChangedEventArgs - From SkiaCollectionView.cs: SkiaSelectionMode, ItemsLayoutOrientation - From SkiaContentPresenter.cs: LayoutAlignment Verified matching decompiled: - SkiaContextMenu.cs, SkiaFlexLayout.cs, SkiaGraphicsView.cs Build: 0 errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
53 lines
1.7 KiB
C#
53 lines
1.7 KiB
C#
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
|
|
namespace Microsoft.Maui.Platform.Linux;
|
|
|
|
public class Easing
|
|
{
|
|
private readonly Func<double, double> _easingFunc;
|
|
|
|
public static readonly Easing Linear = new(v => v);
|
|
|
|
public static readonly Easing SinIn = new(v => 1.0 - Math.Cos(v * Math.PI / 2.0));
|
|
|
|
public static readonly Easing SinOut = new(v => Math.Sin(v * Math.PI / 2.0));
|
|
|
|
public static readonly Easing SinInOut = new(v => -(Math.Cos(Math.PI * v) - 1.0) / 2.0);
|
|
|
|
public static readonly Easing CubicIn = new(v => v * v * v);
|
|
|
|
public static readonly Easing CubicOut = new(v => 1.0 - Math.Pow(1.0 - v, 3.0));
|
|
|
|
public static readonly Easing CubicInOut = new(v =>
|
|
v < 0.5 ? 4.0 * v * v * v : 1.0 - Math.Pow(-2.0 * v + 2.0, 3.0) / 2.0);
|
|
|
|
public static readonly Easing BounceIn = new(v => 1.0 - BounceOut.Ease(1.0 - v));
|
|
|
|
public static readonly Easing BounceOut = new(v =>
|
|
{
|
|
const double n1 = 7.5625;
|
|
const double d1 = 2.75;
|
|
|
|
if (v < 1 / d1)
|
|
return n1 * v * v;
|
|
if (v < 2 / d1)
|
|
return n1 * (v -= 1.5 / d1) * v + 0.75;
|
|
if (v < 2.5 / d1)
|
|
return n1 * (v -= 2.25 / d1) * v + 0.9375;
|
|
return n1 * (v -= 2.625 / d1) * v + 0.984375;
|
|
});
|
|
|
|
public static readonly Easing SpringIn = new(v => v * v * (2.70158 * v - 1.70158));
|
|
|
|
public static readonly Easing SpringOut = new(v =>
|
|
(v - 1.0) * (v - 1.0) * (2.70158 * (v - 1.0) + 1.70158) + 1.0);
|
|
|
|
public Easing(Func<double, double> easingFunc)
|
|
{
|
|
_easingFunc = easingFunc;
|
|
}
|
|
|
|
public double Ease(double v) => _easingFunc(v);
|
|
}
|