using System.Diagnostics;

using Foundation;
using UIKit;
using Xamarin.Forms;

using Lottie.Forms.iOS.Renderers;

using FFImageLoading.Forms.Touch;

using UXDivers.Artina.Shared;
              
namespace inutralia
{
	// The UIApplicationDelegate for the application. This class is responsible for launching the
	// User Interface of the application, as well as listening (and optionally responding) to application events from iOS.
	[Register ("AppDelegate")]
	public class AppDelegate : Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
	{
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
            Forms.Init ();
			CachedImageRenderer.Init(); // Initializing FFImageLoading
			AnimationViewRenderer.Init(); // Initializing Lottie

            GrialKit.Init(new ThemeColors(), "inutralia.GrialLicense");

           

            UIApplication.SharedApplication.SetStatusBarHidden(true, true);
            var tint = UIColor.White;
            UIButton.AppearanceWhenContainedIn( typeof(UINavigationBar) ).TintColor = tint;

            app.SetStatusBarStyle(UIStatusBarStyle.LightContent, true);

            //UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes{TextColor = UIColor.White});

            UINavigationBar.Appearance.TintColor = UIColor.White;



			// Code for starting up the Xamarin Test Cloud Agent
			#if ENABLE_TEST_CLOUD
			Xamarin.Calabash.Start();
			#endif

			FormsHelper.ForceLoadingAssemblyContainingType(typeof(UXDivers.Effects.Effects));
			FormsHelper.ForceLoadingAssemblyContainingType<UXDivers.Effects.iOS.CircleEffect>();

									LoadApplication (new App ());
			
			return base.FinishedLaunching (app, options);
		}
	}
}