浏览代码

Merge branch 'gallery' into 'master'

Gallery

See merge request upm-packages/ui-widgets/com.unity.uiwidgets!146
/main
Xingwei Zhu 6 年前
当前提交
82c377ea
共有 68 个文件被更改,包括 23509 次插入36 次删除
  1. 146
      Runtime/material/bottom_sheet.cs
  2. 2
      Runtime/material/scaffold.cs
  3. 164
      Runtime/rendering/proxy_box.cs
  4. 36
      Runtime/widgets/basic.cs
  5. 32
      Samples/UIWidgetsGallery/gallery/demo.cs
  6. 56
      Samples/UIWidgetsGallery/gallery/demos.cs
  7. 113
      Runtime/material/bottom_app_bar.cs
  8. 3
      Runtime/material/bottom_app_bar.cs.meta
  9. 183
      Runtime/material/radio.cs
  10. 3
      Runtime/material/radio.cs.meta
  11. 71
      Runtime/painting/notched_shapes.cs
  12. 3
      Runtime/painting/notched_shapes.cs.meta
  13. 423
      Samples/UIWidgetsGallery/demo/material/backdrop_demo.cs
  14. 3
      Samples/UIWidgetsGallery/demo/material/backdrop_demo.cs.meta
  15. 523
      Samples/UIWidgetsGallery/demo/material/bottom_app_bar_demo.cs
  16. 3
      Samples/UIWidgetsGallery/demo/material/bottom_app_bar_demo.cs.meta
  17. 217
      Samples/UIWidgetsGallery/demo/material/cards_demo.cs
  18. 3
      Samples/UIWidgetsGallery/demo/material/cards_demo.cs.meta
  19. 1001
      Tests/Resources/india_chettinad_silk_maker.png
  20. 88
      Tests/Resources/india_chettinad_silk_maker.png.meta
  21. 1001
      Tests/Resources/india_thanjavur_market.png
  22. 88
      Tests/Resources/india_thanjavur_market.png.meta
  23. 8
      Tests/Resources/products.meta
  24. 1001
      Tests/Resources/products/backpack.png
  25. 88
      Tests/Resources/products/backpack.png.meta
  26. 1001
      Tests/Resources/products/belt.png
  27. 88
      Tests/Resources/products/belt.png.meta
  28. 406
      Tests/Resources/products/cup.png
  29. 88
      Tests/Resources/products/cup.png.meta
  30. 1001
      Tests/Resources/products/deskset.png
  31. 88
      Tests/Resources/products/deskset.png.meta
  32. 702
      Tests/Resources/products/dress.png
  33. 88
      Tests/Resources/products/dress.png.meta
  34. 1001
      Tests/Resources/products/earrings.png
  35. 88
      Tests/Resources/products/earrings.png.meta
  36. 408
      Tests/Resources/products/flatwear.png
  37. 88
      Tests/Resources/products/flatwear.png.meta
  38. 852
      Tests/Resources/products/hat.png
  39. 88
      Tests/Resources/products/hat.png.meta
  40. 702
      Tests/Resources/products/jacket.png
  41. 88
      Tests/Resources/products/jacket.png.meta
  42. 676
      Tests/Resources/products/jumper.png
  43. 88
      Tests/Resources/products/jumper.png.meta
  44. 1001
      Tests/Resources/products/kitchen_quattro.png
  45. 88
      Tests/Resources/products/kitchen_quattro.png.meta
  46. 1001
      Tests/Resources/products/napkins.png
  47. 88
      Tests/Resources/products/napkins.png.meta
  48. 984
      Tests/Resources/products/planters.png
  49. 88
      Tests/Resources/products/planters.png.meta
  50. 908
      Tests/Resources/products/platter.png
  51. 88
      Tests/Resources/products/platter.png.meta
  52. 1001
      Tests/Resources/products/scarf.png
  53. 88
      Tests/Resources/products/scarf.png.meta
  54. 808
      Tests/Resources/products/shirt.png
  55. 88
      Tests/Resources/products/shirt.png.meta
  56. 360
      Tests/Resources/products/sunnies.png
  57. 88
      Tests/Resources/products/sunnies.png.meta
  58. 807
      Tests/Resources/products/sweater.png
  59. 88
      Tests/Resources/products/sweater.png.meta
  60. 967
      Tests/Resources/products/sweats.png
  61. 88
      Tests/Resources/products/sweats.png.meta
  62. 285
      Tests/Resources/products/table.png
  63. 88
      Tests/Resources/products/table.png.meta
  64. 711
      Tests/Resources/products/teaset.png
  65. 88
      Tests/Resources/products/teaset.png.meta
  66. 856
      Tests/Resources/products/top.png
  67. 88
      Tests/Resources/products/top.png.meta

146
Runtime/material/bottom_sheet.cs


using System;
using RSG;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;

using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.material {
static class BottomSheetUtils {
public static class BottomSheetUtils {
public static IPromise<object> showModalBottomSheet<T>(
BuildContext context,
WidgetBuilder builder
) {
D.assert(context != null);
D.assert(builder != null);
D.assert(MaterialD.debugCheckHasMaterialLocalizations(context));
return Navigator.push(context, new _ModalBottomSheetRoute<T>(
builder: builder,
theme: Theme.of(context, shadowThemeOnly: true),
barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel
));
}
public static PersistentBottomSheetController<object> showBottomSheet(
BuildContext context,
WidgetBuilder builder
) {
D.assert(context != null);
D.assert(builder != null);
return Scaffold.of(context).showBottomSheet(builder);
}
}

onVerticalDragEnd: this._handleDragEnd,
child: bottomSheet
);
}
}
class _ModalBottomSheetLayout : SingleChildLayoutDelegate {
public _ModalBottomSheetLayout(float progress) {
this.progress = progress;
}
public readonly float progress;
public override BoxConstraints getConstraintsForChild(BoxConstraints constraints) {
return new BoxConstraints(
minWidth: constraints.maxWidth,
maxWidth: constraints.maxWidth,
minHeight: 0.0f,
maxHeight: constraints.maxHeight * 9.0f / 16.0f
);
}
public override Offset getPositionForChild(Size size, Size childSize) {
return new Offset(0.0f, size.height - childSize.height * this.progress);
}
public override bool shouldRelayout(SingleChildLayoutDelegate _oldDelegate) {
_ModalBottomSheetLayout oldDelegate = _oldDelegate as _ModalBottomSheetLayout;
return this.progress != oldDelegate.progress;
}
}
class _ModalBottomSheet<T> : StatefulWidget {
public _ModalBottomSheet(Key key = null, _ModalBottomSheetRoute<T> route = null) : base(key: key) {
this.route = route;
}
public readonly _ModalBottomSheetRoute<T> route;
public override State createState() {
return new _ModalBottomSheetState<T>();
}
}
class _ModalBottomSheetState<T> : State<_ModalBottomSheet<T>> {
public override Widget build(BuildContext context) {
MediaQueryData mediaQuery = MediaQuery.of(context);
MaterialLocalizations localizations = MaterialLocalizations.of(context);
string routeLabel = "";
return new GestureDetector(
onTap: () => Navigator.pop(context),
child: new AnimatedBuilder(
animation: this.widget.route.animation,
builder: (BuildContext _context, Widget child) => {
float animationValue =
mediaQuery.accessibleNavigation ? 1.0f : this.widget.route.animation.value;
return new ClipRect(
child: new CustomSingleChildLayout(
layoutDelegate: new _ModalBottomSheetLayout(animationValue),
child: new BottomSheet(
animationController: this.widget.route._animationController,
onClosing: () => Navigator.pop(_context),
builder: this.widget.route.builder
)
)
);
}
)
);
}
}
class _ModalBottomSheetRoute<T> : PopupRoute {
public _ModalBottomSheetRoute(
WidgetBuilder builder = null,
ThemeData theme = null,
string barrierLabel = null,
RouteSettings settings = null
) : base(settings: settings) {
this.builder = builder;
this.theme = theme;
this.barrierLabel = barrierLabel;
}
public readonly WidgetBuilder builder;
public readonly ThemeData theme;
public override TimeSpan transitionDuration {
get { return BottomSheetUtils._kBottomSheetDuration; }
}
public override bool barrierDismissible {
get { return true; }
}
public readonly string barrierLabel;
public override Color barrierColor {
get { return Colors.black54; }
}
public AnimationController _animationController;
public override AnimationController createAnimationController() {
D.assert(this._animationController == null);
this._animationController = BottomSheet.createAnimationController(this.navigator.overlay);
return this._animationController;
}
public override Widget buildPage(BuildContext context, Animation<float> animation,
Animation<float> secondaryAnimation) {
Widget bottomSheet = MediaQuery.removePadding(
context: context,
removeTop: true,
child: new _ModalBottomSheet<T>(route: this)
);
if (this.theme != null) {
bottomSheet = new Theme(data: this.theme, child: bottomSheet);
}
return bottomSheet;
}
}
}

2
Runtime/material/scaffold.cs


"The context used was:\n" + context);
}
static ValueListenable<ScaffoldGeometry> geometryOf(BuildContext context) {
public static ValueListenable<ScaffoldGeometry> geometryOf(BuildContext context) {
_ScaffoldScope scaffoldScope =
(_ScaffoldScope) context.inheritFromWidgetOfExactType(typeof(_ScaffoldScope));
if (scaffoldScope == null) {

164
Runtime/rendering/proxy_box.cs


this._debugPaint.strokeWidth = 2.0f;
this._debugPaint.style = PaintingStyle.stroke;
}
if (this._debugText == null) {
this._debugText = new TextPainter(
text: new TextSpan(

));
this._debugText.layout();
}
return true;
});
}

public override bool hitTest(HitTestResult result, Offset position = null) {
D.assert(position != null);
if (this._clipper != null) {
this._updateClip();
D.assert(this._clip != null);

properties.add(new DiagnosticsProperty<Offset>("origin", this.origin));
properties.add(new DiagnosticsProperty<Alignment>("alignment", this.alignment));
properties.add(new DiagnosticsProperty<bool>("transformHitTests", this.transformHitTests));
}
}
public class RenderFittedBox : RenderProxyBox {
public RenderFittedBox(
BoxFit fit = BoxFit.contain,
Alignment alignment = null,
RenderBox child = null
) : base(child) {
D.assert(fit != null);
this._fit = fit;
this._alignment = alignment ?? Alignment.center;
}
Alignment _resolvedAlignment;
void _resolve() {
if (this._resolvedAlignment != null) {
return;
}
this._resolvedAlignment = this.alignment;
}
void _markNeedResolution() {
this._resolvedAlignment = null;
this.markNeedsPaint();
}
public BoxFit fit {
get { return this._fit; }
set {
D.assert(value != null);
if (this._fit == value) {
return;
}
this._fit = value;
this._clearPaintData();
this.markNeedsPaint();
}
}
BoxFit _fit;
public Alignment alignment {
get { return this._alignment; }
set {
D.assert(value != null);
if (this._alignment == value) {
return;
}
this._alignment = value;
this._clearPaintData();
this._markNeedResolution();
}
}
Alignment _alignment;
protected override void performLayout() {
if (this.child != null) {
this.child.layout(new BoxConstraints(), parentUsesSize: true);
this.size = this.constraints.constrainSizeAndAttemptToPreserveAspectRatio(this.child.size);
this._clearPaintData();
}
else {
this.size = this.constraints.smallest;
}
}
bool? _hasVisualOverflow;
Matrix3 _transform;
void _clearPaintData() {
this._hasVisualOverflow = null;
this._transform = null;
}
void _updatePaintData() {
if (this._transform != null) {
return;
}
if (this.child == null) {
this._hasVisualOverflow = false;
this._transform = Matrix3.I();
}
else {
this._resolve();
Size childSize = this.child.size;
FittedSizes sizes = FittedSizes.applyBoxFit(this._fit, childSize, this.size);
float scaleX = sizes.destination.width / sizes.source.width;
float scaleY = sizes.destination.height / sizes.source.height;
Rect sourceRect = this._resolvedAlignment.inscribe(sizes.source, Offset.zero & childSize);
Rect destinationRect = this._resolvedAlignment.inscribe(sizes.destination, Offset.zero & this.size);
this._hasVisualOverflow = sourceRect.width < childSize.width || sourceRect.height < childSize.height;
this._transform = Matrix3.makeTrans(destinationRect.left, destinationRect.top);
this._transform.postScale(scaleX, scaleY);
this._transform.postTranslate(-sourceRect.left, -sourceRect.top);
}
}
void _paintChildWithTransform(PaintingContext context, Offset offset) {
Offset childOffset = this._transform.getAsTranslation();
if (childOffset == null) {
context.pushTransform(this.needsCompositing, offset, this._transform, base.paint);
}
else {
base.paint(context, offset + childOffset);
}
}
public override void paint(PaintingContext context, Offset offset) {
if (this.size.isEmpty) {
return;
}
this._updatePaintData();
if (this.child != null) {
if (this._hasVisualOverflow == true) {
context.pushClipRect(this.needsCompositing, offset, Offset.zero & this.size,
this._paintChildWithTransform);
}
else {
this._paintChildWithTransform(context, offset);
}
}
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
if (this.size.isEmpty) {
return false;
}
this._updatePaintData();
Matrix3 inverse = Matrix3.I();
if (!this._transform.invert(inverse)) {
return false;
}
position = inverse.mapPoint(position);
return base.hitTestChildren(result, position: position);
}
public override void applyPaintTransform(RenderObject child, Matrix3 transform) {
if (this.size.isEmpty) {
transform.setAll(0, 0, 0, 0, 0, 0, 0, 0, 0);
}
else {
this._updatePaintData();
transform.postConcat(this._transform);
}
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new EnumProperty<BoxFit>("fit", this.fit));
properties.add(new DiagnosticsProperty<Alignment>("alignment", this.alignment));
}
}

36
Runtime/widgets/basic.cs


}
}
public class FittedBox : SingleChildRenderObjectWidget {
public FittedBox(
Key key = null,
BoxFit fit = BoxFit.contain,
Alignment alignment = null,
Widget child = null
) : base(key: key, child: child) {
D.assert(fit != null);
this.fit = fit;
this.alignment = alignment ?? Alignment.center;
}
public readonly BoxFit fit;
public readonly Alignment alignment;
public override RenderObject createRenderObject(BuildContext context) {
return new RenderFittedBox(
fit: this.fit,
alignment: this.alignment
);
}
public override void updateRenderObject(BuildContext context, RenderObject _renderObject) {
RenderFittedBox renderObject = _renderObject as RenderFittedBox;
renderObject.fit = this.fit;
renderObject.alignment = this.alignment;
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new EnumProperty<BoxFit>("fit", this.fit));
properties.add(new DiagnosticsProperty<Alignment>("alignment", this.alignment));
}
}
public class FractionalTranslation : SingleChildRenderObjectWidget {
public FractionalTranslation(Key key = null, Offset translation = null,
bool transformHitTests = true, Widget child = null) : base(key: key, child: child) {

32
Samples/UIWidgetsGallery/gallery/demo.cs


using Unity.UIWidgets.painting;
using Unity.UIWidgets.service;
using Unity.UIWidgets.widgets;
using UnityEngine;
class ComponentDemoTabData {
public class ComponentDemoTabData {
public ComponentDemoTabData(
Widget demoWidget = null,
string exampleCodeTag = null,

}
class TabbedComponentDemoScaffold : StatelessWidget {
public class TabbedComponentDemoScaffold : StatelessWidget {
public TabbedComponentDemoScaffold(
string title = null,
List<ComponentDemoTabData> demos = null,

}
class FullScreenCodeDialog : StatefulWidget {
public class FullScreenCodeDialog : StatefulWidget {
public FullScreenCodeDialog(Key key = null, string exampleCodeTag = null) : base(key: key) {
this.exampleCodeTag = exampleCodeTag;
}

}
}
class FullScreenCodeDialogState : State<FullScreenCodeDialog> {
public class FullScreenCodeDialogState : State<FullScreenCodeDialog> {
public FullScreenCodeDialogState() {
}

base.didChangeDependencies();
string code = new ExampleCodeParser().getExampleCode(this.widget.exampleCodeTag, DefaultAssetBundle.of(this.context));
string code =
new ExampleCodeParser().getExampleCode(this.widget.exampleCodeTag, DefaultAssetBundle.of(this.context));
if (this.mounted) {
this.setState(() => { this._exampleCode = code; });
}

title: new Text("Example code")
),
body: body
);
}
}
class MaterialDemoDocumentationButton : StatelessWidget {
public MaterialDemoDocumentationButton(string routeName, Key key = null) : base(key: key) {
this.documentationUrl = DemoUtils.kDemoDocumentationUrl[routeName];
D.assert(DemoUtils.kDemoDocumentationUrl[routeName] != null,
"A documentation URL was not specified for demo route $routeName in kAllGalleryDemos"
);
}
public readonly string documentationUrl;
public override Widget build(BuildContext context) {
return new IconButton(
icon: new Icon(Icons.library_books),
tooltip: "API documentation",
onPressed: () => Application.OpenURL(this.documentationUrl)
);
}
}

56
Samples/UIWidgetsGallery/gallery/demos.cs


routeName: TypographyDemo.routeName,
buildRoute: (BuildContext context) => new TypographyDemo()
),
//
// // Material Components
// new GalleryDemo(
// title: "Backdrop",
// subtitle: "Select a front layer from back layer",
// icon: GalleryIcons.backdrop,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: BackdropDemo.routeName,
// buildRoute: (BuildContext context) => BackdropDemo()
// ),
// new GalleryDemo(
// title: "Bottom app bar",
// subtitle: "Optional floating action button notch",
// icon: GalleryIcons.bottom_app_bar,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: BottomAppBarDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/BottomAppBar-class.html",
// buildRoute: (BuildContext context) => BottomAppBarDemo()
// ),
// Material Components
new GalleryDemo(
title: "Backdrop",
subtitle: "Select a front layer from back layer",
icon: GalleryIcons.backdrop,
category: DemoUtils._kMaterialComponents,
routeName: BackdropDemo.routeName,
buildRoute: (BuildContext context) => new BackdropDemo()
),
new GalleryDemo(
title: "Bottom app bar",
subtitle: "Optional floating action button notch",
icon: GalleryIcons.bottom_app_bar,
category: DemoUtils._kMaterialComponents,
routeName: BottomAppBarDemo.routeName,
documentationUrl: "https://docs.flutter.io/flutter/material/BottomAppBar-class.html",
buildRoute: (BuildContext context) => new BottomAppBarDemo()
),
// new GalleryDemo(
// title: "Bottom navigation",
// subtitle: "Bottom navigation with cross-fading views",

// documentationUrl: "https://docs.flutter.io/flutter/material/FloatingActionButton-class.html",
// buildRoute: (BuildContext context) => TabsFabDemo()
// ),
// new GalleryDemo(
// title: "Cards",
// subtitle: "Baseline cards with rounded corners",
// icon: GalleryIcons.cards,
// category: GalleryDemoCategory._kMaterialComponents,
// routeName: CardsDemo.routeName,
// documentationUrl: "https://docs.flutter.io/flutter/material/Card-class.html",
// buildRoute: (BuildContext context) => CardsDemo()
// ),
new GalleryDemo(
title: "Cards",
subtitle: "Baseline cards with rounded corners",
icon: GalleryIcons.cards,
category: DemoUtils._kMaterialComponents,
routeName: CardsDemo.routeName,
documentationUrl: "https://docs.flutter.io/flutter/material/Card-class.html",
buildRoute: (BuildContext context) => new CardsDemo()
),
// new GalleryDemo(
// title: "Chips",
// subtitle: "Labeled with delete buttons and avatars",

113
Runtime/material/bottom_app_bar.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.material {
public class BottomAppBar : StatefulWidget {
public BottomAppBar(
Key key = null,
Color color = null,
float elevation = 8.0f,
NotchedShape shape = null,
Clip clipBehavior = Clip.none,
float notchMargin = 4.0f,
Widget child = null
) : base(key: key) {
D.assert(elevation != null);
D.assert(elevation >= 0.0f);
D.assert(clipBehavior != null);
this.child = child;
this.color = color;
this.elevation = elevation;
this.shape = shape;
this.clipBehavior = clipBehavior;
this.notchMargin = notchMargin;
}
public readonly Widget child;
public readonly Color color;
public readonly float elevation;
public readonly NotchedShape shape;
public readonly Clip clipBehavior;
public readonly float notchMargin;
public override State createState() {
return new _BottomAppBarState();
}
}
class _BottomAppBarState : State<BottomAppBar> {
ValueListenable<ScaffoldGeometry> geometryListenable;
public override void didChangeDependencies() {
base.didChangeDependencies();
this.geometryListenable = Scaffold.geometryOf(this.context);
}
public override Widget build(BuildContext context) {
CustomClipper<Path> clipper = this.widget.shape != null
? (CustomClipper<Path>) new _BottomAppBarClipper(
geometry: this.geometryListenable,
shape: this.widget.shape,
notchMargin: this.widget.notchMargin
)
: new ShapeBorderClipper(shape: new RoundedRectangleBorder());
return new PhysicalShape(
clipper: clipper,
elevation: this.widget.elevation,
color: this.widget.color ?? Theme.of(context).bottomAppBarColor,
clipBehavior: this.widget.clipBehavior,
child: new Material(
type: MaterialType.transparency,
child: this.widget.child == null
? null
: new SafeArea(child: this.widget.child)
)
);
}
}
class _BottomAppBarClipper : CustomClipper<Path> {
public _BottomAppBarClipper(
ValueListenable<ScaffoldGeometry> geometry,
NotchedShape shape,
float notchMargin
) : base(reclip: geometry) {
D.assert(geometry != null);
D.assert(shape != null);
D.assert(notchMargin != null);
this.geometry = geometry;
this.shape = shape;
this.notchMargin = notchMargin;
}
public readonly ValueListenable<ScaffoldGeometry> geometry;
public readonly NotchedShape shape;
public readonly float notchMargin;
public override Path getClip(Size size) {
Rect appBar = Offset.zero & size;
if (this.geometry.value.floatingActionButtonArea == null) {
Path path = new Path();
path.addRect(appBar);
return path;
}
Rect button = this.geometry.value.floatingActionButtonArea
.translate(0.0f, (this.geometry.value.bottomNavigationBarTop * -1.0f) ?? 0.0f);
return this.shape.getOuterPath(appBar, button.inflate(this.notchMargin));
}
public override bool shouldReclip(CustomClipper<Path> oldClipper) {
return (oldClipper as _BottomAppBarClipper).geometry != this.geometry;
}
}
}

3
Runtime/material/bottom_app_bar.cs.meta


fileFormatVersion: 2
guid: aa89369405044a62a19225b2c20815f6
timeCreated: 1553156127

183
Runtime/material/radio.cs


using System;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.material {
class RadioUtils {
public const float _kOuterRadius = 8.0f;
public const float _kInnerRadius = 4.5f;
}
public class Radio<T> : StatefulWidget where T : class {
public Radio(
Key key = null,
T value = null,
T groupValue = null,
ValueChanged<T> onChanged = null,
Color activeColor = null,
MaterialTapTargetSize? materialTapTargetSize = null
) : base(key: key) {
D.assert(value != null);
D.assert(groupValue != null);
D.assert(onChanged != null);
this.value = value;
this.groupValue = groupValue;
this.onChanged = onChanged;
this.activeColor = activeColor;
this.materialTapTargetSize = materialTapTargetSize;
}
public readonly T value;
public readonly T groupValue;
public readonly ValueChanged<T> onChanged;
public readonly Color activeColor;
public readonly MaterialTapTargetSize? materialTapTargetSize;
public override State createState() {
return new _RadioState<T>();
}
}
class _RadioState<T> : TickerProviderStateMixin<Radio<T>> where T : class {
bool _enabled {
get { return this.widget.onChanged != null; }
}
Color _getInactiveColor(ThemeData themeData) {
return this._enabled ? themeData.unselectedWidgetColor : themeData.disabledColor;
}
void _handleChanged(bool? selected) {
if (selected == true) {
this.widget.onChanged(this.widget.value);
}
}
public override Widget build(BuildContext context) {
D.assert(MaterialD.debugCheckHasMaterial(context));
ThemeData themeData = Theme.of(context);
Size size;
switch (this.widget.materialTapTargetSize ?? themeData.materialTapTargetSize) {
case MaterialTapTargetSize.padded:
size = new Size(2 * Constants.kRadialReactionRadius + 8.0f,
2 * Constants.kRadialReactionRadius + 8.0f);
break;
case MaterialTapTargetSize.shrinkWrap:
size = new Size(2 * Constants.kRadialReactionRadius, 2 * Constants.kRadialReactionRadius);
break;
default:
throw new Exception("Unknown material tap target size");
}
BoxConstraints additionalConstraints = BoxConstraints.tight(size);
return new _RadioRenderObjectWidget(
selected: this.widget.value == this.widget.groupValue,
activeColor: this.widget.activeColor ?? themeData.toggleableActiveColor,
inactiveColor: this._getInactiveColor(themeData),
onChanged: this._enabled ? this._handleChanged : (ValueChanged<bool?>) null,
additionalConstraints: additionalConstraints,
vsync: this
);
}
}
class _RadioRenderObjectWidget : LeafRenderObjectWidget {
public _RadioRenderObjectWidget(
Key key = null,
bool? selected = null,
Color activeColor = null,
Color inactiveColor = null,
BoxConstraints additionalConstraints = null,
ValueChanged<bool?> onChanged = null,
TickerProvider vsync = null
) : base(key: key) {
D.assert(selected != null);
D.assert(activeColor != null);
D.assert(inactiveColor != null);
D.assert(additionalConstraints != null);
D.assert(vsync != null);
this.selected = selected;
this.activeColor = activeColor;
this.inactiveColor = inactiveColor;
this.additionalConstraints = additionalConstraints;
this.onChanged = onChanged;
this.vsync = vsync;
}
public readonly bool? selected;
public readonly Color activeColor;
public readonly Color inactiveColor;
public readonly BoxConstraints additionalConstraints;
public readonly ValueChanged<bool?> onChanged;
public readonly TickerProvider vsync;
public override RenderObject createRenderObject(BuildContext context) {
return new _RenderRadio(
value: this.selected,
activeColor: this.activeColor,
inactiveColor: this.inactiveColor,
onChanged: this.onChanged,
vsync: this.vsync,
additionalConstraints: this.additionalConstraints
);
}
public override void updateRenderObject(BuildContext context, RenderObject _renderObject) {
_RenderRadio renderObject = _renderObject as _RenderRadio;
renderObject.value = this.selected;
renderObject.activeColor = this.activeColor;
renderObject.inactiveColor = this.inactiveColor;
renderObject.onChanged = this.onChanged;
renderObject.additionalConstraints = this.additionalConstraints;
renderObject.vsync = this.vsync;
}
}
class _RenderRadio : RenderToggleable {
public _RenderRadio(
bool? value,
Color activeColor,
Color inactiveColor,
ValueChanged<bool?> onChanged,
BoxConstraints additionalConstraints,
TickerProvider vsync
) : base(
value: value,
tristate: false,
activeColor: activeColor,
inactiveColor: inactiveColor,
onChanged: onChanged,
additionalConstraints: additionalConstraints,
vsync: vsync
) {
}
public override void paint(PaintingContext context, Offset offset) {
Canvas canvas = context.canvas;
this.paintRadialReaction(canvas, offset,
new Offset(Constants.kRadialReactionRadius, Constants.kRadialReactionRadius));
Offset center = (offset & this.size).center;
Color radioColor = this.onChanged != null ? this.activeColor : this.inactiveColor;
Paint paint = new Paint();
paint.color = Color.lerp(this.inactiveColor, radioColor, this.position.value);
paint.style = PaintingStyle.stroke;
paint.strokeWidth = 2.0f;
canvas.drawCircle(center, RadioUtils._kOuterRadius, paint);
if (!this.position.isDismissed) {
paint.style = PaintingStyle.fill;
canvas.drawCircle(center, RadioUtils._kInnerRadius * this.position.value, paint);
}
}
}
}

3
Runtime/material/radio.cs.meta


fileFormatVersion: 2
guid: 1328fb437a4047c49b51dfe3a2c3d106
timeCreated: 1553154501

71
Runtime/painting/notched_shapes.cs


using System.Collections.Generic;
using Unity.UIWidgets.ui;
using UnityEngine;
using Rect = Unity.UIWidgets.ui.Rect;
namespace Unity.UIWidgets.painting {
public abstract class NotchedShape {
public NotchedShape() {
}
public abstract Path getOuterPath(Rect host, Rect guest);
}
public class CircularNotchedRectangle : NotchedShape {
public CircularNotchedRectangle() {
}
public override Path getOuterPath(Rect host, Rect guest) {
if (!host.overlaps(guest)) {
Path path = new Path();
path.addRect(host);
return path;
}
float notchRadius = guest.width / 2.0f;
const float s1 = 15.0f;
const float s2 = 1.0f;
float r = notchRadius;
float a = -1.0f * r - s2;
float b = host.top - guest.center.dy;
float n2 = Mathf.Sqrt(b * b * r * r * (a * a + b * b - r * r));
float p2xA = ((a * r * r) - n2) / (a * a + b * b);
float p2xB = ((a * r * r) + n2) / (a * a + b * b);
float p2yA = Mathf.Sqrt(r * r - p2xA * p2xA);
float p2yB = Mathf.Sqrt(r * r - p2xB * p2xB);
List<Offset> p = new List<Offset>(6);
p[0] = new Offset(a - s1, b);
p[1] = new Offset(a, b);
float cmp = b < 0 ? -1.0f : 1.0f;
p[2] = cmp * p2yA > cmp * p2yB ? new Offset(p2xA, p2yA) : new Offset(p2xB, p2yB);
p[3] = new Offset(-1.0f * p[2].dx, p[2].dy);
p[4] = new Offset(-1.0f * p[1].dx, p[1].dy);
p[5] = new Offset(-1.0f * p[0].dx, p[0].dy);
for (int i = 0; i < p.Count; i += 1) {
p[i] += guest.center;
}
Path ret = new Path();
ret.moveTo(host.left, host.top);
ret.lineTo(p[0].dx, p[0].dy);
ret.quadTo(p[1].dx, p[1].dy, p[2].dx, p[2].dy);
// TODO: replace this lineTo() with arcToPoint when arcToPoint is ready
ret.lineTo(p[3].dx, p[3].dy);
// ret.arcToPoint(p[3], p[3], radius: Radius.circular(notchRadius), clockwise: false);
ret.quadTo(p[4].dx, p[4].dy, p[5].dx, p[5].dy);
ret.lineTo(host.right, host.top);
ret.lineTo(host.right, host.bottom);
ret.lineTo(host.left, host.bottom);
ret.close();
return ret;
}
}
}

3
Runtime/painting/notched_shapes.cs.meta


fileFormatVersion: 2
guid: c89c524fa7c242aa91900b63841be8b3
timeCreated: 1553153571

423
Samples/UIWidgetsGallery/demo/material/backdrop_demo.cs


using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;
using Image = Unity.UIWidgets.widgets.Image;
using Material = Unity.UIWidgets.material.Material;
namespace UIWidgetsGallery.gallery {
class BackdropDemoConstants {
public static readonly List<Category> allCategories = new List<Category> {
new Category(
title: "Accessories",
assets: new List<string> {
"products/belt",
"products/earrings",
"products/backpack",
"products/hat",
"products/scarf",
"products/sunnies"
}
),
new Category(
title: "Blue",
assets: new List<string> {
"products/backpack",
"products/cup",
"products/napkins",
"products/top"
}
),
new Category(
title: "Cold Weather",
assets: new List<string> {
"products/jacket",
"products/jumper",
"products/scarf",
"products/sweater",
"products/sweats"
}
),
new Category(
title: "Home",
assets: new List<string> {
"products/cup",
"products/napkins",
"products/planters",
"products/table",
"products/teaset"
}
),
new Category(
title: "Tops",
assets: new List<string> {
"products/jumper",
"products/shirt",
"products/sweater",
"products/top"
}
),
new Category(
title: "Everything",
assets: new List<string> {
"products/backpack",
"products/belt",
"products/cup",
"products/dress",
"products/earrings",
"products/flatwear",
"products/hat",
"products/jacket",
"products/jumper",
"products/napkins",
"products/planters",
"products/scarf",
"products/shirt",
"products/sunnies",
"products/sweater",
"products/sweats",
"products/table",
"products/teaset",
"products/top"
}
),
};
}
public class Category {
public Category(string title = null, List<string> assets = null) {
this.title = title;
this.assets = assets;
}
public readonly string title;
public readonly List<string> assets;
public override string ToString() {
return $"{this.GetType()}('{this.title}')";
}
}
public class CategoryView : StatelessWidget {
public CategoryView(Key key = null, Category category = null) : base(key: key) {
this.category = category;
}
public readonly Category category;
public override Widget build(BuildContext context) {
ThemeData theme = Theme.of(context);
return new ListView(
key: new PageStorageKey<Category>(this.category),
padding: EdgeInsets.symmetric(
vertical: 16.0f,
horizontal: 64.0f
),
children: this.category.assets.Select<string, Widget>((string asset) => {
return new Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: new List<Widget> {
new Card(
child: new Container(
width: 144.0f,
alignment: Alignment.center,
child: new Column(
children: new List<Widget> {
Image.asset(
asset,
fit: BoxFit.contain
),
new Container(
padding: EdgeInsets.only(bottom: 16.0f),
alignment: Alignment.center,
child: new Text(
asset,
style: theme.textTheme.caption
)
),
}
)
)
),
new SizedBox(height: 24.0f)
}
);
}).ToList()
);
}
}
public class BackdropPanel : StatelessWidget {
public BackdropPanel(
Key key = null,
VoidCallback onTap = null,
GestureDragUpdateCallback onVerticalDragUpdate = null,
GestureDragEndCallback onVerticalDragEnd = null,
Widget title = null,
Widget child = null
) : base(key: key) {
this.onTap = onTap;
this.onVerticalDragUpdate = onVerticalDragUpdate;
this.onVerticalDragEnd = onVerticalDragEnd;
this.title = title;
this.child = child;
}
public readonly VoidCallback onTap;
public readonly GestureDragUpdateCallback onVerticalDragUpdate;
public readonly GestureDragEndCallback onVerticalDragEnd;
public readonly Widget title;
public readonly Widget child;
public override Widget build(BuildContext context) {
ThemeData theme = Theme.of(context);
return new Material(
elevation: 2.0f,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(16.0f),
topRight: Radius.circular(16.0f)
),
child: new Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: new List<Widget> {
new GestureDetector(
behavior: HitTestBehavior.opaque,
onVerticalDragUpdate: this.onVerticalDragUpdate,
onVerticalDragEnd: this.onVerticalDragEnd,
onTap: this.onTap != null ? (GestureTapCallback) (() => { this.onTap(); }) : null,
child: new Container(
height: 48.0f,
padding: EdgeInsets.only(left: 16.0f),
alignment: Alignment.centerLeft,
child: new DefaultTextStyle(
style: theme.textTheme.subhead,
child: new Tooltip(
message: "Tap to dismiss",
child: this.title
)
)
)
),
new Divider(height: 1.0f),
new Expanded(child: this.child)
}
)
);
}
}
public class BackdropTitle : AnimatedWidget {
public BackdropTitle(
Key key = null,
Listenable listenable = null
) : base(key: key, listenable: listenable) {
}
protected override Widget build(BuildContext context) {
Animation<float> animation = (Animation<float>) this.listenable;
return new DefaultTextStyle(
style: Theme.of(context).primaryTextTheme.title,
softWrap: false,
overflow: TextOverflow.ellipsis,
child: new Stack(
children: new List<Widget> {
new Opacity(
opacity: new CurvedAnimation(
parent: new ReverseAnimation(animation),
curve: new Interval(0.5f, 1.0f)
).value,
child: new Text("Select a Category")
),
new Opacity(
opacity: new CurvedAnimation(
parent: animation,
curve: new Interval(0.5f, 1.0f)
).value,
child: new Text("Asset Viewer")
),
}
)
);
}
}
public class BackdropDemo : StatefulWidget {
public const string routeName = "/material/backdrop";
public override State createState() {
return new _BackdropDemoState();
}
}
class _BackdropDemoState : SingleTickerProviderStateMixin<BackdropDemo> {
GlobalKey _backdropKey = GlobalKey.key(debugLabel: "Backdrop");
AnimationController _controller;
Category _category = BackdropDemoConstants.allCategories[0];
public override void initState() {
base.initState();
this._controller = new AnimationController(
duration: new TimeSpan(0, 0, 0, 0, 300),
value: 1.0f,
vsync: this
);
}
public override void dispose() {
this._controller.dispose();
base.dispose();
}
void _changeCategory(Category category) {
this.setState(() => {
this._category = category;
this._controller.fling(velocity: 2.0f);
});
}
bool _backdropPanelVisible {
get {
AnimationStatus status = this._controller.status;
return status == AnimationStatus.completed || status == AnimationStatus.forward;
}
}
void _toggleBackdropPanelVisibility() {
this._controller.fling(velocity: this._backdropPanelVisible ? -2.0f : 2.0f);
}
float? _backdropHeight {
get {
RenderBox renderBox = (RenderBox) this._backdropKey.currentContext.findRenderObject();
return renderBox.size.height;
}
}
void _handleDragUpdate(DragUpdateDetails details) {
if (this._controller.isAnimating || this._controller.status == AnimationStatus.completed) {
return;
}
this._controller.setValue(this._controller.value -
details.primaryDelta / (this._backdropHeight ?? details.primaryDelta) ?? 0.0f);
}
void _handleDragEnd(DragEndDetails details) {
if (this._controller.isAnimating || this._controller.status == AnimationStatus.completed) {
return;
}
float? flingVelocity = details.velocity.pixelsPerSecond.dy / this._backdropHeight;
if (flingVelocity < 0.0f) {
this._controller.fling(velocity: Mathf.Max(2.0f, -flingVelocity ?? 0.0f));
}
else if (flingVelocity > 0.0f) {
this._controller.fling(velocity: Mathf.Min(-2.0f, -flingVelocity ?? 0.0f));
}
else {
this._controller.fling(velocity: this._controller.value < 0.5f ? -2.0f : 2.0f);
}
}
Widget _buildStack(BuildContext context, BoxConstraints constraints) {
const float panelTitleHeight = 48.0f;
Size panelSize = constraints.biggest;
float panelTop = panelSize.height - panelTitleHeight;
Animation<RelativeRect> panelAnimation = this._controller.drive(
new RelativeRectTween(
begin: RelativeRect.fromLTRB(
0.0f,
panelTop - MediaQuery.of(context).padding.bottom,
0.0f,
panelTop - panelSize.height
),
end: RelativeRect.fromLTRB(0.0f, 0.0f, 0.0f, 0.0f)
)
);
ThemeData theme = Theme.of(context);
List<Widget> backdropItems = BackdropDemoConstants.allCategories.Select<Category, Widget>(
(Category category) => {
bool selected = category == this._category;
return new Material(
shape: new RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(4.0f))
),
color: selected
? Colors.white.withOpacity(0.25f)
: Colors.transparent,
child: new ListTile(
title: new Text(category.title),
selected: selected,
onTap: () => { this._changeCategory(category); }
)
);
}).ToList();
return new Container(
key: this._backdropKey,
color: theme.primaryColor,
child: new Stack(
children: new List<Widget> {
new ListTileTheme(
iconColor: theme.primaryIconTheme.color,
textColor: theme.primaryTextTheme.title.color.withOpacity(0.6f),
selectedColor: theme.primaryTextTheme.title.color,
child: new Padding(
padding: EdgeInsets.symmetric(horizontal: 16.0f),
child: new Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: backdropItems
)
)
),
new PositionedTransition(
rect: panelAnimation,
child: new BackdropPanel(
onTap: this._toggleBackdropPanelVisibility,
onVerticalDragUpdate: this._handleDragUpdate,
onVerticalDragEnd: this._handleDragEnd,
title: new Text(this._category.title),
child: new CategoryView(category: this._category)
)
),
}
)
);
}
public override Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
elevation: 0.0f,
title: new BackdropTitle(
listenable: this._controller.view
),
actions: new List<Widget> {
new IconButton(
onPressed: this._toggleBackdropPanelVisibility,
icon: new AnimatedIcon(
icon: AnimatedIcons.close_menu,
progress: this._controller.view
)
)
}
),
body: new LayoutBuilder(
builder: this._buildStack
)
);
}
}
}

3
Samples/UIWidgetsGallery/demo/material/backdrop_demo.cs.meta


fileFormatVersion: 2
guid: 98bee0a7e51f4f2d9c8670daf147a15f
timeCreated: 1553145970

523
Samples/UIWidgetsGallery/demo/material/bottom_app_bar_demo.cs


using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;
using Canvas = Unity.UIWidgets.ui.Canvas;
using Color = Unity.UIWidgets.ui.Color;
using Material = Unity.UIWidgets.material.Material;
using Rect = Unity.UIWidgets.ui.Rect;
namespace UIWidgetsGallery.gallery {
public class BottomAppBarDemo : StatefulWidget {
public const string routeName = "/material/bottom_app_bar";
public override State createState() {
return new _BottomAppBarDemoState();
}
}
class _BottomAppBarDemoState : State<BottomAppBarDemo> {
static readonly GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>.key();
static readonly _ChoiceValue<Widget> kNoFab = new _ChoiceValue<Widget>(
title: "None",
label: "do not show a floating action button",
value: null
);
static readonly _ChoiceValue<Widget> kCircularFab = new _ChoiceValue<Widget>(
title: "Circular",
label: "circular floating action button",
value: new FloatingActionButton(
onPressed: _showSnackbar,
child: new Icon(Icons.add),
backgroundColor: Colors.orange
)
);
static readonly _ChoiceValue<Widget> kDiamondFab = new _ChoiceValue<Widget>(
title: "Diamond",
label: "diamond shape floating action button",
value: new _DiamondFab(
onPressed: _showSnackbar,
child: new Icon(Icons.add)
)
);
static readonly _ChoiceValue<bool> kShowNotchTrue = new _ChoiceValue<bool>(
title: "On",
label: "show bottom appbar notch",
value: true
);
static readonly _ChoiceValue<bool> kShowNotchFalse = new _ChoiceValue<bool>(
title: "Off",
label: "do not show bottom appbar notch",
value: false
);
static readonly _ChoiceValue<FloatingActionButtonLocation> kFabEndDocked =
new _ChoiceValue<FloatingActionButtonLocation>(
title: "Attached - End",
label: "floating action button is docked at the end of the bottom app bar",
value: FloatingActionButtonLocation.endDocked
);
static readonly _ChoiceValue<FloatingActionButtonLocation> kFabCenterDocked =
new _ChoiceValue<FloatingActionButtonLocation>(
title: "Attached - Center",
label: "floating action button is docked at the center of the bottom app bar",
value: FloatingActionButtonLocation.centerDocked
);
static readonly _ChoiceValue<FloatingActionButtonLocation> kFabEndFloat =
new _ChoiceValue<FloatingActionButtonLocation>(
title: "Free - End",
label: "floating action button floats above the end of the bottom app bar",
value: FloatingActionButtonLocation.endFloat
);
static readonly _ChoiceValue<FloatingActionButtonLocation> kFabCenterFloat =
new _ChoiceValue<FloatingActionButtonLocation>(
title: "Free - Center",
label: "floating action button is floats above the center of the bottom app bar",
value: FloatingActionButtonLocation.centerFloat
);
static void _showSnackbar() {
const string text =
"When the Scaffold's floating action button location changes, " +
"the floating action button animates to its new position." +
"The BottomAppBar adapts its shape appropriately.";
_scaffoldKey.currentState.showSnackBar(
new SnackBar(content: new Text(text))
);
}
static readonly List<_NamedColor> kBabColors = new List<_NamedColor> {
new _NamedColor(null, "Clear"),
new _NamedColor(new Color(0xFFFFC100), "Orange"),
new _NamedColor(new Color(0xFF91FAFF), "Light Blue"),
new _NamedColor(new Color(0xFF00D1FF), "Cyan"),
new _NamedColor(new Color(0xFF00BCFF), "Cerulean"),
new _NamedColor(new Color(0xFF009BEE), "Blue")
};
_ChoiceValue<Widget> _fabShape = kCircularFab;
_ChoiceValue<bool> _showNotch = kShowNotchTrue;
_ChoiceValue<FloatingActionButtonLocation> _fabLocation = kFabEndDocked;
Color _babColor = kBabColors.First().color;
void _onShowNotchChanged(_ChoiceValue<bool> value) {
this.setState(() => { this._showNotch = value; });
}
void _onFabShapeChanged(_ChoiceValue<Widget> value) {
this.setState(() => { this._fabShape = value; });
}
void _onFabLocationChanged(_ChoiceValue<FloatingActionButtonLocation> value) {
this.setState(() => { this._fabLocation = value; });
}
void _onBabColorChanged(Color value) {
this.setState(() => { this._babColor = value; });
}
public override Widget build(BuildContext context) {
return new Scaffold(
key: _scaffoldKey,
appBar: new AppBar(
title: new Text("Bottom app bar"),
elevation: 0.0f,
actions: new List<Widget> {
new MaterialDemoDocumentationButton(BottomAppBarDemo.routeName),
new IconButton(
icon: new Icon(Icons.sentiment_very_satisfied),
onPressed: () => {
this.setState(() => {
this._fabShape = this._fabShape == kCircularFab ? kDiamondFab : kCircularFab;
});
}
)
}
),
body: new ListView(
padding: EdgeInsets.only(bottom: 88.0f),
children: new List<Widget> {
new _AppBarDemoHeading("FAB Shape"),
new _RadioItem<Widget>(kCircularFab, this._fabShape, this._onFabShapeChanged),
new _RadioItem<Widget>(kDiamondFab, this._fabShape, this._onFabShapeChanged),
new _RadioItem<Widget>(kNoFab, this._fabShape, this._onFabShapeChanged),
new Divider(),
new _AppBarDemoHeading("Notch"),
new _RadioItem<bool>(kShowNotchTrue, this._showNotch, this._onShowNotchChanged),
new _RadioItem<bool>(kShowNotchFalse, this._showNotch, this._onShowNotchChanged),
new Divider(),
new _AppBarDemoHeading("FAB Position"),
new _RadioItem<FloatingActionButtonLocation>(kFabEndDocked, this._fabLocation,
this._onFabLocationChanged),
new _RadioItem<FloatingActionButtonLocation>(kFabCenterDocked, this._fabLocation,
this._onFabLocationChanged),
new _RadioItem<FloatingActionButtonLocation>(kFabEndFloat, this._fabLocation,
this._onFabLocationChanged),
new _RadioItem<FloatingActionButtonLocation>(kFabCenterFloat, this._fabLocation,
this._onFabLocationChanged),
new Divider(),
new _AppBarDemoHeading("App bar color"),
new _ColorsItem(kBabColors, this._babColor, this._onBabColorChanged)
}
),
floatingActionButton:
this._fabShape.value,
floatingActionButtonLocation:
this._fabLocation.value,
bottomNavigationBar: new _DemoBottomAppBar(
color: this._babColor,
fabLocation: this._fabLocation.value,
shape: this._selectNotch()
)
);
}
NotchedShape _selectNotch() {
if (!this._showNotch.value) {
return null;
}
if (this._fabShape == kCircularFab) {
return new CircularNotchedRectangle();
}
if (this._fabShape == kDiamondFab) {
return new _DiamondNotchedRectangle();
}
return null;
}
}
class _ChoiceValue<T> {
public _ChoiceValue(T value, string title, string label) {
this.value = value;
this.title = title;
this.label = label;
}
public readonly T value;
public readonly string title;
string label; // For the Semantics widget that contains title
public override string ToString() {
return $"{this.GetType()}('{this.title}')";
}
}
class _RadioItem<T> : StatelessWidget {
public _RadioItem(_ChoiceValue<T> value, _ChoiceValue<T> groupValue, ValueChanged<_ChoiceValue<T>> onChanged) {
this.value = value;
this.groupValue = groupValue;
this.onChanged = onChanged;
}
_ChoiceValue<T> value;
_ChoiceValue<T> groupValue;
ValueChanged<_ChoiceValue<T>> onChanged;
public override Widget build(BuildContext context) {
ThemeData theme = Theme.of(context);
return new Container(
height: 56.0f,
padding: EdgeInsets.only(left: 16.0f),
alignment: Alignment.centerLeft,
child: new Row(
children: new List<Widget> {
new Radio<_ChoiceValue<T>>(
value: this.value,
groupValue: this.groupValue,
onChanged: this.onChanged
),
new Expanded(
child: new GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => { this.onChanged(this.value); },
child: new Text(this.value.title,
style: theme.textTheme.subhead
)
)
)
}
)
);
}
}
class _NamedColor {
public _NamedColor(Color color, string name) {
this.color = color;
this.name = name;
}
public readonly Color color;
public readonly string name;
}
class _ColorsItem : StatelessWidget {
public _ColorsItem(List<_NamedColor> colors, Color selectedColor, ValueChanged<Color> onChanged) {
this.colors = colors;
this.selectedColor = selectedColor;
this.onChanged = onChanged;
}
List<_NamedColor> colors;
public readonly Color selectedColor;
ValueChanged<Color> onChanged;
public override Widget build(BuildContext context) {
return new Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: this.colors.Select<_NamedColor, Widget>((_NamedColor namedColor) => {
return new RawMaterialButton(
onPressed: () => { this.onChanged(namedColor.color); },
constraints: BoxConstraints.tightFor(
width: 32.0f,
height: 32.0f
),
fillColor: namedColor.color,
shape: new CircleBorder(
side: new BorderSide(
color: namedColor.color == this.selectedColor ? Colors.black : new Color(0xFFD5D7DA),
width: 2.0f
)
)
);
}).ToList()
);
}
}
class _AppBarDemoHeading : StatelessWidget {
public _AppBarDemoHeading(string text) {
this.text = text;
}
public readonly string text;
public override Widget build(BuildContext context) {
ThemeData theme = Theme.of(context);
return new Container(
height: 48.0f,
padding: EdgeInsets.only(left: 56.0f),
alignment: Alignment.centerLeft,
child: new Text(this.text,
style: theme.textTheme.body1.copyWith(
color: theme.primaryColor
)
)
);
}
}
class _DemoBottomAppBar : StatelessWidget {
public _DemoBottomAppBar(
Color color = null,
FloatingActionButtonLocation fabLocation = null,
NotchedShape shape = null
) {
this.color = color;
this.fabLocation = fabLocation;
this.shape = shape;
}
public readonly Color color;
public readonly FloatingActionButtonLocation fabLocation;
public readonly NotchedShape shape;
static readonly List<FloatingActionButtonLocation> kCenterLocations = new List<FloatingActionButtonLocation> {
FloatingActionButtonLocation.centerDocked,
FloatingActionButtonLocation.centerFloat
};
public override Widget build(BuildContext context) {
List<Widget> rowContents = new List<Widget> {
new IconButton(
icon: new Icon(Icons.menu),
onPressed: () => {
BottomSheetUtils.showModalBottomSheet<object>(
context: context,
builder: (BuildContext _context) => new _DemoDrawer()
);
}
)
};
if (kCenterLocations.Contains(this.fabLocation)) {
rowContents.Add(
new Expanded(child: new SizedBox())
);
}
rowContents.AddRange(new List<Widget> {
new IconButton(
icon: new Icon(Icons.search),
onPressed: () => {
Scaffold.of(context).showSnackBar(
new SnackBar(content: new Text("This is a dummy search action."))
);
}
),
new IconButton(
icon: new Icon(
Theme.of(context).platform == RuntimePlatform.Android
? Icons.more_vert
: Icons.more_horiz
),
onPressed: () => {
Scaffold.of(context).showSnackBar(
new SnackBar(content: new Text("This is a dummy menu action."))
);
}
)
});
return new BottomAppBar(
color: this.color,
child: new Row(children: rowContents),
shape: this.shape
);
}
}
class _DemoDrawer : StatelessWidget {
public _DemoDrawer() {
}
public override Widget build(BuildContext context) {
return new Drawer(
child: new Column(
children: new List<Widget> {
new ListTile(
leading: new Icon(Icons.search),
title: new Text("Search")
),
new ListTile(
leading: new Icon(Icons.threed_rotation),
title: new Text("3D")
)
}
)
);
}
}
class _DiamondFab : StatelessWidget {
public _DiamondFab(
Widget child,
VoidCallback onPressed
) {
this.child = child;
this.onPressed = onPressed;
}
public readonly Widget child;
public readonly VoidCallback onPressed;
public override Widget build(BuildContext context) {
return new Material(
shape: new _DiamondBorder(),
color: Colors.orange,
child: new InkWell(
onTap: this.onPressed == null ? (GestureTapCallback) null : () => { this.onPressed(); },
child: new Container(
width: 56.0f,
height: 56.0f,
child: IconTheme.merge(
data: new IconThemeData(color: Theme.of(context).accentIconTheme.color),
child: this.child
)
)
),
elevation: 6.0f
);
}
}
class _DiamondNotchedRectangle : NotchedShape {
public _DiamondNotchedRectangle() {
}
public override Path getOuterPath(Rect host, Rect guest) {
if (!host.overlaps(guest)) {
Path path = new Path();
path.addRect(host);
return path;
}
D.assert(guest.width > 0.0f);
Rect intersection = guest.intersect(host);
float notchToCenter =
intersection.height * (guest.height / 2.0f)
/ (guest.width / 2.0f);
Path ret = new Path();
ret.moveTo(host.left, host.top);
ret.lineTo(guest.center.dx - notchToCenter, host.top);
ret.lineTo(guest.left + guest.width / 2.0f, guest.bottom);
ret.lineTo(guest.center.dx + notchToCenter, host.top);
ret.lineTo(host.right, host.top);
ret.lineTo(host.right, host.bottom);
ret.lineTo(host.left, host.bottom);
ret.close();
return ret;
}
}
class _DiamondBorder : ShapeBorder {
public _DiamondBorder() {
}
public override EdgeInsets dimensions {
get { return EdgeInsets.only(); }
}
public override Path getInnerPath(Rect rect) {
return this.getOuterPath(rect);
}
public override Path getOuterPath(Rect rect) {
Path path = new Path();
path.moveTo(rect.left + rect.width / 2.0f, rect.top);
path.lineTo(rect.right, rect.top + rect.height / 2.0f);
path.lineTo(rect.left + rect.width / 2.0f, rect.bottom);
path.lineTo(rect.left, rect.top + rect.height / 2.0f);
path.close();
return path;
}
public override void paint(Canvas canvas, Rect rect) {
}
public override ShapeBorder scale(float t) {
return null;
}
}
}

3
Samples/UIWidgetsGallery/demo/material/bottom_app_bar_demo.cs.meta


fileFormatVersion: 2
guid: 7c1d20efeafe42699212e2147c0828af
timeCreated: 1553149093

217
Samples/UIWidgetsGallery/demo/material/cards_demo.cs


using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using Image = Unity.UIWidgets.widgets.Image;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
namespace UIWidgetsGallery.gallery {
class CardsDemoConstants {
public static readonly List<TravelDestination> destinations = new List<TravelDestination> {
new TravelDestination(
assetName: "india_thanjavur_market",
title: "Top 10 Cities to Visit in Tamil Nadu",
description: new List<string> {
"Number 10",
"Thanjavur",
"Thanjavur, Tamil Nadu"
}
),
new TravelDestination(
assetName: "india_chettinad_silk_maker",
title: "Artisans of Southern India",
description: new List<string> {
"Silk Spinners",
"Chettinad",
"Sivaganga, Tamil Nadu"
}
)
};
}
public class TravelDestination {
public TravelDestination(
string assetName = null,
string title = null,
List<string> description = null
) {
this.assetName = assetName;
this.title = title;
this.description = description;
}
public readonly string assetName;
public readonly string title;
public readonly List<string> description;
public bool isValid {
get { return this.assetName != null && this.title != null && this.description?.Count == 3; }
}
}
public class TravelDestinationItem : StatelessWidget {
public TravelDestinationItem(Key key = null, TravelDestination destination = null, ShapeBorder shape = null)
: base(key: key) {
D.assert(destination != null && destination.isValid);
this.destination = destination;
this.shape = shape;
}
public const float height = 366.0f;
public readonly TravelDestination destination;
public readonly ShapeBorder shape;
public override Widget build(BuildContext context) {
ThemeData theme = Theme.of(context);
TextStyle titleStyle = theme.textTheme.headline.copyWith(color: Colors.white);
TextStyle descriptionStyle = theme.textTheme.subhead;
return new SafeArea(
top: false,
bottom: false,
child: new Container(
padding: EdgeInsets.all(8.0f),
height: height,
child: new Card(
shape: this.shape,
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: new List<Widget> {
new SizedBox(
height: 184.0f,
child: new Stack(
children: new List<Widget> {
Positioned.fill(
child: Image.asset(this.destination.assetName,
fit: BoxFit.cover
)
),
new Positioned(
bottom: 16.0f,
left: 16.0f,
right: 16.0f,
child: new FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: new Text(this.destination.title,
style: titleStyle
)
)
)
}
)
),
new Expanded(
child: new Padding(
padding: EdgeInsets.fromLTRB(16.0f, 16.0f, 16.0f, 0.0f),
child: new DefaultTextStyle(
softWrap: false,
overflow: TextOverflow.ellipsis,
style: descriptionStyle,
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: new List<Widget> {
new Padding(
padding: EdgeInsets.only(bottom: 8.0f),
child: new Text(this.destination.description[0],
style: descriptionStyle.copyWith(color: Colors.black54)
)
),
new Text(this.destination.description[1]),
new Text(this.destination.description[2])
}
)
)
)
),
ButtonTheme.bar(
child: new ButtonBar(
alignment: MainAxisAlignment.start,
children: new List<Widget> {
new FlatButton(
child: new Text("SHARE"),
textColor: Colors.amber.shade500,
onPressed: () => {
/* do nothing */
}
),
new FlatButton(
child: new Text("EXPLORE"),
textColor: Colors.amber.shade500,
onPressed: () => {
/* do nothing */
}
)
}
)
),
}
)
)
)
);
}
}
public class CardsDemo : StatefulWidget {
public const string routeName = "/material/cards";
public override State createState() {
return new _CardsDemoState();
}
}
class _CardsDemoState : State<CardsDemo> {
ShapeBorder _shape;
public override Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text("Travel stream"),
actions: new List<Widget> {
new MaterialDemoDocumentationButton(CardsDemo.routeName),
new IconButton(
icon: new Icon(
Icons.sentiment_very_satisfied
),
onPressed: () => {
this.setState(() => {
this._shape = this._shape != null
? null
: new RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(16.0f),
topRight: Radius.circular(16.0f),
bottomLeft: Radius.circular(2.0f),
bottomRight: Radius.circular(2.0f)
)
);
});
}
)
}
),
body: new ListView(
itemExtent: TravelDestinationItem.height,
padding: EdgeInsets.only(top: 8.0f, left: 8.0f, right: 8.0f),
children: CardsDemoConstants.destinations.Select<TravelDestination, Widget>(
(TravelDestination destination) => {
return new Container(
margin: EdgeInsets.only(bottom: 8.0f),
child: new TravelDestinationItem(
destination: destination,
shape: this._shape
)
);
}).ToList()
)
);
}
}
}

3
Samples/UIWidgetsGallery/demo/material/cards_demo.cs.meta


fileFormatVersion: 2
guid: f199ea32d87544c892f57b8af0fcbb03
timeCreated: 1553136548

1001
Tests/Resources/india_chettinad_silk_maker.png
文件差异内容过多而无法显示
查看文件

88
Tests/Resources/india_chettinad_silk_maker.png.meta


fileFormatVersion: 2
guid: 759295bbc368246a0877963ba053ed5d
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/Resources/india_thanjavur_market.png
文件差异内容过多而无法显示
查看文件

88
Tests/Resources/india_thanjavur_market.png.meta


fileFormatVersion: 2
guid: 69711c649948f4cb1ad20b82f1926a29
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

8
Tests/Resources/products.meta


fileFormatVersion: 2
guid: 2edd4d858895b44ff89047544e685c54
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/Resources/products/backpack.png
文件差异内容过多而无法显示
查看文件

88
Tests/Resources/products/backpack.png.meta


fileFormatVersion: 2
guid: 674a904c9f4234b9ba9f78eb37f237fe
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/Resources/products/belt.png
文件差异内容过多而无法显示
查看文件

88
Tests/Resources/products/belt.png.meta


fileFormatVersion: 2
guid: 8a6d8f5795ade4d2abc66cd64533f8ac
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

406
Tests/Resources/products/cup.png

之前 之后
宽度: 672  |  高度: 672  |  大小: 106 KiB

88
Tests/Resources/products/cup.png.meta


fileFormatVersion: 2
guid: 7443ec2c33a954d6ea65634db88ec9de
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/Resources/products/deskset.png
文件差异内容过多而无法显示
查看文件

88
Tests/Resources/products/deskset.png.meta


fileFormatVersion: 2
guid: 9181044e6c0c4467b933708e3834f35e
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

702
Tests/Resources/products/dress.png

之前 之后
宽度: 660  |  高度: 660  |  大小: 215 KiB

88
Tests/Resources/products/dress.png.meta


fileFormatVersion: 2
guid: 452e42b2f60134df48d45ab49a21d8ec
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/Resources/products/earrings.png
文件差异内容过多而无法显示
查看文件

88
Tests/Resources/products/earrings.png.meta


fileFormatVersion: 2
guid: 7619ea1564ba546ab91b5f0ab38a9f6b
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

408
Tests/Resources/products/flatwear.png

之前 之后
宽度: 672  |  高度: 672  |  大小: 110 KiB

88
Tests/Resources/products/flatwear.png.meta


fileFormatVersion: 2
guid: 2a94339103e7e40219169f13b5ce7013
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

852
Tests/Resources/products/hat.png

之前 之后
宽度: 741  |  高度: 741  |  大小: 224 KiB

88
Tests/Resources/products/hat.png.meta


fileFormatVersion: 2
guid: 1c9bf8d4be2ec4909968b137cca6a5a5
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

702
Tests/Resources/products/jacket.png

之前 之后
宽度: 658  |  高度: 658  |  大小: 226 KiB

88
Tests/Resources/products/jacket.png.meta


fileFormatVersion: 2
guid: 39dfc9119bacf4b85b0d265fae8a101f
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

676
Tests/Resources/products/jumper.png

之前 之后
宽度: 663  |  高度: 663  |  大小: 194 KiB

88
Tests/Resources/products/jumper.png.meta


fileFormatVersion: 2
guid: 4de6e7bd13cc942acaf79ea01980376e
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/Resources/products/kitchen_quattro.png
文件差异内容过多而无法显示
查看文件

88
Tests/Resources/products/kitchen_quattro.png.meta


fileFormatVersion: 2
guid: d02d7a685bb6643ab841d43ee08037a1
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/Resources/products/napkins.png
文件差异内容过多而无法显示
查看文件

88
Tests/Resources/products/napkins.png.meta


fileFormatVersion: 2
guid: 2cfec1ff4da1c4180a77badc07700991
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

984
Tests/Resources/products/planters.png

之前 之后
宽度: 675  |  高度: 675  |  大小: 266 KiB

88
Tests/Resources/products/planters.png.meta


fileFormatVersion: 2
guid: d6cfe1d64e50b4921b6127378911cf72
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

908
Tests/Resources/products/platter.png

之前 之后
宽度: 896  |  高度: 672  |  大小: 245 KiB

88
Tests/Resources/products/platter.png.meta


fileFormatVersion: 2
guid: 5670aeff677b64088bebe4eca1226f4d
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

1001
Tests/Resources/products/scarf.png
文件差异内容过多而无法显示
查看文件

88
Tests/Resources/products/scarf.png.meta


fileFormatVersion: 2
guid: cbceefcfd006d450c82769c232fc553e
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

808
Tests/Resources/products/shirt.png

之前 之后
宽度: 662  |  高度: 662  |  大小: 253 KiB

88
Tests/Resources/products/shirt.png.meta


fileFormatVersion: 2
guid: 62306f72bb1ce45babf84b36b72a517c
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

360
Tests/Resources/products/sunnies.png

之前 之后
宽度: 672  |  高度: 672  |  大小: 102 KiB

88
Tests/Resources/products/sunnies.png.meta


fileFormatVersion: 2
guid: 86fa61eb0c5b14c9380cc7996cc0eb05
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

807
Tests/Resources/products/sweater.png

之前 之后
宽度: 658  |  高度: 658  |  大小: 228 KiB

88
Tests/Resources/products/sweater.png.meta


fileFormatVersion: 2
guid: 62ba7ebbec25c471daaf40bb55f357ad
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

967
Tests/Resources/products/sweats.png

之前 之后
宽度: 660  |  高度: 660  |  大小: 273 KiB

88
Tests/Resources/products/sweats.png.meta


fileFormatVersion: 2
guid: 2c1f449cb818546b6aac2487bf16ea91
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

285
Tests/Resources/products/table.png

之前 之后
宽度: 672  |  高度: 672  |  大小: 89 KiB

88
Tests/Resources/products/table.png.meta


fileFormatVersion: 2
guid: 63d5bc443792b4135ada2687a51c6524
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

711
Tests/Resources/products/teaset.png

之前 之后
宽度: 640  |  高度: 640  |  大小: 196 KiB

88
Tests/Resources/products/teaset.png.meta


fileFormatVersion: 2
guid: 1ea4cd0db6dd649858a8d4ae1d8e1b0c
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

856
Tests/Resources/products/top.png

之前 之后
宽度: 663  |  高度: 663  |  大小: 296 KiB

88
Tests/Resources/products/top.png.meta


fileFormatVersion: 2
guid: 28c554c1d07094c75bf3336f43b55c85
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存