Yuncong Zhang
6 年前
当前提交
918cf889
共有 5 个文件被更改,包括 248 次插入 和 145 次删除
-
242Runtime/material/animated_icons/animated_icons.cs
-
52Runtime/material/animated_icons/animated_icons_data.cs
-
4Samples/UIWidgetsGallery/gallery/backdrop.cs
-
92Runtime/widgets/visibility.cs
-
3Runtime/widgets/visibility.cs.meta
|
|||
using System.Collections.Generic; |
|||
using Unity.UIWidgets.ui; |
|||
using UnityEngine; |
|||
public static readonly AnimatedIconData add_event = AnimatedIconsData._add_event; |
|||
public static readonly AnimatedIconData add_event = AnimatedIconsData._add_event; |
|||
public static readonly AnimatedIconData arrow_menu = AnimatedIconsData._arrow_menu; |
|||
public static readonly AnimatedIconData arrow_menu = AnimatedIconsData._arrow_menu; |
|||
public static readonly AnimatedIconData close_menu = AnimatedIconsData._close_menu; |
|||
public static readonly AnimatedIconData close_menu = AnimatedIconsData._close_menu; |
|||
|
|||
// public readonly AnimatedIconData ellipsis_search = AnimatedIconsData._ellipsis_search;
|
|||
// public readonly AnimatedIconData ellipsis_search = AnimatedIconsData._ellipsis_search;
|
|||
// public readonly AnimatedIconData event_add = AnimatedIconsData._event_add;
|
|||
// public readonly AnimatedIconData event_add = AnimatedIconsData._event_add;
|
|||
// public readonly AnimatedIconData home_menu = AnimatedIconsData._home_menu;
|
|||
// public readonly AnimatedIconData home_menu = AnimatedIconsData._home_menu;
|
|||
// public readonly AnimatedIconData list_view = AnimatedIconsData._list_view;
|
|||
// public readonly AnimatedIconData list_view = AnimatedIconsData._list_view;
|
|||
// public readonly AnimatedIconData menu_arrow = AnimatedIconsData._menu_arrow;
|
|||
// public readonly AnimatedIconData menu_arrow = AnimatedIconsData._menu_arrow;
|
|||
// public readonly AnimatedIconData menu_close = AnimatedIconsData._menu_close;
|
|||
// public readonly AnimatedIconData menu_close = AnimatedIconsData._menu_close;
|
|||
// public readonly AnimatedIconData menu_home = AnimatedIconsData._menu_home;
|
|||
// public readonly AnimatedIconData menu_home = AnimatedIconsData._menu_home;
|
|||
// public readonly AnimatedIconData pause_play = AnimatedIconsData._pause_play;
|
|||
// public readonly AnimatedIconData pause_play = AnimatedIconsData._pause_play;
|
|||
// public readonly AnimatedIconData play_pause = AnimatedIconsData._play_pause;
|
|||
// public readonly AnimatedIconData play_pause = AnimatedIconsData._play_pause;
|
|||
// public readonly AnimatedIconData search_ellipsis = AnimatedIconsData._search_ellipsis;
|
|||
// public readonly AnimatedIconData search_ellipsis = AnimatedIconsData._search_ellipsis;
|
|||
// public readonly AnimatedIconData view_list = AnimatedIconsData._view_list;
|
|||
// public readonly AnimatedIconData view_list = AnimatedIconsData._view_list;
|
|||
public AnimatedIconData() {} |
|||
public AnimatedIconData() { |
|||
} |
|||
public abstract bool matchTextDirection { get; } |
|||
public abstract bool matchTextDirection { get; } |
|||
public _AnimatedIconData(Size size, List<_PathFrames> paths, bool matchTextDirection = false) { |
|||
this.size = size; |
|||
this.paths = paths; |
|||
this.matchTextDirection = matchTextDirection; |
|||
} |
|||
public _AnimatedIconData(Size size, List<_PathFrames> paths, bool matchTextDirection = false) { |
|||
this.size = size; |
|||
this.paths = paths; |
|||
this.matchTextDirection = matchTextDirection; |
|||
} |
|||
public readonly Size size; |
|||
public readonly List<_PathFrames> paths; |
|||
public readonly Size size; |
|||
public readonly List<_PathFrames> paths; |
|||
public override bool matchTextDirection { get; } |
|||
public override bool matchTextDirection { get; } |
|||
|
|||
} |
|
|||
using Unity.UIWidgets.foundation; |
|||
|
|||
namespace Unity.UIWidgets.widgets { |
|||
public class Visibility : StatelessWidget { |
|||
public Visibility( |
|||
Key key = null, |
|||
Widget child = null, |
|||
Widget replacement = null, |
|||
bool visible = true, |
|||
bool maintainState = false, |
|||
bool maintainAnimation = false, |
|||
bool maintainSize = false, |
|||
bool maintainInteractivity = false |
|||
) : base(key: key) { |
|||
D.assert(child != null); |
|||
D.assert(replacement != null); |
|||
D.assert(maintainState == true || maintainAnimation == false, |
|||
"Cannot maintain animations if the state is not also maintained."); |
|||
D.assert(maintainAnimation == true || maintainSize == false, |
|||
"Cannot maintain size if animations are not maintained."); |
|||
D.assert(maintainSize == true || maintainInteractivity == false, |
|||
"Cannot maintain interactivity if size is not maintained."); |
|||
this.replacement = replacement ?? SizedBox.shrink(); |
|||
this.child = child; |
|||
this.visible = visible; |
|||
this.maintainState = maintainState; |
|||
this.maintainAnimation = maintainAnimation; |
|||
this.maintainSize = maintainSize; |
|||
this.maintainInteractivity = maintainInteractivity; |
|||
} |
|||
|
|||
public readonly Widget child; |
|||
|
|||
public readonly Widget replacement; |
|||
|
|||
public readonly bool visible; |
|||
|
|||
public readonly bool maintainState; |
|||
|
|||
public readonly bool maintainAnimation; |
|||
|
|||
public readonly bool maintainSize; |
|||
|
|||
public readonly bool maintainInteractivity; |
|||
|
|||
public override Widget build(BuildContext context) { |
|||
if (this.maintainSize) { |
|||
Widget result = this.child; |
|||
if (!this.maintainInteractivity) { |
|||
result = new IgnorePointer( |
|||
child: this.child, |
|||
ignoring: !this.visible |
|||
); |
|||
} |
|||
|
|||
return new Opacity( |
|||
opacity: this.visible ? 1.0f : 0.0f, |
|||
child: result |
|||
); |
|||
} |
|||
|
|||
D.assert(!this.maintainInteractivity); |
|||
D.assert(!this.maintainSize); |
|||
if (this.maintainState) { |
|||
Widget result = this.child; |
|||
if (!this.maintainAnimation) { |
|||
result = new TickerMode(child: this.child, enabled: this.visible); |
|||
} |
|||
|
|||
return new Offstage( |
|||
child: result, |
|||
offstage: !this.visible |
|||
); |
|||
} |
|||
|
|||
D.assert(!this.maintainAnimation); |
|||
D.assert(!this.maintainState); |
|||
return this.visible ? this.child : this.replacement; |
|||
} |
|||
|
|||
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) { |
|||
base.debugFillProperties(properties); |
|||
properties.add(new FlagProperty("visible", value: this.visible, ifFalse: "hidden", ifTrue: "visible")); |
|||
properties.add(new FlagProperty("maintainState", value: this.maintainState, ifFalse: "maintainState")); |
|||
properties.add(new FlagProperty("maintainAnimation", value: this.maintainAnimation, |
|||
ifFalse: "maintainAnimation")); |
|||
properties.add(new FlagProperty("maintainSize", value: this.maintainSize, ifFalse: "maintainSize")); |
|||
properties.add(new FlagProperty("maintainInteractivity", value: this.maintainInteractivity, |
|||
ifFalse: "maintainInteractivity")); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: f24846c5a2354d9a8b02bf83f3e8398e |
|||
timeCreated: 1552895385 |
撰写
预览
正在加载...
取消
保存
Reference in new issue