Skip to content

Commit

Permalink
ok !
Browse files Browse the repository at this point in the history
  • Loading branch information
softlion committed Apr 20, 2023
1 parent 5957404 commit efc6c16
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Vapolia.UserInteraction/UserInteraction.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -558,10 +558,17 @@ internal static Task PlatformToast(string text, ToastStyle style = ToastStyle.No
if(snackBar != null)
{
var color = Constants.ToastStyleBackgroundTint[(int)style];
if(color != null)
snackBar.SetBackgroundTint(color.ToPlatform());
var layoutParams = snackBar.View.LayoutParameters as FrameLayout.LayoutParams;
if (color != null)
{
#if MONOANDROID
var platformColor = color.Value;
#else
var platformColor = color.ToPlatform();
#endif
snackBar.SetBackgroundTint(platformColor);
}
var layoutParams = snackBar.View.LayoutParameters as FrameLayout.LayoutParams;
if (layoutParams != null)
{
layoutParams.Gravity = position == ToastPosition.Bottom ? GravityFlags.Bottom : (position == ToastPosition.Top ? GravityFlags.Top : GravityFlags.CenterVertical);
Expand Down

0 comments on commit efc6c16

Please sign in to comment.