您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

60 行
1.8 KiB

using UIWidgets.foundation;
using UIWidgets.ui;
namespace UIWidgets.animation {
public enum AnimationStatus {
dismissed,
forward,
reverse,
completed,
}
public delegate void AnimationStatusListener(AnimationStatus status);
public abstract class Animation<T> : ValueListenable<T> {
public abstract void addListener(VoidCallback listener);
public abstract void removeListener(VoidCallback listener);
public abstract void addStatusListener(AnimationStatusListener listener);
public abstract void removeStatusListener(AnimationStatusListener listener);
public abstract AnimationStatus status { get; }
public abstract T value { get; }
public bool isDismissed {
get { return this.status == AnimationStatus.dismissed; }
}
public bool isCompleted {
get { return this.status == AnimationStatus.completed; }
}
public override string ToString() {
return string.Format("{0}({1})", Diagnostics.describeIdentity(this), this.toStringDetails());
}
public virtual string toStringDetails() {
string icon = null;
switch (this.status) {
case AnimationStatus.forward:
icon = "\u25B6"; // >
break;
case AnimationStatus.reverse:
icon = "\u25C0"; // <
break;
case AnimationStatus.completed:
icon = "\u23ED"; // >>|
break;
case AnimationStatus.dismissed:
icon = "\u23EE"; // |<<
break;
}
D.assert(icon != null);
return icon;
}
}
}