Skip to content
Draft
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
21 changes: 12 additions & 9 deletions PCL.Neo/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dotnet_search_reference_assemblies = true
# 组织 Using
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = false
file_header_template = unset
file_header_template =

# this. 和 Me. 首选项
dotnet_style_qualification_for_event = false
Expand Down Expand Up @@ -219,28 +219,31 @@ dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =
dotnet_naming_symbols.types.required_modifiers =

dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =
dotnet_naming_symbols.non_field_members.required_modifiers =

# 命名样式

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case

# ReSharper properties
resharper_int_align = false

[*.{cs,vb}]
end_of_line = crlf
dotnet_style_qualification_for_field = false:silent
Expand Down
253 changes: 0 additions & 253 deletions PCL.Neo/Animations/AnimationExtensions.cs

This file was deleted.

47 changes: 47 additions & 0 deletions PCL.Neo/Animations/BaseAnimation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using Avalonia.Animation;
using Avalonia.Animation.Easings;
using System;
using System.Threading;
using System.Threading.Tasks;

namespace PCL.Neo.Animations
{
public abstract class BaseAnimation(
Animatable control,
double begin,
double end,
Easing easing,
TimeSpan duration,
TimeSpan delay,
bool wait)
: IAnimation
{
/// <inheritdoc />
public TimeSpan Delay { get; } = delay;

public bool Wait { get; } = wait;

private readonly CancellationTokenSource _cancellationTokenSource = new();
private Animatable Control { get; } = control;
protected TimeSpan Duration { get; } = duration;
protected double? Begin { get; } = begin;
protected double? End { get; } = end;
protected Easing Easing { get; } = easing;


/// <inheritdoc />
public abstract Animation AnimationBuilder();

/// <inheritdoc />
public async Task RunAsync()
{
await AnimationBuilder().RunAsync(Control, _cancellationTokenSource.Token);
}

/// <inheritdoc />
public void Cancel()
{
_cancellationTokenSource.Cancel();
}
}
}
2 changes: 1 addition & 1 deletion PCL.Neo/Animations/Easings/EasingType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ public enum EasingType
BounceEaseOut,
BounceEaseInOut
}
}
}
9 changes: 2 additions & 7 deletions PCL.Neo/Animations/Easings/MyBackEaseIn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@

namespace PCL.Neo.Animations.Easings
{
public class MyBackEaseIn : Easing
public class MyBackEaseIn(EasePower power = EasePower.Middle) : Easing
{
private readonly double p;

public MyBackEaseIn(EasePower power = EasePower.Middle)
{
p = 3 - (int)power * 0.5;
}
private readonly double p = 3 - (int)power * 0.5;

public override double Ease(double progress)
{
Expand Down
Loading
Loading