Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1755 from xamarin/gh-1355
Browse files Browse the repository at this point in the history
Fixed #1355 delay processing change so OS updates
  • Loading branch information
jfversluis authored Jan 18, 2022
2 parents 7f07d01 + 1a77144 commit c6bc848
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Xamarin.Essentials/DeviceDisplay/DeviceDisplay.android.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Android.Content;
using Android.Content.Res;
using Android.Provider;
Expand Down Expand Up @@ -114,6 +115,10 @@ class Listener : OrientationEventListener
internal Listener(Context context, Action handler)
: base(context) => onChanged = handler;

public override void OnOrientationChanged(int orientation) => onChanged();
public override async void OnOrientationChanged(int orientation)
{
await Task.Delay(500);
onChanged();
}
}
}

0 comments on commit c6bc848

Please sign in to comment.