浏览代码

bug fixes (material 4)

/siyaoH-1.17-PlatformMessage
xingweizhu 4 年前
当前提交
60691d72
共有 5 个文件被更改,包括 133 次插入14 次删除
  1. 12
      com.unity.uiwidgets/Runtime/animation/listener_helpers.mixin.gen.cs
  2. 4
      com.unity.uiwidgets/Runtime/animation/listener_helpers.mixin.njk
  3. 13
      com.unity.uiwidgets/Runtime/widgets/editable_text.cs
  4. 107
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/DividerAndButton.cs
  5. 11
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/DividerAndButton.cs.meta

12
com.unity.uiwidgets/Runtime/animation/listener_helpers.mixin.gen.cs


public abstract class AnimationLazyListenerMixinAnimation<T> : Animation<T> {
int _listenerCounter;
int _listenerCounter = 0;
protected void didRegisterListener() {
D.assert(_listenerCounter >= 0);

D.assert(() => {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<AnimationLocalListenersMixinAnimationLazyListenerMixinAnimation<T>>(
"The " + GetType() + " notifying listeners was:",
"The " + GetType() + " notifying listeners was",
this,
style: DiagnosticsTreeStyle.errorProperty
);

D.assert(() => {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<AnimationLocalListenersMixinAnimationEagerListenerMixinAnimation<T>>(
"The " + GetType() + " notifying listeners was:",
"The " + GetType() + " notifying listeners was",
this,
style: DiagnosticsTreeStyle.errorProperty
);

D.assert(() => {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<AnimationLocalStatusListenersMixinAnimationLocalListenersMixinAnimationLazyListenerMixinAnimation<T>>(
"The " + GetType() + " notifying status listeners was:",
"The " + GetType() + " notifying status listeners was",
this,
style: DiagnosticsTreeStyle.errorProperty
);

D.assert(() => {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<AnimationLocalStatusListenersMixinAnimationLazyListenerMixinAnimation<T>>(
"The " + GetType() + " notifying status listeners was:",
"The " + GetType() + " notifying status listeners was",
this,
style: DiagnosticsTreeStyle.errorProperty
);

D.assert(() => {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<AnimationLocalStatusListenersMixinAnimationLocalListenersMixinAnimationEagerListenerMixinAnimation<T>>(
"The " + GetType() + " notifying status listeners was:",
"The " + GetType() + " notifying status listeners was",
this,
style: DiagnosticsTreeStyle.errorProperty
);

4
com.unity.uiwidgets/Runtime/animation/listener_helpers.mixin.njk


D.assert(() => {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<AnimationLocalListenersMixin{{with | safe}}>(
"The " + this.GetType() + " notifying listeners was:",
"The " + this.GetType() + " notifying listeners was",
this,
style: DiagnosticsTreeStyle.errorProperty
);

D.assert(() => {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return new DiagnosticsProperty<AnimationLocalStatusListenersMixin{{with | safe}}>(
"The " + this.GetType() + " notifying status listeners was:",
"The " + this.GetType() + " notifying status listeners was",
this,
style: DiagnosticsTreeStyle.errorProperty
);

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


inputFormatters.Add(formatter);
}
}
showCursor = showCursor ?? !readOnly;
this.showCursor = !readOnly;
this.keyboardType = keyboardType ?? (maxLines == 1 ? TextInputType.text : TextInputType.multiline);
this.locale = locale;
this.scrollPadding = scrollPadding;

this.style = style;
this.smartDashesType = smartDashesType.Value;
this.smartQuotesType = smartQuotesType.Value;
this.showCursor = showCursor;
this.showCursor = showCursor.Value;
this.textWidthBasis = textWidthBasis;
this.onSelectionHandleTapped = onSelectionHandleTapped;
this.scrollController = scrollController;

public readonly TextWidthBasis textWidthBasis;
public readonly VoidCallback onSelectionHandleTapped;
public readonly ScrollController scrollController;
public readonly bool? showCursor;
public readonly bool showCursor;
public readonly ui.BoxHeightStyle selectionHeightStyle;
public readonly ui.BoxWidthStyle selectionWidthStyle;
public readonly bool forceLine;

_cursorBlinkOpacityController.addListener(_onCursorColorTick);
_floatingCursorResetController = new AnimationController(vsync: this);
_floatingCursorResetController.addListener(_onFloatingCursorResetTick);
_cursorVisibilityNotifier.value = widget.showCursor ?? false;
_cursorVisibilityNotifier.value = widget.showCursor;
}
public override void didChangeDependencies() {

void _onCursorColorTick() {
renderEditable.cursorColor =
widget.cursorColor.withOpacity(_cursorBlinkOpacityController.value);
_cursorVisibilityNotifier.value = widget.showCursor.Value && _cursorBlinkOpacityController.value > 0;
_cursorVisibilityNotifier.value = widget.showCursor && _cursorBlinkOpacityController.value > 0;
}
public bool cursorCurrentlyVisible {

cursorColor: _cursorColor,
backgroundCursorColor: widget.backgroundCursorColor,
showCursor: EditableText.debugDeterministicCursor
? new ValueNotifier<bool>(widget.showCursor ?? false)
? new ValueNotifier<bool>(widget.showCursor)
: _cursorVisibilityNotifier,
forceLine: widget.forceLine,
readOnly: widget.readOnly,

107
Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/DividerAndButton.cs


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
using ui_ = Unity.UIWidgets.widgets.ui_;
namespace UIWidgetsSample {
public class DividerAndButton : UIWidgetsPanel {
protected override void main() {
ui_.runApp(new MyApp());
}
class MyApp : StatelessWidget
{
public override Widget build(BuildContext context)
{
return new MaterialApp(
home: new DividerAndButtonSample()
);
}
}
public class DividerAndButtonSample : StatefulWidget {
public DividerAndButtonSample(Key key = null) : base(key) {
}
public override State createState() {
return new _DividerAndButtonState();
}
}
public class _DividerAndButtonState : State<DividerAndButtonSample> {
string title = "Hello";
string subtitle = "World";
TextEditingController controller = new TextEditingController("xxxxxx");
public override Widget build(BuildContext context) {
return new DividerTheme(
data: new DividerThemeData(
),
child: new Container(
height: 200,
padding: EdgeInsets.all(10),
decoration: new BoxDecoration(
color: new Color(0xFFEF1F7F),
border: Border.all(color: Color.fromARGB(255, 0xDF, 0x10, 0x70), width: 5),
borderRadius: BorderRadius.all(20)
),
child: new Center(
child: new Column(
children: new List<Widget>() {
new Text(this.title),
new Divider(),
new Text(this.subtitle),
new Divider(),
new Container(
width: 500,
decoration: new BoxDecoration(border: Border.all(new Color(0xFF00FF00), 1)),
child: new EditableText(
controller: this.controller,
focusNode: new FocusNode(),
style: new TextStyle(
fontSize: 18,
height: 1.5f,
color: new Color(0xFFFF89FD)),
cursorColor: Color.fromARGB(255, 0, 0, 0),
backgroundCursorColor: Colors.grey
)
),
new Divider(),
new ButtonBar(
children: new List<Widget> {
new FlatButton(
onPressed: () => {
this.setState(() => { this.title = this.controller.text; });
},
padding: EdgeInsets.all(5.0f),
child: new Center(
child: new Text("Set Title")
)
),
new RaisedButton(
onPressed: () => {
this.setState(() => { this.subtitle = this.controller.text; });
},
padding: EdgeInsets.all(5.0f),
child: new Center(
child: new Text("Set Subtitle")
)
)
}
)
}
)
)
));
}
}
}
}

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


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