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

Commit

Permalink
[iOS] Fix popup default color and dark mode (#1041)
Browse files Browse the repository at this point in the history
* [iOS] Fix popup default color and dark mode

* [Android] Set correct background for default color

* [Android] GetWindowColor() for popup background color

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Popup/Android/PopupRenderer.android.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Popup/Android/PopupRenderer.android.cs

* Update BasePopup.shared.cs

* Update PopupRenderer.android.cs

* Update PopupRenderer.android.cs

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Popup/BasePopup.shared.cs

Co-authored-by: Andrei <andrei.misiukevich@gmail.com>
Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com>
  • Loading branch information
3 people committed Mar 13, 2021
1 parent 6e6a28f commit 6630a8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using static Android.App.ActionBar;
using AColorRes = Android.Resource.Color;
using AView = Android.Views.View;
using FormsPlatform = Xamarin.Forms.Platform.Android.Platform;
using GravityFlags = Android.Views.GravityFlags;
Expand Down Expand Up @@ -125,7 +126,7 @@ void SetEvents(in BasePopup basePopup)
basePopup.Dismissed += OnDismissed;
}

void SetColor(in BasePopup basePopup) => Window?.SetBackgroundDrawable(new ColorDrawable(basePopup.Color.ToAndroid()));
void SetColor(in BasePopup basePopup) => Window?.SetBackgroundDrawable(new ColorDrawable(basePopup.Color.ToAndroid(AColorRes.BackgroundLight, Context)));

void SetSize(in BasePopup basePopup)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public abstract class BasePopup : VisualElement
/// </summary>
protected BasePopup()
{
Color = Color.White;
VerticalOptions = LayoutOptions.CenterAndExpand;
HorizontalOptions = LayoutOptions.CenterAndExpand;
IsLightDismissEnabled = true;
Expand Down

0 comments on commit 6630a8f

Please sign in to comment.