Skip to content

Commit

Permalink
feat(calendar): Implement virtualisation
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed Jun 1, 2021
1 parent b6d1dc6 commit 430fe39
Show file tree
Hide file tree
Showing 8 changed files with 519 additions and 137 deletions.
5 changes: 4 additions & 1 deletion src/Uno.UI/DirectUI/DateComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ private int CompareDate(

global::System.Diagnostics.Debug.Assert(m_spCalendar is {});

long delta = lhs.ToUniversalTime().Ticks - rhs.ToUniversalTime().Ticks;
lhs = lhs.ToUniversalTime(); // UNO
rhs = rhs.ToUniversalTime(); // UNO

long delta = lhs.Ticks - rhs.Ticks;
if (delta < 0)
{
delta = -delta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ internal Rect GetElementBounds(
return rect;
}

internal Rect GetElementArrangeBounds(
ElementType elementType,
int elementIndex,
Rect containerBounds,
Rect windowConstraint,
Size finalSize)
{
GetElementArrangeBoundsImpl(
elementType,
elementIndex,
containerBounds,
windowConstraint,
finalSize,
out var pReturnValue);

return pReturnValue;
}

internal bool ShouldContinueFillingUpSpace(
ElementType elementType,
int elementIndex,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -777,19 +777,19 @@ private set
Windows.UI.Xaml.DependencyProperty.Register(
nameof(IsGroupLabelVisible), typeof(bool),
typeof(global::Windows.UI.Xaml.Controls.CalendarView),
new FrameworkPropertyMetadata(default(bool)));
new FrameworkPropertyMetadata(false));

public static global::Windows.UI.Xaml.DependencyProperty IsOutOfScopeEnabledProperty { get; } =
Windows.UI.Xaml.DependencyProperty.Register(
nameof(IsOutOfScopeEnabled), typeof(bool),
typeof(global::Windows.UI.Xaml.Controls.CalendarView),
new FrameworkPropertyMetadata(default(bool)));
new FrameworkPropertyMetadata(true));

public static global::Windows.UI.Xaml.DependencyProperty IsTodayHighlightedProperty { get; } =
Windows.UI.Xaml.DependencyProperty.Register(
nameof(IsTodayHighlighted), typeof(bool),
typeof(global::Windows.UI.Xaml.Controls.CalendarView),
new FrameworkPropertyMetadata(default(bool)));
new FrameworkPropertyMetadata(true));

public static global::Windows.UI.Xaml.DependencyProperty MaxDateProperty { get; } =
Windows.UI.Xaml.DependencyProperty.Register(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ internal virtual void PrepareItemContainer(
return;
}

private void ClearContainerForItem(
internal void ClearContainerForItem(
DependencyObject pContainer,
object pItem)
{
Expand Down Expand Up @@ -212,7 +212,7 @@ private void ClearGroupContainerForGroup(
throw new NotImplementedException();
}

private bool CanRecycleContainer(
internal bool CanRecycleContainer(
DependencyObject pContainer)
{
var pCanRecycleContainer = true;
Expand Down Expand Up @@ -602,7 +602,7 @@ internal void UpdateScope(
internal void AdjustToFirstUnitInThisScope(out DateTime pDate)
{
int _ = 0;
AdjustToLastUnitInThisScope(out pDate, ref _);
AdjustToFirstUnitInThisScope(out pDate, ref _);
}

private void AdjustToFirstUnitInThisScope(out DateTime pDate, ref int pUnit /* = null */)
Expand Down Expand Up @@ -649,7 +649,7 @@ private void AdjustToLastUnitInThisScope(out DateTime pDate, ref int pUnit /* =

//if (pUnit)
//{
// pUnit = lastUnit;
pUnit = lastUnit;
//}
}

Expand Down
Loading

0 comments on commit 430fe39

Please sign in to comment.