Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

滚动性能优化 #1054

Merged
merged 5 commits into from
Apr 16, 2022
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
6 changes: 0 additions & 6 deletions src/App/App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -1090,9 +1090,6 @@
<PackageReference Include="FFmpegInteropX">
<Version>0.9.4</Version>
</PackageReference>
<PackageReference Include="HN.Controls.ImageEx.Uwp">
<Version>1.0.33</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.13</Version>
</PackageReference>
Expand All @@ -1114,9 +1111,6 @@
<PackageReference Include="Newtonsoft.Json">
<Version>13.0.1</Version>
</PackageReference>
<PackageReference Include="Nito.AsyncEx.Tasks">
<Version>5.1.2</Version>
</PackageReference>
<PackageReference Include="Richasy.ExpanderEx.UWP">
<Version>1.0.4</Version>
</PackageReference>
Expand Down
35 changes: 1 addition & 34 deletions src/App/Controls/App/CardPanel/CardPanel.Fields.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Richasy. All rights reserved.

using System;
using Windows.UI.Composition;
using Windows.UI.Xaml.Controls;

namespace Richasy.Bili.App.Controls
Expand All @@ -11,43 +10,11 @@ namespace Richasy.Bili.App.Controls
/// </summary>
public partial class CardPanel
{
// Light theme
private const float LightPointerRestShadowRadius = 8f;
private const float LightPointerRestShadowOffsetY = 2f;
private const float LightPointerRestShadowOpacity = 0.02f;

private const float LightPointerOverShadowRadius = 8f;
private const float LightPointerOverShadowOffsetY = 4f;
private const float LightPointerOverShadowOpacity = 0.04f;

private const float LightPointerPressedShadowRadius = 2f;
private const float LightPointerPressedShadowOffsetY = 0;
private const float LightPointerPressedShadowOpacity = 0.03f;

// Dark theme
private const float DarkPointerRestShadowRadius = 6f;
private const float DarkPointerRestShadowOffsetY = 2f;
private const float DarkPointerRestShadowOpacity = 0.1f;

private const float DarkPointerOverShadowRadius = 12f;
private const float DarkPointerOverShadowOffsetY = 8f;
private const float DarkPointerOverShadowOpacity = 0.18f;

private const float DarkPointerPressedShadowRadius = 2f;
private const float DarkPointerPressedShadowOffsetY = 0f;
private const float DarkPointerPressedShadowOpacity = 0.2f;

private const float PointerOverOffsetY = -4f;

private static readonly TimeSpan ShowShadowDuration = TimeSpan.FromMilliseconds(300);
private static readonly TimeSpan HideShadowDuration = TimeSpan.FromMilliseconds(250);
private static readonly TimeSpan PressShadowDuration = TimeSpan.FromMilliseconds(250);
private static readonly TimeSpan OffsetDuration = TimeSpan.FromMilliseconds(250);

private readonly Compositor _compositor;
private Grid _rootContainer;
private bool _loaded;
private bool _templateApplied;
private bool _shadowCreated;
private long _pointerOverToken;
private long _pressedToken;
}
Expand Down
12 changes: 0 additions & 12 deletions src/App/Controls/App/CardPanel/CardPanel.Properties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ public partial class CardPanel
public static readonly DependencyProperty IsEnableHoverAnimationProperty =
DependencyProperty.Register(nameof(IsEnableHoverAnimation), typeof(bool), typeof(CardPanel), new PropertyMetadata(true));

public static readonly DependencyProperty IsEnableShadowProperty =
DependencyProperty.Register(nameof(IsEnableShadow), typeof(bool), typeof(CardPanel), new PropertyMetadata(true, new PropertyChangedCallback(OnIsEnableShadowChanged)));

public static readonly DependencyProperty IsEnableCheckProperty =
DependencyProperty.Register(nameof(IsEnableCheck), typeof(bool), typeof(CardPanel), new PropertyMetadata(false));

Expand Down Expand Up @@ -74,15 +71,6 @@ public bool IsEnableHoverAnimation
set { SetValue(IsEnableHoverAnimationProperty, value); }
}

/// <summary>
/// 是否显示阴影.
/// </summary>
public bool IsEnableShadow
{
get { return (bool)GetValue(IsEnableShadowProperty); }
set { SetValue(IsEnableShadowProperty, value); }
}

/// <summary>
/// 是否支持选中.
/// </summary>
Expand Down
Loading