|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public override void performLayout(Size size) { |
|
|
|
Debug.Log("perform layout = " + size.ToString() + " " + selectedIndex + " " + tColumnToRow); |
|
|
|
//Debug.Log("perform layout = " + size.ToString() + " " + selectedIndex + " " + tColumnToRow);
|
|
|
|
float columnCardX = size.width / 5.0f; |
|
|
|
float columnCardWidth = size.width - columnCardX; |
|
|
|
float columnCardHeight = size.height / this.cardCount; |
|
|
|
|
|
|
Rect columnCardRect = Rect.fromLTWH(columnCardX, columnCardY, columnCardWidth, columnCardHeight); |
|
|
|
Rect rowCardRect = Rect.fromLTWH(rowCardX, 0.0f, rowCardWidth, size.height); |
|
|
|
Rect cardRect = this._interpolateRect(columnCardRect, rowCardRect).shift(offset); |
|
|
|
|
|
|
|
if (index == 0) |
|
|
|
{ |
|
|
|
Debug.Log("first card rect = " + cardRect + " " + columnCardRect + " " + rowCardRect); |
|
|
|
} |
|
|
|
|
|
|
|
string cardId = $"card{index}"; |
|
|
|
if (this.hasChild(cardId)) { |
|
|
|
this.layoutChild(cardId, BoxConstraints.tight(cardRect.size)); |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
bool _handleScrollNotification(ScrollNotification notification, float midScrollOffset) { |
|
|
|
Debug.Log("1111 = " + _headingPageController.ToString() + " " + _headingPageController.page); |
|
|
|
//Debug.Log("1111 = " + _headingPageController.ToString() + " " + _headingPageController.page);
|
|
|
|
if (notification.depth == 0 && notification is ScrollUpdateNotification) { |
|
|
|
ScrollPhysics physics = this._scrollController.position.pixels >= midScrollOffset |
|
|
|
? (ScrollPhysics) new PageScrollPhysics() |
|
|
|