浏览代码

bug fixes (meterial 3)

/siyaoH-1.17-PlatformMessage
xingweizhu 4 年前
当前提交
b49033ee
共有 8 个文件被更改,包括 83 次插入16 次删除
  1. 18
      com.unity.uiwidgets/Runtime/material/button_bar.cs
  2. 9
      com.unity.uiwidgets/Runtime/material/divider.cs
  3. 1
      com.unity.uiwidgets/Runtime/material/material_button.cs
  4. 1
      com.unity.uiwidgets/Runtime/services/text_input.cs
  5. 12
      com.unity.uiwidgets/Runtime/widgets/editable_text.cs
  6. 47
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/BottomAppBarSample.cs
  7. 11
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/BottomAppBarSample.cs.meta

18
com.unity.uiwidgets/Runtime/material/button_bar.cs


ButtonBarThemeData barTheme = ButtonBarTheme.of(context);
ButtonThemeData buttonTheme = parentButtonTheme.copyWith(
textTheme: buttonTextTheme ?? barTheme.buttonTextTheme ?? ButtonTextTheme.primary,
minWidth: buttonMinWidth ?? barTheme.buttonMinWidth ?? 64.0f,
height: buttonHeight ?? barTheme.buttonHeight ?? 36.0f,
padding: buttonPadding ?? barTheme.buttonPadding ?? EdgeInsets.symmetric(horizontal: 8.0f),
alignedDropdown: buttonAlignedDropdown ?? barTheme.buttonAlignedDropdown ?? false,
layoutBehavior: layoutBehavior ?? barTheme.layoutBehavior ?? ButtonBarLayoutBehavior.padded
textTheme: buttonTextTheme ?? barTheme?.buttonTextTheme ?? ButtonTextTheme.primary,
minWidth: buttonMinWidth ?? barTheme?.buttonMinWidth ?? 64.0f,
height: buttonHeight ?? barTheme?.buttonHeight ?? 36.0f,
padding: buttonPadding ?? barTheme?.buttonPadding ?? EdgeInsets.symmetric(horizontal: 8.0f),
alignedDropdown: buttonAlignedDropdown ?? barTheme?.buttonAlignedDropdown ?? false,
layoutBehavior: layoutBehavior ?? barTheme?.layoutBehavior ?? ButtonBarLayoutBehavior.padded
);
float paddingUnit = buttonTheme.padding.horizontal / 4.0f;

mainAxisAlignment: alignment ?? barTheme.alignment ?? MainAxisAlignment.end,
mainAxisSize: mainAxisSize ?? barTheme.mainAxisSize ?? MainAxisSize.max,
overflowDirection: overflowDirection ?? barTheme.overflowDirection ?? VerticalDirection.down,
mainAxisAlignment: alignment ?? barTheme?.alignment ?? MainAxisAlignment.end,
mainAxisSize: mainAxisSize ?? barTheme?.mainAxisSize ?? MainAxisSize.max,
overflowDirection: overflowDirection ?? barTheme?.overflowDirection ?? VerticalDirection.down,
children: children.Select((Widget childWidget) => {
return (Widget) new Padding(
padding: EdgeInsets.symmetric(horizontal: paddingUnit),

9
com.unity.uiwidgets/Runtime/material/divider.cs


float? indent = null,
float? endIndent = null,
Color color = null) : base(key: key) {
D.assert(height >= 0.0);
D.assert(height == null || height >= 0.0);
D.assert(thickness == null || thickness >= 0.0);
D.assert(indent == null || indent >= 0.0);
D.assert(endIndent == null || endIndent >= 0.0);
this.height = height;
this.thickness = thickness;
this.indent = indent;

child: new Container(
height: thickness,
//TODO: update to EdgeInsetsGeometry
margin: (EdgeInsets) (EdgeInsetsGeometry) EdgeInsetsDirectional.only(start: indent,
end: endIndent),
/*margin: EdgeInsetsDirectional.only(start: indent,
end: endIndent),*/
decoration: new BoxDecoration(
border: new Border(
bottom: createBorderSide(context, color: color, width: thickness))

1
com.unity.uiwidgets/Runtime/material/material_button.cs


this.height = height;
this.enableFeedback = enableFeedback;
this.child = child;
this.autofocus = autofocus;
}
public readonly VoidCallback onPressed;

1
com.unity.uiwidgets/Runtime/services/text_input.cs


TextRange composing = null) {
D.assert(text != null);
D.assert(selection != null);
this.text = text;
this.composing = composing ?? TextRange.empty;

12
com.unity.uiwidgets/Runtime/widgets/editable_text.cs


"minLines and maxLines must be null when expands is true."
);
D.assert(!obscureText || maxLines == 1, () => "Obscured fields cannot be multiline.");
scrollPadding = scrollPadding ?? EdgeInsets.all(20.0f);
D.assert(scrollPadding != null);
toolbarOptions = toolbarOptions ?? new ToolbarOptions(
copy: true,

this.showCursor = !readOnly;
this.keyboardType = keyboardType ?? (maxLines == 1 ? TextInputType.text : TextInputType.multiline);
this.locale = locale;
this.scrollPadding = scrollPadding ?? EdgeInsets.all(20.0f);
this.scrollPadding = scrollPadding;
this.controller = controller;
this.focusNode = focusNode;
this.obscureText = obscureText;

if (widget.controller.selection != oldWidget.controller.selection) {
_selectionOverlay?.update(_value);
}
_selectionOverlay.handlesVisible = widget.showSelectionHandles;
if (_selectionOverlay != null) {
_selectionOverlay.handlesVisible = widget.showSelectionHandles;
}
if (widget.focusNode != oldWidget.focusNode) {
oldWidget.focusNode.removeListener(_handleFocusChanged);
_focusAttachment?.detach();

fontFamily: style.fontFamily,
fontSize: style.fontSize,
fontWeight: style.fontWeight,
textDirection: (TextDirection)_textDirection,
textDirection: _textDirection.Value,
textAlign: widget.textAlign
);
}

47
Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/BottomAppBarSample.cs


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;
using ui_ = Unity.UIWidgets.widgets.ui_;
namespace UIWidgetsSample {
public class BottomAppBarSample : UIWidgetsPanel {
protected override void main() {
ui_.runApp(new MaterialApp(
showPerformanceOverlay: false,
home: new BottomAppBarWidget()));
}
protected new void OnEnable() {
base.OnEnable();
}
}
public class BottomAppBarWidget : StatelessWidget {
public BottomAppBarWidget(Key key = null) : base(key) {
}
public override Widget build(BuildContext context) {
return new Scaffold(
backgroundColor: Colors.grey,
bottomNavigationBar: new BottomAppBar(
child: new Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: new List<Widget> {
new IconButton(icon: new Icon(Unity.UIWidgets.material.Icons.menu), onPressed: () => { }),
new IconButton(icon: new Icon(Unity.UIWidgets.material.Icons.account_balance),
onPressed: () => { })
})));
}
}
}

11
Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/BottomAppBarSample.cs.meta


fileFormatVersion: 2
guid: 8ba2c65db2f2848d3a3fa5eb0890abe5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存