浏览代码

FIX P

/siyaoH-1.17-PlatformMessage
Shiyun Wen 4 年前
当前提交
30913187
共有 8 个文件被更改,包括 141 次插入62 次删除
  1. 2
      com.unity.uiwidgets/Runtime/widgets/page_storage.cs
  2. 145
      com.unity.uiwidgets/Runtime/widgets/page_view.cs
  3. 11
      com.unity.uiwidgets/Runtime/widgets/pages.cs
  4. 34
      com.unity.uiwidgets/Runtime/widgets/performance_overlay.cs
  5. 2
      com.unity.uiwidgets/Runtime/widgets/placeholder.cs
  6. 4
      com.unity.uiwidgets/Runtime/widgets/preferred_size.cs
  7. 2
      com.unity.uiwidgets/Runtime/widgets/primary_scroll_controller.cs
  8. 3
      com.unity.uiwidgets/Runtime/widgets/scroll_position_with_single_context.cs

2
com.unity.uiwidgets/Runtime/widgets/page_storage.cs


public static PageStorageBucket of(BuildContext context) {
PageStorage widget = context.findAncestorWidgetOfExactType<PageStorage>();
return widget == null ? null : widget.bucket;
return widget?.bucket;
}
public override Widget build(BuildContext context) {

145
com.unity.uiwidgets/Runtime/widgets/page_view.cs


this.initialPage = initialPage;
this.keepPage = keepPage;
this.viewportFraction = viewportFraction;
D.assert(viewportFraction > 0.0);
D.assert(viewportFraction > 0.0f);
}
public readonly int initialPage;

}
}
public Future animateToPage(int page, TimeSpan duration, Curve curve) {
public Future animateToPage(
int page,
TimeSpan? duration = null,
Curve curve = null) {
duration,
duration ?? new TimeSpan(0,0,0,0,0),
curve
);
}

position.jumpTo(position.getPixelsFromPage(page));
}
public Future nextPage(TimeSpan duration, Curve curve) {
public Future nextPage(
TimeSpan? duration = null, Curve curve = null) {
public Future previousPage(TimeSpan duration, Curve curve) {
public Future previousPage(TimeSpan? duration = null, Curve curve = null) {
public override ScrollPosition createScrollPosition(ScrollPhysics physics, ScrollContext context,
public override ScrollPosition createScrollPosition(
ScrollPhysics physics,
ScrollContext context,
ScrollPosition oldPosition) {
return new _PagePosition(
physics: physics,

public interface IPageMetrics : ScrollMetrics {
float page { get; }
float viewportFraction { get; }
}
public class PageMetrics : FixedScrollMetrics, IPageMetrics {

}
public readonly float _viewportFraction;
public PageMetrics copyWith(
float? minScrollExtent = null,
float? maxScrollExtent = null,
float? pixels = null,
float? viewportDimension = null,
AxisDirection? axisDirection = null,
float? viewportFraction = null
) {
return new PageMetrics(
minScrollExtent: minScrollExtent ?? this.minScrollExtent,
maxScrollExtent: maxScrollExtent ?? this.maxScrollExtent,
pixels: pixels ?? this.pixels,
viewportDimension: viewportDimension ?? this.viewportDimension,
axisDirection: axisDirection ?? this.axisDirection,
viewportFraction: viewportFraction ?? this.viewportFraction
);
}
public float page {
get {

bool keepPage = true,
float viewportFraction = 1.0f,
ScrollPosition oldPosition = null
) :
base(
) : base(
physics: physics,
context: context,
initialPixels: null,

}
public float getPageFromPixels(float pixels, float viewportDimension) {
return (Mathf.Max(0.0f, pixels) / Mathf.Max(1.0f, viewportDimension * viewportFraction));
float actual = Mathf.Max(0.0f, pixels - _initialPageOffset) / Mathf.Max(1.0f, viewportDimension * viewportFraction);
float round = (int)actual * 1.0f;
if ((actual - round).abs() < 1e-10) {
return round;
}
return actual;
}
public float getPixelsFromPage(float page) {

}
public override bool applyViewportDimension(float viewportDimension) {
float oldViewportDimensions = 0.0f;
if (haveDimensions) {
oldViewportDimensions = this.viewportDimension;
}
float oldViewportDimensions = this.viewportDimension;
float? oldPixels = null;
if (havePixels) {
oldPixels = pixels;
}
float page = (oldPixels == null || oldViewportDimensions == 0.0f)
? _pageToUseOnStartup
: getPageFromPixels(oldPixels.Value, oldViewportDimensions);
float oldPixels = pixels;
float page = (oldPixels == null || oldViewportDimensions == 0.0) ? _pageToUseOnStartup : getPageFromPixels(oldPixels, oldViewportDimensions);
return result;
}

return base.applyContentDimensions(
return base.applyContentDimensions(
public PageMetrics copyWith(
float? minScrollExtent = null,
float? maxScrollExtent = null,
float? pixels = null,
float? viewportDimension = null,
AxisDirection? axisDirection = null,
float? viewportFraction = null
) {
return new PageMetrics(
minScrollExtent: minScrollExtent ?? this.minScrollExtent,
maxScrollExtent: maxScrollExtent ?? this.maxScrollExtent,
pixels: pixels ?? this.pixels,
viewportDimension: viewportDimension ?? this.viewportDimension,
axisDirection: axisDirection ?? this.axisDirection,
viewportFraction: viewportFraction ?? this.viewportFraction
);
}
}
public class _ForceImplicitScrollPhysics : ScrollPhysics {

) : base(parent: parent) {
D.assert(allowImplicitScrolling != null);
this.allowImplicitScrolling = allowImplicitScrolling;
}
public override ScrollPhysics applyTo(ScrollPhysics ancestor) {

ValueChanged<int> onPageChanged = null,
List<Widget> children = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
IndexedWidgetBuilder itemBuilder = null,
SliverChildDelegate childDelegate = null,
int itemCount = 0,
bool allowImplicitScrolling = false
) : base(key: key) {
this.scrollDirection = scrollDirection;

this.dragStartBehavior = dragStartBehavior;
this.controller = controller ?? PageViewUtils._defaultPageController;
this.allowImplicitScrolling = allowImplicitScrolling;
if (itemBuilder != null) {
childrenDelegate = new SliverChildBuilderDelegate(itemBuilder, childCount: itemCount);
}
else if (childDelegate != null) {
childrenDelegate = childDelegate;
}
else {
childrenDelegate = new SliverChildListDelegate(children ?? new List<Widget>());
}
childrenDelegate = new SliverChildListDelegate(children);
IndexedWidgetBuilder itemBuilder,
Key key = null,
Axis scrollDirection = Axis.horizontal,
bool reverse = false,

ValueChanged<int> onPageChanged = null,
IndexedWidgetBuilder itemBuilder = null,
bool allowImplicitScrolling = false,
DragStartBehavior dragStartBehavior = DragStartBehavior.start
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
bool allowImplicitScrolling = false
return new PageView(
itemBuilder: itemBuilder,
var page = new PageView(
controller: controller,
controller: controller ?? PageViewUtils._defaultPageController,
itemCount: itemCount,
allowImplicitScrolling: allowImplicitScrolling,
allowImplicitScrolling: allowImplicitScrolling,
page.childrenDelegate = new SliverChildBuilderDelegate(itemBuilder, childCount: itemCount);
return page;
}
public static PageView custom(
Key key = null,
Axis scrollDirection = Axis.horizontal,
bool reverse = false,
PageController controller = null,
ScrollPhysics physics = null,
bool pageSnapping = true,
ValueChanged<int> onPageChanged = null,
SliverChildDelegate childrenDelegate = null,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
bool allowImplicitScrolling = false
) {
D.assert(childrenDelegate != null);
var page = new PageView(
key: key,
scrollDirection: scrollDirection,
reverse: reverse,
controller: controller ?? PageViewUtils._defaultPageController,
physics: physics,
pageSnapping: pageSnapping,
onPageChanged: onPageChanged,
allowImplicitScrolling: allowImplicitScrolling,
dragStartBehavior: dragStartBehavior
);
page.childrenDelegate = childrenDelegate;
return page;
}
// TODO: PageView.custom

public readonly ValueChanged<int> onPageChanged;
public readonly SliverChildDelegate childrenDelegate;
public SliverChildDelegate childrenDelegate;
public readonly DragStartBehavior dragStartBehavior;

11
com.unity.uiwidgets/Runtime/widgets/pages.cs


}
public abstract class PageRoute : ModalRoute {
public readonly bool fullscreenDialog;
public PageRoute() {}
bool fullscreenDialog = false) : base(settings) {
bool fullscreenDialog = false
) : base(settings) {
public readonly bool fullscreenDialog;
public override bool opaque {
get { return true; }

bool fullscreenDialog = false
) : base(settings,fullscreenDialog) {
D.assert(pageBuilder != null);
this.opaque = opaque;
this.pageBuilder = pageBuilder;
this.transitionsBuilder = transitionsBuilder ?? PagesUtils._defaultTransitionsBuilder;

34
com.unity.uiwidgets/Runtime/widgets/performance_overlay.cs


public class PerformanceOverlay : LeafRenderObjectWidget {
public PerformanceOverlay(
Key key = null,
int optionsMask = 0
int optionsMask = 0,
int rasterizerThreshold = 0,
bool checkerboardRasterCacheImages = false,
bool checkerboardOffscreenLayers = false
this.rasterizerThreshold = rasterizerThreshold;
this.checkerboardOffscreenLayers = checkerboardOffscreenLayers;
this.checkerboardRasterCacheImages = checkerboardRasterCacheImages;
public readonly int rasterizerThreshold;
public readonly bool checkerboardRasterCacheImages;
public readonly bool checkerboardOffscreenLayers;
Key key = null
Key key = null,
int rasterizerThreshold = 0,
bool checkerboardRasterCacheImages = false,
bool checkerboardOffscreenLayers = false
optionsMask: (1 << (int) PerformanceOverlayOption.drawFPS) |
(1 << (int) PerformanceOverlayOption.drawFrameCost)
optionsMask :
1 << (int) PerformanceOverlayOption.displayRasterizerStatistics |
1 << (int) PerformanceOverlayOption.visualizeRasterizerStatistics |
1 << (int) PerformanceOverlayOption.displayEngineStatistics |
1 << (int) PerformanceOverlayOption.visualizeEngineStatistics
optionsMask: optionsMask);
optionsMask: optionsMask,
rasterizerThreshold: rasterizerThreshold,
checkerboardRasterCacheImages: checkerboardRasterCacheImages,
checkerboardOffscreenLayers: checkerboardOffscreenLayers
);
_renderObject.rasterizerThreshold = rasterizerThreshold;
}
}
}

2
com.unity.uiwidgets/Runtime/widgets/placeholder.cs


namespace Unity.UIWidgets.widgets {
class _Placeholderpainter : AbstractCustomPainter {
public _Placeholderpainter(
Color color,
Color color = null,
float strokeWidth = 0f
) {
this.color = color;

4
com.unity.uiwidgets/Runtime/widgets/preferred_size.cs


Size preferredSize { get; }
}
public abstract class PreferredSizeWidget : StatefulWidget{//Widget{ //StatefulWidget, SizePreferred {
public abstract class PreferredSizeWidget : Widget{ //StatefulWidget, SizePreferred {
protected PreferredSizeWidget(Key key = null) : base(key: key) {
}

public readonly Widget child;
//public override Size preferredSize { get; }
public Size preferredSize { get; }
public Size preferredSize { get; }
/*public override State createState() {
return new _PreferredSizeState();

2
com.unity.uiwidgets/Runtime/widgets/primary_scroll_controller.cs


this.controller = controller;
}
PrimaryScrollController(
public PrimaryScrollController(
Key key = null,
Widget child = null
) : base(key: key, child: child) {

3
com.unity.uiwidgets/Runtime/widgets/scroll_position_with_single_context.cs


didUpdateScrollDirection(value);
}
public override Future animateTo(float to,
public override Future animateTo(
float to,
TimeSpan duration,
Curve curve
) {

正在加载...
取消
保存