using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using SQLite;

namespace MobileApp.Views
{
    public partial class HomeError : ContentPage
    {
        public HomeError()
        {
            Label labelLarge = new Label
            {
                Text = "AgencySystem",
                FontSize = 40,
                HorizontalOptions = LayoutOptions.Center
            };

            Label labelSmall = new Label
            {
                Text = "You are not connected to the Internet! Please connect and restart the application",
                FontSize = 20,
                HorizontalOptions = LayoutOptions.CenterAndExpand
            };
            /*
            Button refreshButton = new Button
            {
                Text = "Refresh",
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Fill,
            };

            refreshButton.Clicked += (sender, args) =>
            {
                
                
            };
            /*
            Entry entry = new Entry
            {
                Placeholder = "Username",
                VerticalOptions = LayoutOptions.Center,
                Keyboard = Keyboard.Text
            };

            BoxView boxView = new BoxView
            {
                Color = Color.Silver,
                WidthRequest = 150,
                HeightRequest = 150,
                HorizontalOptions = LayoutOptions.StartAndExpand,
                VerticalOptions = LayoutOptions.Fill
            };

            Image image = new Image
            {
                Source = "monkey.png",
                Aspect = Aspect.AspectFit,
                HorizontalOptions = LayoutOptions.End,
                VerticalOptions = LayoutOptions.Fill
            };

            var tapGestureRecognizer = new TapGestureRecognizer();
            tapGestureRecognizer.Tapped += async (sender, e) =>
            {
                image.Opacity = .5;
                await Task.Delay(200);
                image.Opacity = 1;
            };
            image.GestureRecognizers.Add(tapGestureRecognizer);
            */
            StackLayout stackLayout = new StackLayout
            {
                Children =
                {
                    labelLarge,
                    labelSmall
                   /* button,
                    entry,
                    boxView,
                    image*/
                },
                HeightRequest = 1500
            };

            ScrollView scrollView = new ScrollView
            {
                //BackgroundColor = Color.White,
                VerticalOptions = LayoutOptions.FillAndExpand,
                Content = stackLayout
            };

            //this.BackgroundColor = Color.Black; //White

            /* Accomodate iPhone status bar.
            this.Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5);*/

            this.Content = scrollView;
        }
    }
}
