浏览代码

Cleanup warnings.

/main
Yuncong Zhang 5 年前
当前提交
228f741d
共有 10 个文件被更改,包括 33 次插入16 次删除
  1. 17
      Runtime/gestures/multitap.cs
  2. 1
      Runtime/material/floatting_action_button_theme.cs
  3. 4
      Runtime/painting/text_painter.cs
  4. 10
      Runtime/ui/painting/path.cs
  5. 4
      Runtime/ui/painting/shadow_utils.cs
  6. 2
      Runtime/ui/renderer/allocator/debug.cs
  7. 4
      Runtime/ui/renderer/allocator/pool_object.cs
  8. 2
      Runtime/ui/renderer/common/geometry/matrix/ui_matrix.cs
  9. 1
      Runtime/widgets/editable_text.cs
  10. 4
      Samples/UIWidgetsGallery/demo/cupertino/cupertino_navigation_demo.cs

17
Runtime/gestures/multitap.cs


public delegate void GestureMultiTapCancelCallback(int pointer);
public class _CountdownZoned {
_CountdownZoned(TimeSpan duration) {
class _CountdownZoned {
public _CountdownZoned(TimeSpan duration) {
D.assert(duration != null);
this._timer = Window.instance.run(duration, this._onTimeout);
}

) {
this.pointer = evt.pointer;
this._initialPosition = evt.position;
this._doubleTapMinTimeCountdown = new _CountdownZoned(duration: doubleTapMinTime);
this.entry = entry;
}

this.longTapDelay = longTapDelay ?? TimeSpan.Zero;
}
GestureMultiTapDownCallback onTapDown;
public GestureMultiTapDownCallback onTapDown;
GestureMultiTapUpCallback onTapUp;
public GestureMultiTapUpCallback onTapUp;
GestureMultiTapCallback onTap;
public GestureMultiTapCallback onTap;
GestureMultiTapCancelCallback onTapCancel;
public GestureMultiTapCancelCallback onTapCancel;
TimeSpan longTapDelay;
public TimeSpan longTapDelay;
GestureMultiTapDownCallback onLongTapDown;
public GestureMultiTapDownCallback onLongTapDown;
readonly Dictionary<int, _TapGesture> _gestureMap = new Dictionary<int, _TapGesture>();

1
Runtime/material/floatting_action_button_theme.cs


public static FloatingActionButtonThemeData lerp(FloatingActionButtonThemeData a, FloatingActionButtonThemeData b,
float t) {
D.assert(t != null);
if (a == null && b == null) {
return null;
}

4
Runtime/painting/text_painter.cs


this._caretMetrics = new _CaretMetrics(
offset: rect != null ? new Offset(rect.left, rect.top) : this._emptyOffset,
fullHeight: rect != null ? (float?) (rect.bottom - rect.top) : null);
// Cache the caret position. This was forgot in flutter until https://github.com/flutter/flutter/pull/38821
this._previousCaretPosition = position;
this._previousCaretPrototype = caretPrototype;
}
public Paragraph.LineRange getLineRange(int lineNumber) {

10
Runtime/ui/painting/path.cs


return new PathMetricIterator(_pathMeasure);
}
PathMetric _pathMetric;
// PathMetric _pathMetric; // TODO
_PathMeasure _pathMeasure;
public void Reset() {

public PathMetric Current {
get { return this._pathMetric; }
get {
return null; // TODO : return this._pathMetric;
}
get { return this._pathMetric; }
get {
return null; // TODO : return this._pathMetric;
}
}
public bool MoveNext() {

4
Runtime/ui/painting/shadow_utils.cs


static readonly Path _devSpacePath = new Path();
public static void drawShadow(Canvas canvas, Path path, Vector3 zPlaneParams, Vector3 devLightPos,
float lightRadius, uiColor ambientColor, uiColor spotColor, int flags) {
#pragma warning disable CS0162
if (kUseFastShadow) {
drawShadowFast(canvas, path, zPlaneParams, devLightPos, lightRadius, ambientColor, spotColor, flags);
}

#pragma warning restore CS0162
}
//cached variables

Matrix3 viewMatrix = canvas.getTotalMatrix();
//debug shadow
#pragma warning disable CS0162
if (debugShadow) {
var isRRect = path.isNaiveRRect;
if (isRRect) {

spotColor = uiColor.fromColor(Colors.green);
}
}
#pragma warning restore CS0162
//ambient light
float devSpaceOutset = ambientBlurRadius(zPlaneParams.z);

2
Runtime/ui/renderer/allocator/debug.cs


return;
}
#pragma warning disable CS0162
allocCount++;
if (allocCount >= 120) {
allocCount = 0;

Debug.Log(debugInfo);
}
#pragma warning restore CS0162
}
public static void onAlloc(int objKey, string objName, int allocatedCount) {

4
Runtime/ui/renderer/allocator/pool_object.cs


var ret = pool.Pop();
ret.setup();
#pragma warning disable CS0162
#pragma warning restore CS0162
return ret;
}

return;
}
#pragma warning disable CS0162
if (AllocDebugger.enableDebugging) {
if (!obj.activated_flag) {
Debug.Assert(false, "an item has been recycled more than once !");

AllocDebugger.onRelease(debugKey, debugName, allocatedCount);
}
#pragma warning restore CS0162
obj.clear();
if (pool.Count > POOL_MAX_SIZE) {

2
Runtime/ui/renderer/common/geometry/matrix/ui_matrix.cs


TypeMask mask = this._getType();
if (0 == (mask & ~(TypeMask.kScale_Mask | TypeMask.kTranslate_Mask))) {
bool invertible = true;
// bool invertible = true; // Fix warning: value is never used
if (!invertableCheck) {
if ((mask & TypeMask.kScale_Mask) != 0) {

1
Runtime/widgets/editable_text.cs


this.hasFocus = hasFocus;
this.maxLines = maxLines;
this.minLines = minLines;
this.expands = expands;
this.strutStyle = strutStyle;
this.selectionColor = selectionColor;
this.textScaleFactor = textScaleFactor;

4
Samples/UIWidgetsGallery/demo/cupertino/cupertino_navigation_demo.cs


},
defaultTitle: "Colors"
);
break;
break;
break;
}
return null;

public override void initState() {
base.initState();
this.relatedColors = new List<Color>();
for (int i = 0; i < 10; i++) {
this.relatedColors.Add(
Color.fromARGB(

正在加载...
取消
保存