Skip to content

Commit

Permalink
chore: Porting AnimatedIcon
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Jun 23, 2021
1 parent 482407b commit 79fbf60
Show file tree
Hide file tree
Showing 5 changed files with 722 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Uno.Disposables;
using Windows.UI.Composition;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;

namespace Microsoft.UI.Xaml.Controls
{
public partial class AnimatedIcon
{
private IAnimatedVisual m_animatedVisual;
private Panel m_rootPanel;
private ScaleTransform m_scaleTransform;

private string m_currentState = "";
private string m_previousState = "";
private string m_queuedState = "";
private string m_pendingState = "";
private string m_lastAnimationSegment = "";
private string m_lastAnimationSegmentStart = "";
private string m_lastAnimationSegmentEnd = "";
private bool m_isPlaying = false;
private bool m_canDisplayPrimaryContent = true;
private float m_previousSegmentLength = 1.0f;
private float m_durationMultiplier = 1.0f;
private float m_speedUpMultiplier = 7.0f;


private CompositionPropertySet m_progressPropertySet = null;
private CompositionScopedBatch m_batch = null;
private SerialDisposable m_batchCompletedRevoker = new SerialDisposable();
private SerialDisposable m_ancestorStatePropertyChangedRevoker = new SerialDisposable();
private SerialDisposable m_layoutUpdatedRevoker = new SerialDisposable();
private SerialDisposable m_foregroundColorPropertyChangedRevoker = new SerialDisposable();

private AnimatedIconAnimationQueueBehavior m_queueBehavior = AnimatedIconAnimationQueueBehavior.SpeedUpQueueOne;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public IconSource FallbackIconSource
public static DependencyProperty FallbackIconSourceProperty { get; } =
DependencyProperty.Register(nameof(FallbackIconSource), typeof(IconSource), typeof(AnimatedIcon), new PropertyMetadata(null, OnFallbackIconSourcePropertyChanged));



public IAnimatedVisualSource2 Source
{
get => (IAnimatedVisualSource2)GetValue(SourceProperty);
Expand All @@ -24,7 +22,6 @@ public IAnimatedVisualSource2 Source
public static DependencyProperty SourceProperty { get; } =
DependencyProperty.Register(nameof(Source), typeof(IAnimatedVisualSource2), typeof(AnimatedIcon), new PropertyMetadata(null, OnSourcePropertyChanged));


private static void OnFallbackIconSourcePropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
{
var owner = sender as AnimatedIcon;
Expand Down
Loading

0 comments on commit 79fbf60

Please sign in to comment.