-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added Colors * Added more colors and added sample page * Updated statics and added sample app with reflection to show all colors * Fixed xaml error * No comments for colors yet, this should be included when we have use case scenarios for the different colors * Added colors to XmlnsDefinition * Added documentation for the different colors * Formatted code * Updated samples colors
- Loading branch information
Showing
13 changed files
with
8,909 additions
and
8,641 deletions.
There are no files selected for viewing
17,272 changes: 8,636 additions & 8,636 deletions
17,272
src/DIPS.Xamarin.UI.Android/Resources/Resource.designer.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using Xamarin.Forms; | ||
|
||
namespace DIPS.Xamarin.UI.Resources.Colors | ||
{ | ||
/// <summary> | ||
/// Color palette colors should be used for backgrounds, borders, buttons, checkbox or other controls that the app uses | ||
/// </summary> | ||
public static class ColorPalette | ||
{ | ||
#pragma warning disable 1591 | ||
public static Color Dark = Color.FromHex("#000000"); | ||
public static Color DarkLight = Color.FromHex("#111111"); | ||
public static Color DarkAir = Color.FromHex("#3B3D3D"); | ||
|
||
public static Color Tertiary = Color.FromHex("#404040"); | ||
public static Color TertiaryLight = Color.FromHex("#4A4A4A"); | ||
public static Color TertiaryAir = Color.FromHex("#646464"); | ||
|
||
public static Color Quaternary = Color.FromHex("#76797A"); | ||
public static Color QuaternaryLight = Color.FromHex("#7F7F7F"); | ||
public static Color QuaternaryAir = Color.FromHex("#8C8C8C"); | ||
|
||
public static Color Quinary = Color.FromHex("#ACACAC"); | ||
public static Color QuinaryLight = Color.FromHex("#B2B2B2"); | ||
public static Color QuinaryAir = Color.FromHex("#D9D9D9"); | ||
|
||
public static Color Light = Color.FromHex("#EBEBEB"); | ||
public static Color LightLight = Color.FromHex("#F9F9F9"); | ||
public static Color LightAir = Color.FromHex("#FFFFFF"); | ||
|
||
public static Color Accent = Color.FromHex("#AB69BF"); | ||
public static Color AccentLight = Color.FromHex("#D297E3"); | ||
public static Color AccentAir = Color.FromHex("#F4DDFA"); | ||
#pragma warning restore 1591 | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/DIPS.Xamarin.UI/Resources/Colors/StatusColorPalette.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Xamarin.Forms; | ||
|
||
namespace DIPS.Xamarin.UI.Resources.Colors | ||
{ | ||
/// <summary> | ||
/// Status colors palette colors should be used to indicate different statuses. | ||
/// </summary> | ||
public static class StatusColorPalette | ||
{ | ||
#pragma warning disable 1591 | ||
public static Color DangerDark = Color.FromHex("#C9524D"); | ||
public static Color Danger = Color.FromHex("#F76D6D"); | ||
public static Color DangerLight = Color.FromHex("#E19D9A"); | ||
public static Color DangerAir = Color.FromHex("#FFDEDE"); | ||
|
||
public static Color WarningDark = Color.FromHex("#D29F0F"); | ||
public static Color Warning = Color.FromHex("#FFDC52"); | ||
public static Color WarningLight = Color.FromHex("#EDD5A6"); | ||
public static Color WarningAir = Color.FromHex("#F3E9BC"); | ||
|
||
public static Color SuccessDark = Color.FromHex("#006700"); | ||
public static Color Success = Color.FromHex("#5CB85C"); | ||
public static Color SuccessLight = Color.FromHex("#9FD99F"); | ||
public static Color SuccessAir = Color.FromHex("#CCEBCC"); | ||
|
||
public static Color InfoDark = Color.FromHex("#266B89"); | ||
public static Color Info = Color.FromHex("#337AB7"); | ||
public static Color InfoLight = Color.FromHex("#7FAFD8"); | ||
public static Color InfoAir = Color.FromHex("#C4DBEF"); | ||
|
||
public static Color IdleDark = Color.FromHex("#697577"); | ||
public static Color Idle = Color.FromHex("#92A1A3"); | ||
public static Color IdleLight = Color.FromHex("#B1BEBF"); | ||
public static Color IdleAir = Color.FromHex("#D3DDDE"); | ||
#pragma warning restore 1591 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Xamarin.Forms; | ||
|
||
namespace DIPS.Xamarin.UI.Resources.Colors | ||
{ | ||
/// <summary> | ||
/// Theme colors should be used as an overall color for an app. The colors are suitable for navigation bars, splash | ||
/// screen, action bars etc.. | ||
/// </summary> | ||
public static class Theme | ||
{ | ||
#pragma warning disable 1591 | ||
public static Color TealPrimary = Color.FromHex("#047F89"); | ||
public static Color TealPrimaryLight = Color.FromHex("#65868F"); | ||
public static Color TealPrimaryAir = Color.FromHex("#98B2AE"); | ||
public static Color TealSecondary = Color.FromHex("#97C8CD"); | ||
public static Color TealSecondaryLight = Color.FromHex("#ECF3F4"); | ||
public static Color TealSecondaryAir = Color.FromHex("#F0F5F7"); | ||
#pragma warning restore 1591 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/Samples/DIPS.Xamarin.UI.Samples/Resources/Colors/ColorsPage.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:d="http://xamarin.com/schemas/2014/forms/design" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:Resources="http://dips.xamarin.ui.com" | ||
xmlns:Colors="clr-namespace:DIPS.Xamarin.UI.Resources.Colors;assembly=DIPS.Xamarin.UI" | ||
mc:Ignorable="d" | ||
x:Class="DIPS.Xamarin.UI.Samples.Resources.Colors.ColorsPage" | ||
> | ||
|
||
<ScrollView> | ||
<StackLayout x:Name="colorCategories"/> | ||
</ScrollView> | ||
</ContentPage> |
80 changes: 80 additions & 0 deletions
80
src/Samples/DIPS.Xamarin.UI.Samples/Resources/Colors/ColorsPage.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Reflection; | ||
using DIPS.Xamarin.UI.Resources.Colors; | ||
using Xamarin.Forms; | ||
using Xamarin.Forms.Xaml; | ||
|
||
namespace DIPS.Xamarin.UI.Samples.Resources.Colors | ||
{ | ||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
public partial class ColorsPage : ContentPage | ||
{ | ||
public ColorsPage() | ||
{ | ||
InitializeComponent(); | ||
var allColorsCategories = new List<ColorCategory>() | ||
{ | ||
GetColorCategory(typeof(Theme)), GetColorCategory(typeof(ColorPalette)), GetColorCategory(typeof(StatusColorPalette)), | ||
}; | ||
|
||
foreach (var colorCategory in allColorsCategories) | ||
{ | ||
colorCategories.Children.Add( | ||
new Label() | ||
{ | ||
Text = colorCategory.Name, | ||
FontAttributes = FontAttributes.Bold, | ||
FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)), | ||
Margin = new Thickness(5,0,0,0) | ||
}); | ||
foreach (var colorInfo in colorCategory.ColorInfos) | ||
{ | ||
var colorStackLayout = new StackLayout(); | ||
colorStackLayout.Children.Add(new Label() { Text = $"{colorInfo.Name} ({colorInfo.Color.ToHex()})", Margin = new Thickness(5,0,0,0)}); | ||
colorStackLayout.Children.Add(new BoxView() { Color = colorInfo.Color }); | ||
colorCategories.Children.Add(colorStackLayout); | ||
} | ||
} | ||
} | ||
|
||
private ColorCategory GetColorCategory(Type type) | ||
{ | ||
var listOfColorInfos = new List<ColorInfo>(); | ||
var fields = type.GetFields(BindingFlags.Static | BindingFlags.Public); | ||
var categoryName = type.Name; | ||
foreach (var fieldInfo in fields) | ||
{ | ||
var colorInfo = new ColorInfo(fieldInfo.Name, (Color)fieldInfo.GetValue(null)); | ||
|
||
listOfColorInfos.Add(colorInfo); | ||
} | ||
|
||
return new ColorCategory(categoryName, listOfColorInfos); | ||
} | ||
|
||
public class ColorInfo | ||
{ | ||
public ColorInfo(string name, Color color) | ||
{ | ||
Name = name; | ||
Color = color; | ||
} | ||
|
||
public Color Color { get; } | ||
public string Name { get; } | ||
} | ||
|
||
public class ColorCategory | ||
{ | ||
public ColorCategory(string name, IEnumerable<ColorInfo> colorInfos) | ||
{ | ||
Name = name; | ||
ColorInfos = colorInfos; | ||
} | ||
|
||
public IEnumerable<ColorInfo> ColorInfos { get; } | ||
public string Name { get; } | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/Samples/DIPS.Xamarin.UI.Samples/Resources/ResourcesPage.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:d="http://xamarin.com/schemas/2014/forms/design" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
x:Class="DIPS.Xamarin.UI.Samples.Resources.ResourcesPage"> | ||
<StackLayout> | ||
<Button Text="Colors" | ||
Command="{Binding NavigateToCommand}" | ||
CommandParameter="Colors" /> | ||
</StackLayout> | ||
</ContentPage> |
21 changes: 21 additions & 0 deletions
21
src/Samples/DIPS.Xamarin.UI.Samples/Resources/ResourcesPage.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
using Xamarin.Forms; | ||
using Xamarin.Forms.Xaml; | ||
|
||
namespace DIPS.Xamarin.UI.Samples.Resources | ||
{ | ||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
public partial class ResourcesPage : ContentPage | ||
{ | ||
public ResourcesPage() | ||
{ | ||
InitializeComponent(); | ||
BindingContext = new ResourcesPageViewModel(Application.Current.MainPage.Navigation); | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/Samples/DIPS.Xamarin.UI.Samples/Resources/ResourcesPageViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Windows.Input; | ||
using DIPS.Xamarin.UI.Samples.Resources.Colors; | ||
using Xamarin.Forms; | ||
|
||
namespace DIPS.Xamarin.UI.Samples.Resources | ||
{ | ||
public class ResourcesPageViewModel | ||
{ | ||
private readonly INavigation m_navigation; | ||
|
||
public ResourcesPageViewModel(INavigation navigation) | ||
{ | ||
m_navigation = navigation; | ||
NavigateToCommand = new Command<string>(NavigateTo); | ||
} | ||
|
||
public ICommand NavigateToCommand { get; } | ||
|
||
private void NavigateTo(string parameter) | ||
{ | ||
if (parameter.Equals("Colors")) | ||
m_navigation.PushAsync(new ColorsPage()); | ||
|
||
} | ||
} | ||
} |