using Xamarin.Forms;

namespace Pixiview.Utils
{
    public static class StatusBar
    {
        private const string StatusBarStyle = nameof(StatusBarStyle);

        public static readonly BindableProperty StatusBarStyleProperty = BindableProperty.CreateAttached(
            StatusBarStyle,
            typeof(StatusBarStyles),
            typeof(Page),
            StatusBarStyles.WhiteText);

        public static StatusBarStyles GetStatusBarStyle(VisualElement page) => (StatusBarStyles)page.GetValue(StatusBarStyleProperty);
        public static void SetStatusBarStyle(VisualElement page, StatusBarStyles value) => page.SetValue(StatusBarStyleProperty, value);
    }

    public enum StatusBarStyles
    {
        Default,
        // Will behave as normal. 
        // White text on black NavigationBar/in iOS Dark mode and 
        // Black text on white NavigationBar/in iOS Light mode
        DarkText,
        // Will switch the color of content of StatusBar to black. 
        WhiteText,
        // Will switch the color of content of StatusBar to white. 
        Hidden
        // Will hide the StatusBar
    }
}
