using System;
using InABox.Mobile.Shared;
using Microsoft.Extensions.Logging;

[assembly: Xamarin.Forms.Dependency(typeof(InABox.Mobile.Android.PopupManager))]
namespace InABox.Mobile.Android
{
    public class PopupManager : IPopupManager
    {
        
        private static bool _initialised = false;
        
        public bool Initialise()
        {
            if (!_initialised)
            {
                try
                {
                    Syncfusion.XForms.Android.PopupLayout.SfPopupLayoutRenderer.Init();
                    _initialised = true;
                }
                catch (Exception e)
                {
                    MobileLogging.Log(e);
                    _initialised = false;
                }
            }
            return _initialised;
        }
        
    }
}