Skip to content

Commit

Permalink
fix some obsolescence warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
janusw committed Sep 21, 2024
1 parent 7ec6aa3 commit 61ad43d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions MauiSample/Infrastructure/PlatformService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static ScreenSize ScreenSize
{
get
{
if (Device.RuntimePlatform == Device.iOS)
if (DeviceInfo.Platform == DevicePlatform.iOS)
{
if (MainSize.Width <= 320)
{
Expand Down Expand Up @@ -100,7 +100,7 @@ public static void ForceGarbageCollector()
// I tested it, and in fact, in the most cases, you DO need all
// those calls for the GC to REALLY reclaim resources (especially
// with Android RecyclerView).
Device.BeginInvokeOnMainThread(async () =>
MainThread.BeginInvokeOnMainThread(async () =>
{
GC.Collect();
GC.WaitForPendingFinalizers();
Expand Down
2 changes: 1 addition & 1 deletion MauiSample/Localization/TranslateExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class TranslateExtension : IMarkupExtension

public TranslateExtension()
{
if (Device.RuntimePlatform == Device.iOS || Device.RuntimePlatform == Device.Android)
if (DeviceInfo.Platform == DevicePlatform.iOS || DeviceInfo.Platform == DevicePlatform.Android)
{
_cultureInfo = CultureInfo.CurrentUICulture;
}
Expand Down
3 changes: 1 addition & 2 deletions Tabs/Tabs/DelayedView.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Sharpnado.Tasks;
using Xamarin.Forms;

namespace Sharpnado.Tabs;

Expand All @@ -14,7 +13,7 @@ public override void LoadView()
async () =>
{
View? view = null;
if (Device.RuntimePlatform == Device.Android)
if (DeviceInfo.Platform == DevicePlatform.Android)
{
await Task.Run(
() =>
Expand Down
2 changes: 1 addition & 1 deletion Tabs/Tabs/TabHostView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ private void AddTapCommand(TabItem tabItem)
return;
}

if (Device.RuntimePlatform == Device.UWP)
if (DeviceInfo.Platform == DevicePlatform.WinUI)
{
tabItem.GestureRecognizers.Add(
new TapGestureRecognizer { Command = TabItemTappedCommand, CommandParameter = tabItem });
Expand Down

0 comments on commit 61ad43d

Please sign in to comment.