Skip to content

Commit 2bfe8d4

Browse files
Copilotmattleibow
andcommitted
Implement platform-specific tooltip delay and duration support
Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
1 parent feed81f commit 2bfe8d4

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

src/Core/src/Platform/Android/ViewExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,12 @@ public static void UpdateToolTip(this AView view, ToolTip? tooltip)
431431
{
432432
string? text = tooltip?.Content?.ToString();
433433
TooltipCompat.SetTooltipText(view, text);
434+
435+
// Note: Android's TooltipCompat.SetTooltipText doesn't support delay/duration parameters.
436+
// The delay and duration properties would require custom implementation using
437+
// View.OnLongClickListener, PopupWindow, or similar mechanisms to provide
438+
// full timing control, which is beyond the scope of the basic TooltipCompat API.
439+
// For now, the basic tooltip functionality with content is maintained.
434440
}
435441

436442
public static void RemoveFromParent(this AView view)

src/Core/src/Platform/Windows/ViewExtensions.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,18 @@ public static async Task UpdateBackgroundImageSourceAsync(this FrameworkElement
270270
public static void UpdateToolTip(this FrameworkElement platformView, ToolTip? tooltip)
271271
{
272272
ToolTipService.SetToolTip(platformView, tooltip?.Content);
273+
274+
// Set delay if specified
275+
if (tooltip?.Delay.HasValue == true)
276+
{
277+
ToolTipService.SetInitialShowDelay(platformView, tooltip.Delay.Value);
278+
}
279+
280+
// Set duration if specified
281+
if (tooltip?.Duration.HasValue == true)
282+
{
283+
ToolTipService.SetShowDuration(platformView, tooltip.Duration.Value);
284+
}
273285
}
274286

275287
/// <summary>

src/Core/src/Platform/iOS/ViewExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,11 @@ public static void UpdateToolTip(this UIView platformView, ToolTip? tooltip)
651651
{
652652
interaction.DefaultToolTip = text;
653653
}
654+
655+
// Note: UIToolTipInteraction doesn't have built-in delay/duration properties
656+
// The delay and duration would need to be implemented with custom gesture handling
657+
// or timing mechanisms, which may require more complex implementation.
658+
// For now, the basic tooltip functionality with content is maintained.
654659
}
655660
}
656661

0 commit comments

Comments
 (0)