From 9dc01bca1c277b8554dd16aa6d65ff1d470ed246 Mon Sep 17 00:00:00 2001 From: kspearrin Date: Mon, 30 Sep 2019 20:38:22 -0400 Subject: [PATCH] detect dark mode theme. set modal to full screen --- src/App/Pages/BaseContentPage.cs | 10 ++++++++++ src/iOS.Core/Services/DeviceActionService.cs | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/App/Pages/BaseContentPage.cs b/src/App/Pages/BaseContentPage.cs index d3677a9cf..e4f59de48 100644 --- a/src/App/Pages/BaseContentPage.cs +++ b/src/App/Pages/BaseContentPage.cs @@ -4,6 +4,8 @@ using Bit.Core.Utilities; using System; using System.Threading.Tasks; using Xamarin.Forms; +using Xamarin.Forms.PlatformConfiguration; +using Xamarin.Forms.PlatformConfiguration.iOSSpecific; namespace Bit.App.Pages { @@ -14,6 +16,14 @@ namespace Bit.App.Pages protected int ShowModalAnimationDelay = 400; protected int ShowPageAnimationDelay = 100; + public BaseContentPage() + { + if (Device.RuntimePlatform == Device.iOS) + { + On().SetModalPresentationStyle(UIModalPresentationStyle.FullScreen); + } + } + public DateTime? LastPageAction { get; set; } protected override void OnAppearing() diff --git a/src/iOS.Core/Services/DeviceActionService.cs b/src/iOS.Core/Services/DeviceActionService.cs index 2125cdc9e..e43c59014 100644 --- a/src/iOS.Core/Services/DeviceActionService.cs +++ b/src/iOS.Core/Services/DeviceActionService.cs @@ -353,7 +353,7 @@ namespace Bit.iOS.Core.Services public bool UsingDarkTheme() { - return false; + return UIScreen.MainScreen.TraitCollection.UserInterfaceStyle == UIUserInterfaceStyle.Dark; } private void ImagePicker_FinishedPickingMedia(object sender, UIImagePickerMediaPickedEventArgs e)