Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit 27209a3

Browse files
committed
Merge branch 'master' of github.com:UnityTech/UIWidgets into dev
2 parents 56115f9 + 23ac4aa commit 27209a3

File tree

9 files changed

+83
-27
lines changed

9 files changed

+83
-27
lines changed

README-ZH.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ https://github.com/UnityTech/DocCN 查看。
4949
## 使用要求
5050

5151
#### Unity
52-
安装 Unity 2018.3 或更高版本。 你可以从[https://unity3d.com/get-unity/download](https://unity3d.com/get-unity/download)下载最新的Unity。
52+
53+
安装 **Unity 2018.4.10f1(LTS)****Unity 2019.1.14f1** 及其更高版本。 你可以从[https://unity3d.com/get-unity/download](https://unity3d.com/get-unity/download)下载最新的Unity。
5354

5455
#### UIWidgets包
5556

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ and iOS (Searching for "Unity Connect" in App Store). This project is open-sourc
5555
The official website of Unity Chinese Documentation (https://connect.unity.com/doc) is powered by UIWidgets and
5656
open-sourced @https://github.com/UnityTech/DocCN.
5757

58-
## Requirement
58+
## Requirements
5959

6060
#### Unity
61-
Install **Unity 2018.3** or above. You can download the latest Unity on https://unity3d.com/get-unity/download.
61+
62+
Install **Unity 2018.4.10f1 (LTS)** or **Unity 2019.1.14f1** and above. You can download the latest Unity on https://unity3d.com/get-unity/download.
6263

6364
#### UIWidgets Package
6465
Visit our Github repository https://github.com/UnityTech/UIWidgets

Runtime/cupertino/route.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public class CupertinoRouteUtils {
4242
);
4343

4444
public static readonly DecorationTween _kGradientShadowTween = new DecorationTween(
45+
begin: _CupertinoEdgeShadowDecoration.none,
4546
end: new _CupertinoEdgeShadowDecoration(
4647
edgeGradient: new LinearGradient(
4748
begin: new Alignment(0.9f, 0.0f),
@@ -107,7 +108,8 @@ WidgetBuilder builder
107108
barrierDismissible: false,
108109
barrierColor: _kModalBarrierColor,
109110
transitionDuration: new TimeSpan(0, 0, 0, 0, 250),
110-
pageBuilder: (BuildContext _context, Animation<float> animation, Animation<float> secondaryAnimation) => {
111+
pageBuilder:
112+
(BuildContext _context, Animation<float> animation, Animation<float> secondaryAnimation) => {
111113
return builder(_context);
112114
},
113115
transitionBuilder: _buildCupertinoDialogTransitions
@@ -127,7 +129,7 @@ public _CupertinoEdgeShadowDecoration(
127129

128130
public readonly LinearGradient edgeGradient;
129131

130-
static _CupertinoEdgeShadowDecoration lerp(
132+
static _CupertinoEdgeShadowDecoration lerpCupertino(
131133
_CupertinoEdgeShadowDecoration a,
132134
_CupertinoEdgeShadowDecoration b,
133135
float t
@@ -143,18 +145,18 @@ float t
143145

144146
public override Decoration lerpFrom(Decoration a, float t) {
145147
if (!(a is _CupertinoEdgeShadowDecoration)) {
146-
return lerp(null, this, t);
148+
return lerpCupertino(null, this, t);
147149
}
148150

149-
return lerp(a, this, t);
151+
return lerpCupertino((_CupertinoEdgeShadowDecoration) a, this, t);
150152
}
151153

152154
public override Decoration lerpTo(Decoration b, float t) {
153155
if (!(b is _CupertinoEdgeShadowDecoration)) {
154-
return lerp(this, null, t);
156+
return lerpCupertino(this, null, t);
155157
}
156158

157-
return lerp(this, b, t);
159+
return lerpCupertino(this, (_CupertinoEdgeShadowDecoration) b, t);
158160
}
159161

160162
public override BoxPainter createBoxPainter(VoidCallback onChanged = null) {

Runtime/material/bottom_navigation_bar.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ public override Widget build(BuildContext context) {
348348
child: text
349349
);
350350
}
351-
else if (this.showUnselectedLabels) {
351+
else if (!this.showUnselectedLabels) {
352352
text = new FadeTransition(
353353
opacity: this.animation,
354354
child: text
@@ -576,6 +576,7 @@ public override Widget build(BuildContext context) {
576576
Color backgroundColor = null;
577577
switch (this.widget.type) {
578578
case BottomNavigationBarType.fix:
579+
backgroundColor = this.widget.backgroundColor;
579580
break;
580581
case BottomNavigationBarType.shifting:
581582
backgroundColor = this._backgroundColor;

Runtime/rendering/sliver_multi_box_adaptor.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ public class SliverMultiBoxAdaptorParentData : ContainerParentDataMixinSliverLog
3636

3737
public bool keepAlive = false;
3838

39-
internal bool _keptAlive = false;
39+
public bool keptAlive {
40+
get { return this._keptAlive; }
41+
}
4042

43+
internal bool _keptAlive = false;
44+
4145
public override string ToString() {
4246
return $"index={this.index}; {(this.keepAlive ? "keeyAlive; " : "")}{base.ToString()}";
4347
}
@@ -80,6 +84,7 @@ bool _debugAssertChildListLocked() {
8084
}
8185

8286
public override void insert(RenderBox child, RenderBox after = null) {
87+
D.assert(!this._keepAliveBucket.ContainsValue(value: child));
8388
base.insert(child, after: after);
8489
D.assert(this.firstChild != null);
8590
D.assert(() => {

Runtime/widgets/automatic_keep_alive.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ bool _addClient(KeepAliveNotification notification) {
6767
}
6868
else {
6969
SchedulerBinding.instance.addPostFrameCallback(timeStamp => {
70+
if (!this.mounted) {
71+
return;
72+
}
7073
ParentDataElement childElement1 = this._getChildElement();
7174
D.assert(childElement1 != null);
7275
this._updateParentDataOfChild(childElement1);
@@ -78,6 +81,7 @@ bool _addClient(KeepAliveNotification notification) {
7881
}
7982

8083
ParentDataElement _getChildElement() {
84+
D.assert(this.mounted);
8185
Element element = (Element) this.context;
8286
Element childElement = null;
8387
element.visitChildren((Element child) => { childElement = child; });

Runtime/widgets/routes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ public void removeScopedWillPopCallback(WillPopCallback callback) {
605605
this._willPopCallbacks.Remove(callback);
606606
}
607607

608-
protected internal bool hasScopedWillPopCallback {
608+
public bool hasScopedWillPopCallback {
609609
get { return this._willPopCallbacks.isNotEmpty(); }
610610
}
611611

Runtime/widgets/sliver.cs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -355,29 +355,27 @@ protected override void performRebuild() {
355355
this._currentBeforeChild = null;
356356
D.assert(this._currentlyUpdatingChildIndex == null);
357357
try {
358-
int firstIndex = 0;
359-
int lastIndex = 0;
360-
361-
if (!this._childElements.isEmpty()) {
362-
firstIndex = this._childElements.First().Key;
363-
lastIndex = this._childElements.Last().Key;
364-
if (this._didUnderflow) {
365-
lastIndex += 1;
366-
}
367-
}
368-
369-
for (int index = firstIndex; index <= lastIndex; ++index) {
358+
void processElement(int index) {
370359
this._currentlyUpdatingChildIndex = index;
371360
Element newChild = this.updateChild(this._childElements.getOrDefault(index), this._build(index),
372361
index);
373362
if (newChild != null) {
374363
this._childElements[index] = newChild;
375-
this._currentBeforeChild = (RenderBox) newChild.renderObject;
364+
var parentData = (SliverMultiBoxAdaptorParentData) newChild.renderObject.parentData;
365+
if (!parentData.keptAlive) {
366+
this._currentBeforeChild = (RenderBox) newChild.renderObject;
367+
}
376368
}
377369
else {
378370
this._childElements.Remove(index);
379371
}
380372
}
373+
// processElement may modify the Map - need to do a .toList() here.
374+
this._childElements.Keys.ToList().ForEach(action: processElement);
375+
if (this._didUnderflow) {
376+
var lastKey = this._childElements?.Last().Key ?? -1;
377+
processElement(lastKey + 1);
378+
}
381379
}
382380
finally {
383381
this._currentlyUpdatingChildIndex = null;

Tests/Resources/Emoji.png.meta

Lines changed: 46 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)