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

Filter picture records #384

Merged
merged 43 commits into from
Nov 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
4a6ec18
Implement text shadow.
Nov 18, 2019
8157c99
Cleanup.
Nov 18, 2019
7044769
Merge pull request #378 from UnityTech/text_shadow
zhuxingwei Nov 18, 2019
9ba87f1
Fix text shadow on emoji.
Nov 18, 2019
3114029
Merge pull request #379 from UnityTech/text_shadow
zhuxingwei Nov 18, 2019
dec572c
fix editable ios bug when typing
zhuxingwei Nov 19, 2019
867331b
Merge pull request #380 from UnityTech/fix_editable_ios_bug
Nov 19, 2019
fa678e3
Check canvas clipping bounds and record bounds.
Nov 19, 2019
15d5726
Split SplayTree in separate file.
Nov 19, 2019
91cd837
fix aa shapehint bug when shapeHint doesn't update when rrect -> non-…
zhuxingwei Nov 19, 2019
4806573
fix aa shapehint bug when shapeHint doesn't update when rrect -> non-…
zhuxingwei Nov 19, 2019
f72c10f
Merge pull request #381 from UnityTech/fix_aa_shapehintbug
Nov 20, 2019
f941f66
Add RTree.
Nov 20, 2019
0bf499f
Refactor RTree.
Nov 20, 2019
c97b4e4
Refactor RTree.
Nov 20, 2019
4802de1
Filter records with r tree.
Nov 20, 2019
51415fb
Fix typo.
Nov 20, 2019
23dee55
Optimize layout: request character only at begining.
Nov 20, 2019
295b29c
fix error: won't adjust fill area size when canskipAAhairline is true
zhuxingwei Nov 20, 2019
1dd2b77
Merge pull request #382 from UnityTech/fix_aa_shapehintbug
Nov 20, 2019
054e5d3
Fix some issues.
Nov 20, 2019
47c9b88
Merge branch 'master' of github.com:UnityTech/UIWidgets into filter_r…
Nov 20, 2019
ed629fa
[Fix] InputDecoration prefix & suffix
IIzzaya Nov 21, 2019
734986a
Merge pull request #383 from IIzzaya/dev
zhuxingwei Nov 21, 2019
09dfb52
Update bhh when creating picture.
Nov 21, 2019
e30188f
[Widget] Add Material Search Widget
IIzzaya Nov 21, 2019
ca73aa8
Cleanup.
Nov 21, 2019
0fe7f3a
Fix iOS issue.
Nov 21, 2019
7b003ab
Merge pull request #385 from IIzzaya/dev
zhuxingwei Nov 21, 2019
0ecd24e
Merge pull request #386 from UnityTech/fix_ios_issue
zhuxingwei Nov 21, 2019
cfd937f
fix PLUGIN
zhuxingwei Nov 21, 2019
0ef4aa6
Merge pull request #387 from UnityTech/fix_aa_shapehintbug
zhuxingwei Nov 21, 2019
0cb0081
Fix bug in shifted box.
Nov 22, 2019
6f8085b
Merge pull request #388 from UnityTech/fix_bug
zhuxingwei Nov 22, 2019
ec85d8a
Merge branch 'master' into filter_records
Nov 22, 2019
056ec24
[Widget] Add Cupertino ActivityIndicator Widget
wglios Nov 22, 2019
c1362f7
Merge pull request #389 from wglios/master
zhuxingwei Nov 22, 2019
690b86d
fix raster cache error on low-end android devices
zhuxingwei Nov 22, 2019
10dbdd3
Merge pull request #390 from UnityTech/fix_aa_shapehintbug
zhuxingwei Nov 22, 2019
9104b1c
Merge branch 'master' into filter_records
Nov 25, 2019
18ebe77
Fix bug in Paragraph.setText.
Nov 25, 2019
aff8928
Fix bug.
Nov 25, 2019
9d5d355
Revert all optimization on paragraph layout.
Nov 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Runtime/Plugins/platform/ios/UIWidgetsTextInputPlugin.mm
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@ - (NSUInteger)incrementOffsetPosition:(NSUInteger)position {

- (UITextPosition*)positionFromPosition:(UITextPosition*)position offset:(NSInteger)offset {
NSUInteger offsetPosition = ((UIWidgetsTextPosition*)position).index;
NSInteger newLocation = (NSInteger)offsetPosition + offset;
if (newLocation < 0 || newLocation > (NSInteger)self.text.length) {
return nil;
}
if (offset >= 0) {
for (NSInteger i = 0; i < offset && offsetPosition < self.text.length; ++i)
offsetPosition = [self incrementOffsetPosition:offsetPosition];
Expand Down
130 changes: 130 additions & 0 deletions Runtime/cupertino/activity_indicator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
using System;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;
using Canvas = Unity.UIWidgets.ui.Canvas;
using Color = Unity.UIWidgets.ui.Color;

namespace Unity.UIWidgets.cupertino {
static class CupertinoActivityIndicatorUtils {
public const float _kDefaultIndicatorRadius = 10.0f;
public const float _kTwoPI = Mathf.PI * 2.0f;
public const int _kTickCount = 12;
public const int _kHalfTickCount = _kTickCount / 2;
public static readonly Color _kTickColor = CupertinoColors.lightBackgroundGray;
public static readonly Color _kActiveTickColor = new Color(0xFF9D9D9D);
}

public class CupertinoActivityIndicator : StatefulWidget {
public CupertinoActivityIndicator(
Key key = null,
bool animating = true,
float radius = CupertinoActivityIndicatorUtils._kDefaultIndicatorRadius
) : base(key: key) {
D.assert(radius > 0);
this.animating = animating;
this.radius = radius;
}

public readonly bool animating;
public readonly float radius;

public override State createState() {
return new _CupertinoActivityIndicatorState();
}
}

class _CupertinoActivityIndicatorState : TickerProviderStateMixin<CupertinoActivityIndicator> {
AnimationController _controller;

public override void initState() {
base.initState();
this._controller = new AnimationController(
duration: TimeSpan.FromSeconds(1),
vsync: this
);

if (this.widget.animating) {
this._controller.repeat();
}
}

public override void didUpdateWidget(StatefulWidget oldWidget) {
base.didUpdateWidget(oldWidget: oldWidget);
if (oldWidget is CupertinoActivityIndicator _oldWidget) {
if (this.widget.animating != _oldWidget.animating) {
if (this.widget.animating) {
this._controller.repeat();
}
else {
this._controller.stop();
}
}
}
}

public override void dispose() {
this._controller.dispose();
base.dispose();
}

public override Widget build(BuildContext context) {
return new SizedBox(
height: this.widget.radius * 2,
width: this.widget.radius * 2,
child: new CustomPaint(
painter: new _CupertinoActivityIndicatorPainter(
position: this._controller,
radius: this.widget.radius
)
)
);
}
}

class _CupertinoActivityIndicatorPainter : AbstractCustomPainter {
public _CupertinoActivityIndicatorPainter(
Animation<float> position,
float radius
) : base(repaint: position) {
this.tickFundamentalRRect = RRect.fromLTRBXY(
left: -radius,
top: 1.0f * radius / CupertinoActivityIndicatorUtils._kDefaultIndicatorRadius,
right: -radius / 2.0f,
bottom: -1.0f * radius / CupertinoActivityIndicatorUtils._kDefaultIndicatorRadius,
radiusX: 1.0f,
radiusY: 1.0f
);
this.position = position;
}

readonly Animation<float> position;
readonly RRect tickFundamentalRRect;

public override void paint(Canvas canvas, Size size) {
Paint paint = new Paint();

canvas.save();
canvas.translate(size.width / 2.0f, size.height / 2.0f);

int activeTick = (CupertinoActivityIndicatorUtils._kTickCount * this.position.value).floor();

for (int i = 0; i < CupertinoActivityIndicatorUtils._kTickCount; ++i) {
float t = (((i + activeTick) % CupertinoActivityIndicatorUtils._kTickCount) /
CupertinoActivityIndicatorUtils._kHalfTickCount).clamp(0, 1);
paint.color = Color.lerp(a: CupertinoActivityIndicatorUtils._kActiveTickColor,
b: CupertinoActivityIndicatorUtils._kTickColor, t: t);
canvas.drawRRect(rect: this.tickFundamentalRRect, paint: paint);
canvas.rotate(-CupertinoActivityIndicatorUtils._kTwoPI / CupertinoActivityIndicatorUtils._kTickCount);
}

canvas.restore();
}

public override bool shouldRepaint(CustomPainter oldPainter) {
return (oldPainter as _CupertinoActivityIndicatorPainter).position != this.position;
}
}
}
11 changes: 11 additions & 0 deletions Runtime/cupertino/activity_indicator.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Runtime/cupertino/button.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using RSG;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
Expand Down
2 changes: 2 additions & 0 deletions Runtime/cupertino/slider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ public _RenderCupertinoSlider(
this._divisions = divisions;
this._activeColor = activeColor;
this._onChanged = onChanged;
this.onChangeStart = onChangeStart;
this.onChangeEnd = onChangeEnd;
this._drag = new HorizontalDragGestureRecognizer();
this._drag.onStart = this._handleDragStart;
this._drag.onUpdate = this._handleDragUpdate;
Expand Down
7 changes: 6 additions & 1 deletion Runtime/editor/window_config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ namespace Unity.UIWidgets.editor {
public class WindowConfig {
public readonly bool disableRasterCache;

public static float MaxRasterImageSize = 4096;
#if UNITY_ANDROID
//make API compatible to low-end Android devices
public static float MaxRasterImageSize = 2048;
#else
public static float MaxRasterImageSize = 4096;
#endif

static bool? _disableComputeBuffer = null;

Expand Down
Loading