Skip to content

Commit

Permalink
Disable pointer hover on mobile platforms (#1500)
Browse files Browse the repository at this point in the history
  • Loading branch information
williambohrmann3 authored and arcgis-maps-sdk-bot committed Jul 30, 2024
1 parent 6c248eb commit add018d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/MAUI/Maui.Samples/Views/CategoryPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ private async void SearchClicked(object sender, EventArgs e)
await Navigation.PushAsync(new SearchPage(), false);
}

// The favorites icon can flicker when using a pen as pointer.
private void PointerGestureRecognizer_PointerEntered(object sender, PointerEventArgs e)
{
#if WINDOWS || MACCATALYST
var view = (Border)sender;

var grid = (Grid)view.Content;
Expand All @@ -71,10 +73,12 @@ private void PointerGestureRecognizer_PointerEntered(object sender, PointerEvent
imageButton.IsVisible = true;

Console.WriteLine("PointerRecognized");
#endif
}

private void PointerGestureRecognizer_PointerExited(object sender, PointerEventArgs e)
{
#if WINDOWS || MACCATALYST
var view = (Border)sender;

var grid = (Grid)view.Content;
Expand All @@ -84,6 +88,7 @@ private void PointerGestureRecognizer_PointerExited(object sender, PointerEventA
string sampleName = (string)imageButton.CommandParameter;

imageButton.IsVisible = false || SampleManager.Current.IsSampleFavorited(sampleName);
#endif
}

protected override void OnNavigatedTo(NavigatedToEventArgs args)
Expand Down

0 comments on commit add018d

Please sign in to comment.