siyao
4 年前
当前提交
7b5a9f48
共有 83 个文件被更改,包括 3122 次插入 和 2597 次删除
-
60Samples/UIWidgetsSamples_2019_4/Assets/CountDemo.unity
-
15Samples/UIWidgetsSamples_2019_4/Assets/Editor/EditorWindowSample/GalleryMain.cs
-
88Samples/UIWidgetsSamples_2019_4/Assets/Script/TextTest.cs
-
26Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/GalleryMain.cs
-
5Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/backdrop_demo.cs
-
239Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/bottom_app_bar_demo.cs
-
4Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/date_and_time_picker_demo.cs
-
12Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/search_demo.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/text_form_field_demo.cs
-
3Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/shrine/expanding_bottom_sheet.cs
-
5Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/backdrop.cs
-
4Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/demo.cs
-
3Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/demos.cs
-
3Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/ToDoAppSample.cs
-
142com.unity.uiwidgets/Editor/UIWidgetsEditorPanel.cs
-
23com.unity.uiwidgets/Editor/UIWidgetsPanelEditor.cs
-
12com.unity.uiwidgets/Runtime/cupertino/date_picker.cs
-
683com.unity.uiwidgets/Runtime/cupertino/nav_bar.cs
-
4com.unity.uiwidgets/Runtime/engine/DisplayMetrics.cs
-
6com.unity.uiwidgets/Runtime/engine/UIWidgetsMessageManager.cs
-
308com.unity.uiwidgets/Runtime/engine2/UIWidgetsPanel.cs
-
394com.unity.uiwidgets/Runtime/engine2/UIWidgetsPanelWrapper.cs
-
5com.unity.uiwidgets/Runtime/external/SplayTree.cs
-
2com.unity.uiwidgets/Runtime/external/simplejson/SimpleJSON.cs
-
7com.unity.uiwidgets/Runtime/foundation/assertions.cs
-
4com.unity.uiwidgets/Runtime/foundation/collections.cs
-
104com.unity.uiwidgets/Runtime/foundation/debug.cs
-
19com.unity.uiwidgets/Runtime/foundation/diagnostics.cs
-
5com.unity.uiwidgets/Runtime/gestures/hit_test.cs
-
2com.unity.uiwidgets/Runtime/material/about.cs
-
6com.unity.uiwidgets/Runtime/material/animated_icons/animated_icons_data.cs
-
4com.unity.uiwidgets/Runtime/material/animated_icons/data/add_event.g.cs
-
4com.unity.uiwidgets/Runtime/material/animated_icons/data/arrow_menu.g.cs
-
4com.unity.uiwidgets/Runtime/material/animated_icons/data/close_menu.g.cs
-
4com.unity.uiwidgets/Runtime/material/animated_icons/data/ellipsis_search.g.cs
-
4com.unity.uiwidgets/Runtime/material/animated_icons/data/event_add.g.cs
-
5com.unity.uiwidgets/Runtime/material/bottom_navigation_bar.cs
-
5com.unity.uiwidgets/Runtime/material/button_bar.cs
-
23com.unity.uiwidgets/Runtime/material/data_table.cs
-
12com.unity.uiwidgets/Runtime/material/dropdown.cs
-
3com.unity.uiwidgets/Runtime/material/feedback.cs
-
20com.unity.uiwidgets/Runtime/material/navigation_rail.cs
-
43com.unity.uiwidgets/Runtime/material/paginated_data_table.cs
-
9com.unity.uiwidgets/Runtime/material/range_slider.cs
-
3com.unity.uiwidgets/Runtime/material/text_selection.cs
-
6com.unity.uiwidgets/Runtime/painting/borders.cs
-
10com.unity.uiwidgets/Runtime/painting/gradient.cs
-
8com.unity.uiwidgets/Runtime/painting/image_provider.cs
-
4com.unity.uiwidgets/Runtime/painting/image_resolution.cs
-
14com.unity.uiwidgets/Runtime/painting/image_stream.cs
-
1com.unity.uiwidgets/Runtime/painting/shader_warmup.cs
-
18com.unity.uiwidgets/Runtime/painting/text_span.cs
-
278com.unity.uiwidgets/Runtime/painting/text_style.cs
-
9com.unity.uiwidgets/Runtime/rendering/sliver_multi_box_adaptor.cs
-
434com.unity.uiwidgets/Runtime/scheduler2/binding.cs
-
1com.unity.uiwidgets/Runtime/services/asset_bundle.cs
-
3com.unity.uiwidgets/Runtime/ui2/painting.cs
-
753com.unity.uiwidgets/Runtime/ui2/text.cs
-
1com.unity.uiwidgets/Runtime/ui2/window.cs
-
3com.unity.uiwidgets/Runtime/widgets/DiagnosticableTree.mixin.gen.cs
-
3com.unity.uiwidgets/Runtime/widgets/DiagnosticableTree.mixin.njk
-
21com.unity.uiwidgets/Runtime/widgets/DirectionalFocusTraversalPolicy.mixin.gen.cs
-
21com.unity.uiwidgets/Runtime/widgets/DirectionalFocusTraversalPolicy.mixin.njk
-
606com.unity.uiwidgets/Runtime/widgets/app.cs
-
11com.unity.uiwidgets/Runtime/widgets/basic.cs
-
20com.unity.uiwidgets/Runtime/widgets/focus_manager.cs
-
13com.unity.uiwidgets/Runtime/widgets/focus_traversal.cs
-
17com.unity.uiwidgets/Runtime/widgets/framework.cs
-
4com.unity.uiwidgets/Runtime/widgets/gesture_detector.cs
-
5com.unity.uiwidgets/Runtime/widgets/heroes.cs
-
289com.unity.uiwidgets/Runtime/widgets/image.cs
-
6com.unity.uiwidgets/Runtime/widgets/localizations.cs
-
26com.unity.uiwidgets/Runtime/widgets/navigator.cs
-
3com.unity.uiwidgets/Runtime/widgets/page_storage.cs
-
2com.unity.uiwidgets/Runtime/widgets/routes.cs
-
2com.unity.uiwidgets/Runtime/widgets/scroll_position.cs
-
513com.unity.uiwidgets/Runtime/widgets/shortcuts.cs
-
4com.unity.uiwidgets/Runtime/widgets/sliver.cs
-
7com.unity.uiwidgets/Runtime/widgets/viewport.cs
-
27com.unity.uiwidgets/Runtime/widgets/widget_inspector.cs
-
113Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/HoverSample.cs
-
40Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/NetWorkImageSample.cs
-
85com.unity.uiwidgets/Runtime/external/LinqUtils.cs
|
|||
using System.Collections.Generic; |
|||
using ui_ = Unity.UIWidgets.widgets.ui_; |
|||
using Unity.UIWidgets.widgets; |
|||
namespace UIWidgetsGallery { |
|||
public class GalleryMain : UIWidgetsPanel { |
|||
protected override void main() { |
|||
namespace UIWidgetsGallery |
|||
{ |
|||
public class GalleryMain : UIWidgetsPanel |
|||
{ |
|||
protected new void OnEnable() |
|||
{ |
|||
base.OnEnable(); |
|||
} |
|||
|
|||
protected override void main() |
|||
{ |
|||
protected new void OnEnable() { |
|||
base.OnEnable(); |
|||
protected override void onEnable() |
|||
{ |
|||
AddFont("Material Icons", new List<string> {"MaterialIcons-Regular.ttf"}, new List<int> {0}); |
|||
AddFont("CupertinoIcons", new List<string> {"CupertinoIcons.ttf"}, new List<int> {0}); |
|||
AddFont("GalleryIcons", new List<string> {"gallery/GalleryIcons.ttf"}, new List<int> {0}); |
|||
} |
|||
} |
683
com.unity.uiwidgets/Runtime/cupertino/nav_bar.cs
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
753
com.unity.uiwidgets/Runtime/ui2/text.cs
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
using Unity.UIWidgets.engine2; |
|||
using Unity.UIWidgets.foundation; |
|||
using Unity.UIWidgets.painting; |
|||
using Unity.UIWidgets.widgets; |
|||
using TextStyle = Unity.UIWidgets.painting.TextStyle; |
|||
using ui_ = Unity.UIWidgets.widgets.ui_; |
|||
using uiwidgets; |
|||
using Unity.UIWidgets.gestures; |
|||
using Unity.UIWidgets.material; |
|||
using Color = Unity.UIWidgets.ui.Color; |
|||
|
|||
namespace UIWidgetsSample |
|||
{ |
|||
/** |
|||
* |
|||
* STILL NOT WORKING, THERE SHOULD BE A BUG. FIX IT !!!! |
|||
* |
|||
*/ |
|||
public class HoverSample : UIWidgetsPanel |
|||
{ |
|||
protected void OnEnable() |
|||
{ |
|||
base.OnEnable(); |
|||
} |
|||
|
|||
protected override void main() |
|||
{ |
|||
ui_.runApp(new MyApp()); |
|||
} |
|||
|
|||
class MyApp : StatelessWidget |
|||
{ |
|||
public override Widget build(BuildContext context) |
|||
{ |
|||
return new MaterialApp( |
|||
debugShowCheckedModeBanner: false, |
|||
title: "Flutter Demo", |
|||
home: new Scaffold( |
|||
appBar: new AppBar(title: new Text("good")), |
|||
body: new Center( |
|||
child: new MyStatefulWidget() |
|||
) |
|||
) |
|||
); |
|||
} |
|||
} |
|||
|
|||
class MyStatefulWidget : StatefulWidget |
|||
{ |
|||
public MyStatefulWidget(Key key = null) : base(key: key) |
|||
{ |
|||
} |
|||
|
|||
public override State createState() => new _MyStatefulWidgetState(); |
|||
} |
|||
|
|||
class _MyStatefulWidgetState : State<MyStatefulWidget> |
|||
{ |
|||
Color textColor = Colors.blue; |
|||
int _enterCounter = 0; |
|||
int _exitCounter = 0; |
|||
float x = 0.0f; |
|||
float y = 0.0f; |
|||
|
|||
void _incrementEnter(PointerEvent details) |
|||
{ |
|||
UnityEngine.Debug.Log("enter"); |
|||
setState(() => { _enterCounter++; }); |
|||
} |
|||
|
|||
void _incrementExit(PointerEvent details) |
|||
{ |
|||
setState(() => |
|||
{ |
|||
textColor = Colors.blue; |
|||
_exitCounter++; |
|||
}); |
|||
} |
|||
|
|||
void _updateLocation(PointerEvent details) |
|||
{ |
|||
setState(() => |
|||
{ |
|||
textColor = Colors.red; |
|||
x = details.position.dx; |
|||
y = details.position.dy; |
|||
}); |
|||
} |
|||
|
|||
|
|||
public override Widget build(BuildContext context) |
|||
{ |
|||
return new MouseRegion( |
|||
onEnter: _incrementEnter, |
|||
onHover: _updateLocation, |
|||
onExit: _incrementExit, |
|||
child: new FlatButton( |
|||
color: Colors.white, |
|||
textColor: Colors.teal[700], //when hovered text color change
|
|||
shape: new RoundedRectangleBorder( |
|||
borderRadius: BorderRadius.circular(5), |
|||
side: new BorderSide( |
|||
color: Colors.teal[700] |
|||
) |
|||
), |
|||
onPressed: () => { }, |
|||
child: new Text("Log in", style: new TextStyle(color: textColor)) |
|||
) |
|||
); |
|||
} |
|||
} |
|||
} |
|||
} |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using Unity.UIWidgets.engine2; |
|||
using Unity.UIWidgets.material; |
|||
using Unity.UIWidgets.painting; |
|||
using Unity.UIWidgets.widgets; |
|||
using UnityEngine; |
|||
|
|||
namespace UIWidgetsSample |
|||
{ |
|||
public class NetWorkImageSample : UIWidgetsPanel |
|||
{ |
|||
protected override void main() |
|||
{ |
|||
ui_.runApp(new MaterialApp( |
|||
showPerformanceOverlay: false, |
|||
home: new NetWorkeImageWidget())); |
|||
} |
|||
|
|||
class NetWorkeImageWidget : StatelessWidget { |
|||
public override Widget build(BuildContext context) { |
|||
var title = "NetWork Image"; |
|||
|
|||
return new MaterialApp( |
|||
title: title, |
|||
home: new Scaffold( |
|||
appBar: new AppBar( |
|||
title: new Text(title) |
|||
), |
|||
body: Image.network("https://picsum.photos/250?image=2") |
|||
) |
|||
); |
|||
} |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
|
|
|||
using System.Collections.Generic; |
|||
|
|||
namespace Unity.UIWidgets.external |
|||
{ |
|||
public static class LinqUtils<T, S> |
|||
{ |
|||
public delegate T CreateItem(S item); |
|||
|
|||
public delegate bool FilterDict(S value); |
|||
|
|||
public static List<T> SelectList(IEnumerable<S> items, CreateItem createItem) |
|||
{ |
|||
if (items == null) |
|||
return null; |
|||
var results = new List<T>(); |
|||
foreach (var item in items) results.Add(createItem(item)); |
|||
|
|||
return results; |
|||
} |
|||
|
|||
public static T[] SelectArray(List<S> items, CreateItem createItem) |
|||
{ |
|||
if (items == null) |
|||
return null; |
|||
|
|||
var itemCount = items.Count; |
|||
var results = new T[itemCount]; |
|||
for (var i= 0; i < itemCount; i++) |
|||
{ |
|||
results[i] = createItem(items[i]); |
|||
} |
|||
|
|||
return results; |
|||
} |
|||
|
|||
public static Dictionary<T, S> SelectDictionary(IEnumerable<S> items, CreateItem createItem) |
|||
{ |
|||
if (items == null) |
|||
return null; |
|||
var results = new Dictionary<T, S>(); |
|||
foreach (var item in items) results.Add(createItem(item), item); |
|||
return results; |
|||
} |
|||
|
|||
public static Dictionary<T, S> WhereDictionary(Dictionary<T, S> items, FilterDict filterDict) |
|||
{ |
|||
if (items == null) |
|||
return null; |
|||
var results = new Dictionary<T, S>(); |
|||
foreach (var item in items) |
|||
if (filterDict(item.Value)) |
|||
results.Add(item.Key, item.Value); |
|||
return results; |
|||
} |
|||
} |
|||
|
|||
public static class LinqUtils<T> |
|||
{ |
|||
public delegate T CreateItem(T item); |
|||
|
|||
public delegate bool FilterItem(T item); |
|||
|
|||
public static List<T> SelectList(IEnumerable<T> items, CreateItem createItem) |
|||
{ |
|||
if (items == null) |
|||
return null; |
|||
var results = new List<T>(); |
|||
foreach (var item in items) results.Add(createItem(item)); |
|||
|
|||
return results; |
|||
} |
|||
|
|||
public static List<T> WhereList(IEnumerable<T> items, FilterItem filterItem) |
|||
{ |
|||
if (items == null) |
|||
return null; |
|||
var results = new List<T>(); |
|||
foreach (var item in items) |
|||
if (filterItem(item)) |
|||
results.Add(item); |
|||
|
|||
return results; |
|||
} |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue