add files

This commit is contained in:
Tsanie Lily 2020-05-04 15:56:32 +08:00
parent 795aa09152
commit 98e118a481
8 changed files with 86 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,22 @@
using Pixiview.iOS.Services;
using Pixiview.Utils;
using Xamarin.Forms;
[assembly: Dependency(typeof(EnvironmentService))]
namespace Pixiview.iOS.Services
{
public class EnvironmentService : IEnvironmentService
{
public EnvironmentParameter GetEnvironment()
{
return new EnvironmentParameter
{
IconLightFontFamily = "FontAwesome5Pro-Light",
IconRegularFontFamily = "FontAwesome5Pro-Regular",
IconSolidFontFamily = "FontAwesome5Pro-Solid",
IconLeft = "\uf104" // for android, it's "\uf060"
};
}
}
}

View File

@ -0,0 +1,32 @@
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
}
}

View File

@ -0,0 +1,16 @@

namespace Pixiview.Utils
{
public interface IEnvironmentService
{
EnvironmentParameter GetEnvironment();
}
public class EnvironmentParameter
{
public string IconLightFontFamily { get; set; }
public string IconRegularFontFamily { get; set; }
public string IconSolidFontFamily { get; set; }
public string IconLeft { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using Xamarin.Forms;
namespace Pixiview.Utils
{
public static class UIFactory
{
public static NavigationPage CreateNavigationPage(Page root)
{
var navigation = new NavigationPage(root);
navigation.SetDynamicResource(NavigationPage.BarBackgroundColorProperty, App.MainColor);
navigation.SetDynamicResource(NavigationPage.BarTextColorProperty, App.MainTextColor);
navigation.SetDynamicResource(VisualElement.BackgroundColorProperty, App.WindowColor);
return navigation;
}
}
}

BIN
Res/Icon-512x512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB