Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [55.2.3]
- [Performance] Optimized Touch effect removal from O(n²) to O(n) in RemoveEffects.
- [Performance] Fixed CancellationTokenSource disposal leak in SearchBar on rapid text changes.
- [Performance] Replaced LINQ allocation in ListItem auto-divider logic with zero-allocation loop.
- [Performance] Cached SKLottieViewResources registration check to avoid repeated LINQ scans.
- [Performance] Reduced double enumeration in Shell memory diagnostics to single-pass loop.

## [55.2.2]
- [iOS26][Tip] Added more padding.

Expand Down
9 changes: 9 additions & 0 deletions src/library/DIPS.Mobile.UI/API/Library/DUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,15 @@ public static void RemoveViewsLocatedOnTopOfPage()
RemovePlatformSpecificViewsLocatedOnTopOfPage();
}

private static bool s_skLottieResourcesAdded;

public static void EnsureSkLottieResourcesAdded()
{
if (s_skLottieResourcesAdded)
{
return;
}

// try register with the current app
var merged = Application.Current?.Resources?.MergedDictionaries;
if (merged == null)
Expand All @@ -64,6 +71,8 @@ public static void EnsureSkLottieResourcesAdded()
{
merged.Add(new SKLottieViewResources());
}

s_skLottieResourcesAdded = true;
}

private static partial void RemovePlatformSpecificViewsLocatedOnTopOfPage();
Expand Down
14 changes: 11 additions & 3 deletions src/library/DIPS.Mobile.UI/Components/ListItems/ListItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,17 @@ private async void OnVerticalStackLayoutSizeChanged(object? sender, EventArgs e)
if(!IsVisible)
return;

if (m_verticalStackLayout!.Where(item => ((item as View)!).IsVisible)
.ToList()
.IndexOf(this) == 0)
var isFirst = false;
foreach (var item in m_verticalStackLayout!)
{
if (item is View { IsVisible: true } view)
{
isFirst = ReferenceEquals(view, this);
break;
}
}

if (isFirst)
{
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ private void OnUnloaded(object? sender, EventArgs e)
private async void OnTextChanged(string newTextValue, string oldTextValue)
{
SearchCancellationToken?.Cancel(); //Cancel the previous search
SearchCancellationToken?.Dispose();
SearchCancellationToken = new CancellationTokenSource();

try
Expand Down
12 changes: 10 additions & 2 deletions src/library/DIPS.Mobile.UI/Components/Shell/Shell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,16 @@ private static async Task TryResolvePoppedModalPages(List<ModalPageReference> mo

if (DUI.IsDebug)
{
var alivePages = pageCollectionContentTargets.Where(t => t is not null && t.IsAlive).ToList();
var garbageCollectedPages = pageCollectionContentTargets.Where(t => t is null || !t.IsAlive).ToList();
List<CollectionContentTarget> alivePages = [];
List<CollectionContentTarget?> garbageCollectedPages = [];

foreach (var t in pageCollectionContentTargets)
{
if (t is not null && t.IsAlive)
alivePages.Add(t);
else
garbageCollectedPages.Add(t);
}

var alivePageNames = string.Join(", ", alivePages.Select(p => p!.Name));
var gcPageNames = string.Join(", ", garbageCollectedPages.Select(p => p?.Name ?? "null"));
Expand Down
7 changes: 5 additions & 2 deletions src/library/DIPS.Mobile.UI/Effects/Touch/Touch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,12 @@ private static void OnTouchPropertiesChanged(BindableObject bindable, object old

private static void RemoveEffects(View view)
{
while (view.Effects.Any(e => e is Touch))
for (var i = view.Effects.Count - 1; i >= 0; i--)
{
view.Effects.Remove(view.Effects.FirstOrDefault(e => e is Touch));
if (view.Effects[i] is Touch)
{
view.Effects.RemoveAt(i);
}
}
}

Expand Down