Commit 30de29e9 by Javier Piris

Refactor de la app de INutralia

parent 4ad2307a
namespace inutralia.Abstractions
{
/// <summary>
/// A service that exposes whether or not certain device capabilities are available.
/// </summary>
public interface ICapabilityService
{
/// <summary>
/// Gets a bool representing whether or not the device can make calls.
/// </summary>
/// <value>A bool representing whether or not the device can make calls.</value>
bool CanMakeCalls { get; }
/// <summary>
/// A service that exposes whether or not certain device capabilities are available.
/// </summary>
public interface ICapabilityService
{
/// <summary>
/// Gets a bool representing whether or not the device can make calls.
/// </summary>
/// <value>A bool representing whether or not the device can make calls.</value>
bool CanMakeCalls { get; }
/// <summary>
/// Gets a bool representing whether or not the device can send messages.
/// </summary>
/// <value>A bool representing whether or not the device can send messages.</value>
bool CanSendMessages { get; }
/// <summary>
/// Gets a bool representing whether or not the device can send messages.
/// </summary>
/// <value>A bool representing whether or not the device can send messages.</value>
bool CanSendMessages { get; }
/// <summary>
/// Gets a bool representing whether or not the device cansend email.
/// </summary>
/// <value>A bool representing whether or not the device cansend email.</value>
bool CanSendEmail { get; }
}
/// <summary>
/// Gets a bool representing whether or not the device cansend email.
/// </summary>
/// <value>A bool representing whether or not the device cansend email.</value>
bool CanSendEmail { get; }
}
}
......@@ -3,50 +3,50 @@ using System.Threading.Tasks;
namespace inutralia.Abstractions
{
/// <summary>
/// Interfaz genérico de almacenamiento de entidades
/// </summary>
public interface IDataPersistenceService
{
/// <summary>
/// Recupera de forma asíncrona los datos de una entidad a partir de su
/// identificador
/// </summary>
/// <typeparam name="T">Tipo de dato de cada entidad</typeparam>
/// <param name="id">Identificador de la entidad</param>
/// <returns>Instancia de T correspondiente al identificador</returns>
Task<T> GetItemAsync<T>(int id) where T : IIdentifiableEntity;
/// <summary>
/// Interfaz genérico de almacenamiento de entidades
/// </summary>
public interface IDataPersistenceService
{
/// <summary>
/// Recupera de forma asíncrona los datos de una entidad a partir de su
/// identificador
/// </summary>
/// <typeparam name="T">Tipo de dato de cada entidad</typeparam>
/// <param name="id">Identificador de la entidad</param>
/// <returns>Instancia de T correspondiente al identificador</returns>
Task<T> GetItemAsync<T>(int id) where T : IIdentifiableEntity;
/// <summary>
/// Obtiene de forma asíncrona una lista de entidades
/// </summary>
/// <typeparam name="T">Tipo de dato de cada entidad</typeparam>
/// <returns>Lista de elementos obtenidos</returns>
Task<List<T>> RefreshListAsync<T>() where T : IIdentifiableEntity;
/// <summary>
/// Obtiene de forma asíncrona una lista de entidades
/// </summary>
/// <typeparam name="T">Tipo de dato de cada entidad</typeparam>
/// <returns>Lista de elementos obtenidos</returns>
Task<List<T>> RefreshListAsync<T>() where T : IIdentifiableEntity;
/// <summary>
/// Recupera de forma asíncrona los datos de una entidad
/// </summary>
/// <typeparam name="T">Tipo de dato de la entidad</typeparam>
/// <param name="item">La entidad a actualizar</param>
/// <returns>Si la operación se realizó correctamente</returns>
Task<bool> RefreshItemAsync<T>(T item) where T : IIdentifiableEntity;
/// <summary>
/// Recupera de forma asíncrona los datos de una entidad
/// </summary>
/// <typeparam name="T">Tipo de dato de la entidad</typeparam>
/// <param name="item">La entidad a actualizar</param>
/// <returns>Si la operación se realizó correctamente</returns>
Task<bool> RefreshItemAsync<T>(T item) where T : IIdentifiableEntity;
/// <summary>
/// Actualiza de forma asíncrona los datos de una entidad
/// </summary>
/// <typeparam name="T">Tipo de dato de la entidad</typeparam>
/// <param name="item">La entidad a actualizar</param>
/// <param name="isNew">Indica si hay que crear una entidad nueva o modificar una existente</param>
/// <returns>El ID de la entidad. Null en caso de error</returns>
Task<int?> UpdateItemAsync<T>(T item, bool isNew = false) where T : IIdentifiableEntity;
/// <summary>
/// Actualiza de forma asíncrona los datos de una entidad
/// </summary>
/// <typeparam name="T">Tipo de dato de la entidad</typeparam>
/// <param name="item">La entidad a actualizar</param>
/// <param name="isNew">Indica si hay que crear una entidad nueva o modificar una existente</param>
/// <returns>El ID de la entidad. Null en caso de error</returns>
Task<int?> UpdateItemAsync<T>(T item, bool isNew = false) where T : IIdentifiableEntity;
/// <summary>
/// Elimina de forma asíncrona una entidad
/// </summary>
/// <typeparam name="T">Tipo de dato de la entidad</typeparam>
/// <param name="item">La entidad a eliminar</param>
/// <returns>Si la operación se realizó correctamente</returns>
Task<bool> DeleteItemAsync<T>(T item) where T : IIdentifiableEntity;
}
/// <summary>
/// Elimina de forma asíncrona una entidad
/// </summary>
/// <typeparam name="T">Tipo de dato de la entidad</typeparam>
/// <param name="item">La entidad a eliminar</param>
/// <returns>Si la operación se realizó correctamente</returns>
Task<bool> DeleteItemAsync<T>(T item) where T : IIdentifiableEntity;
}
}
namespace inutralia.Abstractions
{
/// <summary>
/// A service that exposes some platform environment characteristics.
/// </summary>
public interface IEnvironmentService
{
/// <summary>
/// Gets a bool representing whether or not is the app is running on a simulator or device.
/// </summary>
/// <value>True if the device is real, false if a simulator/emulator.</value>
bool IsRealDevice { get; }
}
/// <summary>
/// A service that exposes some platform environment characteristics.
/// </summary>
public interface IEnvironmentService
{
/// <summary>
/// Gets a bool representing whether or not is the app is running on a simulator or device.
/// </summary>
/// <value>True if the device is real, false if a simulator/emulator.</value>
bool IsRealDevice { get; }
}
}
namespace inutralia.Abstractions
{
/// <summary>
/// Entidad que tiene un Id de tipo entero
/// </summary>
public interface IIdentifiableEntity
{
/// <summary>
/// Identificador de la entidad
/// </summary>
int Id { get; set; }
}
/// <summary>
/// Entidad que tiene un Id de tipo entero
/// </summary>
public interface IIdentifiableEntity
{
/// <summary>
/// Identificador de la entidad
/// </summary>
int Id { get; set; }
}
}
......@@ -12,28 +12,28 @@ namespace inutralia
{
//https://developer.android.com/guide/topics/manifest/activity-element.html
[Activity(
Label = "iNutralia",
Icon = "@drawable/icon",
Theme = "@style/Theme.Splash",
MainLauncher = true,
LaunchMode = LaunchMode.SingleTask,
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize,
Label = "iNutralia",
Icon = "@drawable/icon",
Theme = "@style/Theme.Splash",
MainLauncher = true,
LaunchMode = LaunchMode.SingleTask,
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize,
ScreenOrientation = ScreenOrientation.Portrait
)
]
public class MainActivity : FormsAppCompatActivity
{
protected override void OnCreate(Bundle bundle)
{
// Changing to App's theme since we are OnCreate and we are ready to
// "hide" the splash
base.Window.RequestFeature(WindowFeatures.ActionBar);
base.SetTheme(Resource.Style.AppTheme);
]
public class MainActivity : FormsAppCompatActivity
{
protected override void OnCreate(Bundle bundle)
{
// Changing to App's theme since we are OnCreate and we are ready to
// "hide" the splash
base.Window.RequestFeature(WindowFeatures.ActionBar);
base.SetTheme(Resource.Style.AppTheme);
FormsAppCompatActivity.ToolbarResource = Resource.Layout.Toolbar;
FormsAppCompatActivity.TabLayoutResource = Resource.Layout.Tabs;
FormsAppCompatActivity.ToolbarResource = Resource.Layout.Toolbar;
FormsAppCompatActivity.TabLayoutResource = Resource.Layout.Tabs;
base.OnCreate(bundle);
base.OnCreate(bundle);
Window.AddFlags(WindowManagerFlags.Fullscreen);
......@@ -41,30 +41,33 @@ namespace inutralia
FFImageLoading.Forms.Platform.CachedImageRenderer.Init(true);
Forms.Init(this, bundle);
//Initializing GrialKit
GrialKit.Init(this, "inutralia.GrialLicense");
FormsHelper.ForceLoadingAssemblyContainingType(typeof(UXDivers.Effects.Effects));
FormsHelper.ForceLoadingAssemblyContainingType(typeof(UXDivers.Effects.Effects));
LoadApplication(new App());}
LoadApplication(new App());
}
public override void OnConfigurationChanged(Android.Content.Res.Configuration newConfig)
{
base.OnConfigurationChanged(newConfig);
public override void OnConfigurationChanged(Android.Content.Res.Configuration newConfig)
{
base.OnConfigurationChanged(newConfig);
DeviceOrientationLocator.NotifyOrientationChanged();
}
DeviceOrientationLocator.NotifyOrientationChanged();
}
public override void OnBackPressed ()
public override void OnBackPressed()
{
var md = Xamarin.Forms.Application.Current.MainPage as MasterDetailPage;
if (md != null && !md.IsPresented &&
(
!(md.Detail is NavigationPage) || (((NavigationPage) md.Detail).Navigation.NavigationStack.Count == 1 && ((NavigationPage) md.Detail).Navigation.ModalStack.Count == 0)
!(md.Detail is NavigationPage) || (((NavigationPage)md.Detail).Navigation.NavigationStack.Count == 1 && ((NavigationPage)md.Detail).Navigation.ModalStack.Count == 0)
))
MoveTaskToBack (true);
MoveTaskToBack(true);
else
base.OnBackPressed ();
base.OnBackPressed();
}
}
}
......
......@@ -4,61 +4,68 @@ using Xamarin.Forms;
namespace inutralia
{
public class CustomFontLabelRenderer : ArtinaCustomFontLabelRenderer
{
private static readonly string[] CustomFontFamily = new []
public class CustomFontLabelRenderer : ArtinaCustomFontLabelRenderer
{
private static readonly string[] CustomFontFamily = new[]
{
"grialshapes",
"FontAwesome",
"Ionicons"
};
private static readonly Tuple<FontAttributes, string>[][] CustomFontFamilyData = new [] {
new [] {
new Tuple<FontAttributes, string>(FontAttributes.None, "grialshapes.ttf"),
new Tuple<FontAttributes, string>(FontAttributes.Bold, "grialshapes.ttf"),
new Tuple<FontAttributes, string>(FontAttributes.Italic, "grialshapes.ttf")
},
private static readonly Tuple<FontAttributes, string>[][] CustomFontFamilyData = new[] {
new []
{
new Tuple<FontAttributes, string>(FontAttributes.None, "grialshapes.ttf"),
new Tuple<FontAttributes, string>(FontAttributes.Bold, "grialshapes.ttf"),
new Tuple<FontAttributes, string>(FontAttributes.Italic, "grialshapes.ttf")
},
//*
new [] {
new Tuple<FontAttributes, string>(FontAttributes.None, "fontawesome-webfont.ttf"),
new Tuple<FontAttributes, string>(FontAttributes.Bold, "fontawesome-webfont.ttf"),
new Tuple<FontAttributes, string>(FontAttributes.Italic, "fontawesome-webfont.ttf")
},
new []
{
new Tuple<FontAttributes, string>(FontAttributes.None, "fontawesome-webfont.ttf"),
new Tuple<FontAttributes, string>(FontAttributes.Bold, "fontawesome-webfont.ttf"),
new Tuple<FontAttributes, string>(FontAttributes.Italic, "fontawesome-webfont.ttf")
},
//*/
//*
new [] {
new Tuple<FontAttributes, string>(FontAttributes.None, "ionicons.ttf"),
new Tuple<FontAttributes, string>(FontAttributes.Bold, "ionicons.ttf"),
new Tuple<FontAttributes, string>(FontAttributes.Italic, "ionicons.ttf")
}
new []
{
new Tuple<FontAttributes, string>(FontAttributes.None, "ionicons.ttf"),
new Tuple<FontAttributes, string>(FontAttributes.Bold, "ionicons.ttf"),
new Tuple<FontAttributes, string>(FontAttributes.Italic, "ionicons.ttf")
}
//*/
};
protected override bool CheckIfCustomFont (string fontFamily, FontAttributes attributes, out string fontFileName)
{
for (int i = 0; i < CustomFontFamily.Length; i++) {
if (string.Equals(fontFamily, CustomFontFamily[i], StringComparison.InvariantCulture)){
var fontFamilyData = CustomFontFamilyData[i];
for (int j = 0; j < fontFamilyData.Length; j++) {
var data = fontFamilyData[j];
if (data.Item1 == attributes){
fontFileName = data.Item2;
protected override bool CheckIfCustomFont(string fontFamily, FontAttributes attributes, out string fontFileName)
{
for (int i = 0; i < CustomFontFamily.Length; i++)
{
if (string.Equals(fontFamily, CustomFontFamily[i], StringComparison.InvariantCulture))
{
var fontFamilyData = CustomFontFamilyData[i];
for (int j = 0; j < fontFamilyData.Length; j++)
{
var data = fontFamilyData[j];
if (data.Item1 == attributes)
{
fontFileName = data.Item2;
return true;
}
}
return true;
}
}
break;
}
}
break;
}
}
fontFileName = null;
return false;
}
}
fontFileName = null;
return false;
}
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<resources>
<bool name="largeheap">true</bool>
<bool name="largeheap">true</bool>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<color name="primary">@color/AccentColor</color>
<color name="primary_dark">@color/AccentColor</color>
<color name="actionbar_tab_indicator">@color/AccentColor</color>
<color name="primary">@color/AccentColor</color>
<color name="primary_dark">@color/AccentColor</color>
<color name="actionbar_tab_indicator">@color/AccentColor</color>
<!-- Theme -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Theme -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Set AppCompat’s color theming attrs -->
<!-- Set AppCompat’s color theming attrs -->
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">@color/AccentColor</item>
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">@color/AccentColor</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">#000000</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">#000000</item>
<!-- colorAccent is used as the default value for colorControlActivated,
<!-- colorAccent is used as the default value for colorControlActivated,
which is used to tint widgets -->
<item name="colorAccent">@color/AccentColor</item>
<item name="colorAccent">@color/AccentColor</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<!-- Used on ListView selected items -->
<item name="android:color">@color/AccentColor</item>
<item name="android:colorPressedHighlight">@color/AccentColor</item>
<item name="android:colorLongPressedHighlight">@color/AccentColor</item>
<item name="android:colorFocusedHighlight">@color/AccentColor</item>
<item name="android:colorActivatedHighlight">@color/AccentColor</item>
<item name="android:activatedBackgroundIndicator">@color/AccentColor</item>
<!-- Used on ListView selected items -->
<item name="android:color">@color/AccentColor</item>
<item name="android:colorPressedHighlight">@color/AccentColor</item>
<item name="android:colorLongPressedHighlight">@color/AccentColor</item>
<item name="android:colorFocusedHighlight">@color/AccentColor</item>
<item name="android:colorActivatedHighlight">@color/AccentColor</item>
<item name="android:activatedBackgroundIndicator">@color/AccentColor</item>
<!-- Main theme colors -->
<!-- your app branding color for the app bar -->
<item name="android:colorPrimary">@color/primary</item>
<!-- Main theme colors -->
<!-- your app branding color for the app bar -->
<item name="android:colorPrimary">@color/primary</item>
<!-- darker variant for the status bar and contextual app bars
<!-- darker variant for the status bar and contextual app bars
<item name="android:colorPrimaryDark">@color/primary_dark</item>-->
<!-- theme UI controls like checkboxes and text fields -->
<item name="android:colorAccent">@color/AccentColor</item>
<!-- TimePicker dialog-->
<item name="android:dialogTheme">@style/AppTheme.Dialog</item>
<item name="android:timePickerDialogTheme">@style/AppTheme.Dialog</item>
<item name="android:datePickerDialogTheme">@style/AppTheme.Dialog</item>
<item name="alertDialogTheme">@style/AppTheme.AlertDialog</item>
<item name="drawerArrowStyle">@style/AppTheme.DrawerArrowStyle</item>
<item name="android:windowContentTransitions">true</item>
<item name="android:windowAllowEnterTransitionOverlap">true</item>
<item name="android:windowAllowReturnTransitionOverlap">true</item>
<item name="android:windowSharedElementEnterTransition">@android:transition/move</item>
<item name="android:windowSharedElementExitTransition">@android:transition/move</item>
</style>
<!-- Adding animation to hamburguer icon, and overriding color to fix weird color change bug on app compat -->
<style name="AppTheme.DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="spinBars">true</item>
<item name="color">#FFFFFF</item>
</style>
<!-- DatePicker style -->
<style name="AppTheme.Dialog" parent="android:Theme.Material.Light.Dialog.Alert">
<item name="android:colorAccent">@color/AccentColor</item>
<item name="android:textColorPrimary">@color/AccentColor</item>
</style>
<style name="AppTheme.DialogTitleTextStyle">
<item name="android:textColor">@color/AccentColor</item>
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Title</item>
</style>
<style name="AppTheme.AlertDialog" parent="android:Theme.Material.Light.Dialog.Alert">
<item name="android:colorAccent">@color/AccentColor</item>
<item name="android:windowTitleStyle">@style/AppTheme.DialogTitleTextStyle</item>
<item name="android:windowNoTitle">true</item>
</style>
<!-- theme UI controls like checkboxes and text fields -->
<item name="android:colorAccent">@color/AccentColor</item>
<!-- TimePicker dialog-->
<item name="android:dialogTheme">@style/AppTheme.Dialog</item>
<item name="android:timePickerDialogTheme">@style/AppTheme.Dialog</item>
<item name="android:datePickerDialogTheme">@style/AppTheme.Dialog</item>
<item name="alertDialogTheme">@style/AppTheme.AlertDialog</item>
<item name="drawerArrowStyle">@style/AppTheme.DrawerArrowStyle</item>
<item name="android:windowContentTransitions">true</item>
<item name="android:windowAllowEnterTransitionOverlap">true</item>
<item name="android:windowAllowReturnTransitionOverlap">true</item>
<item name="android:windowSharedElementEnterTransition">@android:transition/move</item>
<item name="android:windowSharedElementExitTransition">@android:transition/move</item>
</style>
<!-- Adding animation to hamburguer icon, and overriding color to fix weird color change bug on app compat -->
<style name="AppTheme.DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="spinBars">true</item>
<item name="color">#FFFFFF</item>
</style>
<!-- DatePicker style -->
<style name="AppTheme.Dialog" parent="android:Theme.Material.Light.Dialog.Alert">
<item name="android:colorAccent">@color/AccentColor</item>
<item name="android:textColorPrimary">@color/AccentColor</item>
</style>
<style name="AppTheme.DialogTitleTextStyle">
<item name="android:textColor">@color/AccentColor</item>
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Title</item>
</style>
<style name="AppTheme.AlertDialog" parent="android:Theme.Material.Light.Dialog.Alert">
<item name="android:colorAccent">@color/AccentColor</item>
<item name="android:windowTitleStyle">@style/AppTheme.DialogTitleTextStyle</item>
<item name="android:windowNoTitle">true</item>
</style>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="AccentColor">#FFA2C300</color>
<color name="ComplementColor">#FFD480D6</color>
<color name="BaseTextColor">#FF666666</color>
<color name="AccentColor">#FFA2C300</color>
<color name="ComplementColor">#FFD480D6</color>
<color name="BaseTextColor">#FF666666</color>
</resources>
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<!-- Splash styles -->
<style name="Theme.Splash" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@drawable/splash_drawable</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowIsFloating">false</item>
<item name="android:backgroundDimEnabled">true</item>
</style>
<!-- Splash styles -->
<style name="Theme.Splash" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@drawable/splash_drawable</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowIsFloating">false</item>
<item name="android:backgroundDimEnabled">true</item>
</style>
<!-- Theme -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Theme -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Set AppCompat’s color theming attrs -->
<!-- Set AppCompat’s color theming attrs -->
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">@color/AccentColor</item>
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">@color/AccentColor</item>
<!-- colorPrimaryDark is used for the status bar
<!-- colorPrimaryDark is used for the status bar
<item name="colorPrimaryDark">@color/AccentColor</item>-->
<!-- colorAccent is used as the default value for colorControlActivated,
<!-- colorAccent is used as the default value for colorControlActivated,
which is used to tint widgets -->
<item name="colorAccent">@color/AccentColor</item>
<item name="colorAccent">@color/AccentColor</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<!-- Used on ListView selected items -->
<item name="android:color">@color/AccentColor</item>
<item name="android:colorPressedHighlight">@color/AccentColor</item>
<item name="android:colorLongPressedHighlight">@color/AccentColor</item>
<item name="android:colorFocusedHighlight">@color/AccentColor</item>
<item name="android:colorActivatedHighlight">@color/AccentColor</item>
<item name="android:activatedBackgroundIndicator">@color/AccentColor</item>
<!-- Used on ListView selected items -->
<item name="android:color">@color/AccentColor</item>
<item name="android:colorPressedHighlight">@color/AccentColor</item>
<item name="android:colorLongPressedHighlight">@color/AccentColor</item>
<item name="android:colorFocusedHighlight">@color/AccentColor</item>
<item name="android:colorActivatedHighlight">@color/AccentColor</item>
<item name="android:activatedBackgroundIndicator">@color/AccentColor</item>
<!-- Main theme colors -->
<!-- your app branding color for the app bar -->
<item name="android:colorPrimary">@color/AccentColor</item>
<!-- Main theme colors -->
<!-- your app branding color for the app bar -->
<item name="android:colorPrimary">@color/AccentColor</item>
<!-- darker variant for the status bar and contextual app bars
<!-- darker variant for the status bar and contextual app bars
<item name="android:colorPrimaryDark">@color/primary_dark</item>-->
<!-- theme UI controls like checkboxes and text fields -->
<item name="android:colorAccent">@color/AccentColor</item>
<!-- Dialog attributes -->
<item name="dialogTheme">@style/AppTheme.Dialog</item>
<!-- AlertDialog attributes -->
<item name="alertDialogTheme">@style/AppTheme.Dialog</item>
<item name="drawerArrowStyle">@style/AppTheme.DrawerArrowStyle</item>
<item name="android:showDividers">none</item>
<item name="android:divider">@null</item>
<item name="android:datePickerStyle">@style/Widget.AppTheme.Picker</item>
</style>
<!-- Adding animation to hamburguer icon, and overriding color to fix weird color change bug on app compat -->
<style name="AppTheme.DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="spinBars">true</item>
<item name="color">#FFFFFF</item>
</style>
<style name="AppTheme.Dialog" parent="@style/Theme.AppCompat.Light.Dialog">
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
<item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
<item name="android:textColorAlertDialogListItem">@color/AccentColor</item>
<item name="android:textColor">@color/AccentColor</item>
<item name="colorAccent">@color/AccentColor</item>
<item name="android:borderlessButtonStyle">@style/Widget.AppTheme.Button.Borderless</item>
</style>
<style name="Widget.AppTheme.Button.Borderless" parent="@style/Widget.AppCompat.Button.Borderless">
<item name="android:textColor">#FF00FF</item>
<item name="android:textAppearance">@style/TextAppearance.AppTheme.DialogButton</item>
</style>
<style name="Widget.AppTheme.TabLayout" parent="@style/Widget.Design.TabLayout">
<item name="tabSelectedTextColor">@color/AccentColor</item>
<item name="tabTextColor">@color/BaseTextColor</item>
</style>
<style name="Widget.AppTheme.Picker" parent="@style/Theme.AppCompat.Light.Dialog">
<item name="android:colorPrimary">@color/AccentColor</item>
<item name="android:colorPrimaryDark">@color/AccentColor</item>
<item name="android:colorAccent">@color/AccentColor</item>
<item name="android:textColor">@color/AccentColor</item>
</style>
<style name="TextAppearance.AppTheme.DialogButton" parent="@style/TextAppearance.AppCompat.Title">
</style>
<!-- theme UI controls like checkboxes and text fields -->
<item name="android:colorAccent">@color/AccentColor</item>
<!-- Dialog attributes -->
<item name="dialogTheme">@style/AppTheme.Dialog</item>
<!-- AlertDialog attributes -->
<item name="alertDialogTheme">@style/AppTheme.Dialog</item>
<item name="drawerArrowStyle">@style/AppTheme.DrawerArrowStyle</item>
<item name="android:showDividers">none</item>
<item name="android:divider">@null</item>
<item name="android:datePickerStyle">@style/Widget.AppTheme.Picker</item>
</style>
<!-- Adding animation to hamburguer icon, and overriding color to fix weird color change bug on app compat -->
<style name="AppTheme.DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="spinBars">true</item>
<item name="color">#FFFFFF</item>
</style>
<style name="AppTheme.Dialog" parent="@style/Theme.AppCompat.Light.Dialog">
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowMinWidthMajor">@android:dimen/dialog_min_width_major</item>
<item name="android:windowMinWidthMinor">@android:dimen/dialog_min_width_minor</item>
<item name="android:textColorAlertDialogListItem">@color/AccentColor</item>
<item name="android:textColor">@color/AccentColor</item>
<item name="colorAccent">@color/AccentColor</item>
<item name="android:borderlessButtonStyle">@style/Widget.AppTheme.Button.Borderless</item>
</style>
<style name="Widget.AppTheme.Button.Borderless" parent="@style/Widget.AppCompat.Button.Borderless">
<item name="android:textColor">#FF00FF</item>
<item name="android:textAppearance">@style/TextAppearance.AppTheme.DialogButton</item>
</style>
<style name="Widget.AppTheme.TabLayout" parent="@style/Widget.Design.TabLayout">
<item name="tabSelectedTextColor">@color/AccentColor</item>
<item name="tabTextColor">@color/BaseTextColor</item>
</style>
<style name="Widget.AppTheme.Picker" parent="@style/Theme.AppCompat.Light.Dialog">
<item name="android:colorPrimary">@color/AccentColor</item>
<item name="android:colorPrimaryDark">@color/AccentColor</item>
<item name="android:colorAccent">@color/AccentColor</item>
<item name="android:textColor">@color/AccentColor</item>
</style>
<style name="TextAppearance.AppTheme.DialogButton" parent="@style/TextAppearance.AppCompat.Title">
</style>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
using Newtonsoft.Json;
using System;
using System.ComponentModel;
using System.Globalization;
namespace inutralia.Models
{
[JsonObject(MemberSerialization.OptIn)]
[DataPath("article")]
public class Article : ObservableEntityData
{
[JsonProperty("title", Required = Required.Always)]
public string Title { get; set; }
[JsonObject(MemberSerialization.OptIn)]
[DataPath("article")]
public class Article : ObservableEntityData
{
[JsonProperty("title", Required = Required.Always)]
public string Title { get; set; }
[JsonProperty("excerpt")]
public string Excerpt { get; set; }
[JsonProperty("excerpt")]
public string Excerpt { get; set; }
[JsonProperty("body")]
public string Body { get; set; }
[JsonProperty("body")]
public string Body { get; set; }
[JsonProperty("photo")]
public string Photo { get; set; }
[JsonProperty("photo")]
public string Photo { get; set; }
[JsonProperty("published")]
public string Date { get; set; }
public string ExcerptCompress => Excerpt == null ? "..." : Excerpt.Substring(0, Math.Min(80, Excerpt.Length)).Length<80 ? Excerpt : Excerpt.Substring(0, Excerpt.Substring(0, 80).LastIndexOf(" ")) + ((Excerpt.Length>80) ? "..." : "" );
public string ExcerptCompress => Excerpt == null ? "..." : Excerpt.Substring(0, Math.Min(80, Excerpt.Length)).Length < 80 ? Excerpt : Excerpt.Substring(0, Excerpt.Substring(0, 80).LastIndexOf(" ")) + ((Excerpt.Length > 80) ? "..." : "");
}
}
......@@ -20,5 +20,4 @@ namespace inutralia
return objectType == typeof(bool);
}
}
}
......@@ -7,10 +7,12 @@ namespace inutralia.Models
/// este atributo, se utilizará el nombre de la clase en minúsculas con una 's' al
/// final
/// </summary>
///
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public class DataPathAttribute : Attribute
{
public DataPathAttribute ( string path)
public DataPathAttribute(string path)
{
DataPath = path;
}
......

using Newtonsoft.Json;
using Newtonsoft.Json;
using System.Collections.Generic;
namespace inutralia.Models
{
[JsonObject(MemberSerialization.OptIn)]
public class Day
{
[JsonProperty("ds", Required = Required.Always)]
public string Ds { get; set; }
[JsonObject(MemberSerialization.OptIn)]
public class Day
{
[JsonProperty("ds", Required = Required.Always)]
public string Ds { get; set; }
[JsonProperty("lunchFirst", Required = Required.Always)]
public IList<Recipe> LunchFirst { get; set; }
[JsonProperty("lunchSecond", Required = Required.Always)]
public IList<Recipe> LunchSecond { get; set; }
[JsonProperty("lunchFirst", Required = Required.Always)]
public IList<Recipe> LunchFirst { get; set; }
[JsonProperty("dinnerFirst", Required = Required.Always)]
public IList<Recipe> DinnerFirst { get; set; }
[JsonProperty("lunchSecond", Required = Required.Always)]
public IList<Recipe> LunchSecond { get; set; }
[JsonProperty("dinnerSecond", Required = Required.Always)]
public IList<Recipe> DinnerSecond { get; set; }
[JsonProperty("dinnerFirst", Required = Required.Always)]
public IList<Recipe> DinnerFirst { get; set; }
public Day()
{
[JsonProperty("dinnerSecond", Required = Required.Always)]
public IList<Recipe> DinnerSecond { get; set; }
}
}
public Day() { }
}
}
using Newtonsoft.Json;
using System.ComponentModel;
using System;
namespace inutralia.Models
{
[JsonObject(MemberSerialization.OptIn)]
[DataPath("generic")]
public class Generic : MenuBase
{
[JsonProperty("ds", Required = Required.Always)]
public string Ds
{ get; set; }
[JsonObject(MemberSerialization.OptIn)]
[DataPath("generic")]
public class Generic : MenuBase
{
[JsonProperty("ds", Required = Required.Always)]
public string Ds { get; set; }
public override string Title
{
get
{
return Ds;
}
get { return Ds; }
}
}
}

using Newtonsoft.Json;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Serialization;
using Newtonsoft.Json;
namespace inutralia.Models
{
[JsonObject(MemberSerialization.OptIn)]
[DataPath("recipe")]
public class Ingredient : ObservableEntityData
{
[JsonProperty("name", Required = Required.Always)]
public string Name { get; set; }
[JsonObject(MemberSerialization.OptIn)]
[DataPath("recipe")]
public class Ingredient : ObservableEntityData
{
[JsonProperty("name", Required = Required.Always)]
public string Name { get; set; }
[JsonProperty("cuantity")]
public string Cuantity { get; set; }
[JsonProperty("cuantity")]
public string Cuantity { get; set; }
[JsonProperty("order")]
public int Order { get; set; }
[JsonProperty("order")]
public int Order { get; set; }
public Ingredient() { }
}
}
}
using Newtonsoft.Json;
using System.ComponentModel;
using System;
namespace inutralia.Models
{
/// <summary>
/// Representa el menú personal guardado localmente
/// </summary>
[JsonObject (MemberSerialization.OptIn)]
[DataPath ("LocalMenu")]
/// </summary>
[JsonObject(MemberSerialization.OptIn)]
[DataPath("LocalMenu")]
public class LocalMenu : Menu
{
private static JsonSerializerSettings _jsonSettings = new JsonSerializerSettings { ObjectCreationHandling = ObjectCreationHandling.Replace, NullValueHandling = NullValueHandling.Ignore};
private static JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
{
ObjectCreationHandling = ObjectCreationHandling.Replace,
NullValueHandling = NullValueHandling.Ignore
};
/// <summary>
/// Indice del plato seleccionado para un día
/// </summary>
public class MealSelections
{
[JsonProperty ("lf_idx", DefaultValueHandling = DefaultValueHandling.Populate)]
[JsonProperty("lf_idx", DefaultValueHandling = DefaultValueHandling.Populate)]
[DefaultValue(-1)]
public int LunchFirstIndex = -1;
[JsonProperty ("ls_idx", DefaultValueHandling = DefaultValueHandling.Populate)]
[DefaultValue (-1)]
[JsonProperty("ls_idx", DefaultValueHandling = DefaultValueHandling.Populate)]
[DefaultValue(-1)]
public int LunchSecondIndex = -1;
[JsonProperty ("df_idx", DefaultValueHandling = DefaultValueHandling.Populate)]
[DefaultValue (-1)]
[JsonProperty("df_idx", DefaultValueHandling = DefaultValueHandling.Populate)]
[DefaultValue(-1)]
public int DinnerFirstIndex = -1;
[JsonProperty ("ds_idx", DefaultValueHandling = DefaultValueHandling.Populate)]
[DefaultValue (-1)]
[JsonProperty("ds_idx", DefaultValueHandling = DefaultValueHandling.Populate)]
[DefaultValue(-1)]
public int DinnerSecondIndex = -1;
}
......@@ -40,7 +42,7 @@ namespace inutralia.Models
/// Platos seleccionados para cada uno de los días
/// </summary>
[JsonProperty("day_selections")]
public MealSelections [] DaySelections;
public MealSelections[] DaySelections;
/// <summary>
/// Identificador del último menú semanal recibido del servidor
......@@ -52,19 +54,18 @@ namespace inutralia.Models
/// Copia los datos del menú recibido del servidor
/// </summary>
/// <param name="menu">El recibido del servidor</param>
public void AssignFromMenu ( Menu menu)
public void AssignFromMenu(Menu menu)
{
// Usar el serializador Json para copiar los datos del menú
JsonConvert.PopulateObject (JsonConvert.SerializeObject (menu), this, _jsonSettings);
JsonConvert.PopulateObject(JsonConvert.SerializeObject(menu), this, _jsonSettings);
// Borrar la selección de los platos de cada día
DaySelections = new MealSelections [7];
DaySelections = new MealSelections[7];
for (int i = 0; i < 7; i++)
DaySelections[i] = new MealSelections ();
DaySelections[i] = new MealSelections();
// Asignar último menú recibido
LastReceivedMenuId = menu.Id;
}
}
}
using Newtonsoft.Json;
using System.ComponentModel;
using System;
namespace inutralia.Models
{
[JsonObject(MemberSerialization.OptIn)]
[DataPath("menu")]
public class Menu : MenuBase
{
[JsonProperty("recomendation", DefaultValueHandling = DefaultValueHandling.Populate)]
[DefaultValue("")]
public string Recomendation
{ get; set; }
[JsonObject(MemberSerialization.OptIn)]
[DataPath("menu")]
[JsonProperty("intro", DefaultValueHandling = DefaultValueHandling.Populate)]
[DefaultValue("")]
public string Intro
{ get; set; }
public class Menu : MenuBase
{
[JsonProperty("recomendation", DefaultValueHandling = DefaultValueHandling.Populate)]
[DefaultValue("")]
public string Recomendation { get; set; }
[JsonProperty("intro", DefaultValueHandling = DefaultValueHandling.Populate)]
[DefaultValue("")]
public string Intro { get; set; }
public override string Title
{
......@@ -26,8 +24,6 @@ namespace inutralia.Models
}
}
public Menu()
{
}
}
public Menu() { }
}
}
......@@ -2,60 +2,50 @@
using System.Collections.Generic;
using System.ComponentModel;
namespace inutralia.Models
{
public abstract class MenuBase : ObservableEntityData
public abstract class MenuBase : ObservableEntityData
{
public abstract string Title { get; }
[JsonProperty("days")]
public IList<Day> Days
{ get; set; }
[JsonProperty("recBreakfastBase")]
[DefaultValue("")]
public string RecBreakfastBase
{ get; set; }
[JsonProperty("recBreakfastExt")]
[DefaultValue("")]
public string RecBreakfastExt
{ get; set; }
[JsonProperty("recMorningBase")]
[DefaultValue("")]
public string RecMorningBase
{ get; set; }
[JsonProperty("recMorningExt")]
[DefaultValue("")]
public string RecMorningExt
{ get; set; }
[JsonProperty("recAfternoonBase")]
[DefaultValue("")]
public string RecAfternoonBase
{ get; set; }
[JsonProperty("recAfternoonExt")]
[DefaultValue("")]
public string RecAfternoonExt
{ get; set; }
[JsonProperty("recGeneralBase")]
[DefaultValue("")]
public string RecGeneralBase
{ get; set; }
[JsonProperty("recGeneralExt")]
[DefaultValue("")]
public string RecGeneralExt
{ get; set; }
public string resume => "<br><div style='background-color:#62b9ae; overflow: auto; width:100%; text-align:center'><h3 style='color:#FFFFFF'> DESAYUNO </h3></div><br>" + RecBreakfastBase + "<br>" + RecBreakfastExt +
"<br><div style='background-color:#62b9ae; overflow: auto; width:100%; text-align:center'><h3 style='color:#FFFFFF'> MEDIA MAÑANA </h3></div><br>" + RecMorningBase + "<br>" + RecMorningExt +
[JsonProperty("days")]
public IList<Day> Days { get; set; }
[JsonProperty("recBreakfastBase")]
[DefaultValue("")]
public string RecBreakfastBase { get; set; }
[JsonProperty("recBreakfastExt")]
[DefaultValue("")]
public string RecBreakfastExt { get; set; }
[JsonProperty("recMorningBase")]
[DefaultValue("")]
public string RecMorningBase { get; set; }
[JsonProperty("recMorningExt")]
[DefaultValue("")]
public string RecMorningExt { get; set; }
[JsonProperty("recAfternoonBase")]
[DefaultValue("")]
public string RecAfternoonBase { get; set; }
[JsonProperty("recAfternoonExt")]
[DefaultValue("")]
public string RecAfternoonExt { get; set; }
[JsonProperty("recGeneralBase")]
[DefaultValue("")]
public string RecGeneralBase { get; set; }
[JsonProperty("recGeneralExt")]
[DefaultValue("")]
public string RecGeneralExt { get; set; }
public string resume => "<br><div style='background-color:#62b9ae; overflow: auto; width:100%; text-align:center'><h3 style='color:#FFFFFF'> DESAYUNO </h3></div><br>" + RecBreakfastBase + "<br>" + RecBreakfastExt +
"<br><div style='background-color:#62b9ae; overflow: auto; width:100%; text-align:center'><h3 style='color:#FFFFFF'> MEDIA MAÑANA </h3></div><br>" + RecMorningBase + "<br>" + RecMorningExt +
"<br><div style='background-color:#62b9ae; overflow: auto; width:100%; text-align:center'><h3 style='color:#FFFFFF'> MERIENDA </h3></div><br>" + RecAfternoonBase + "<br>" + RecAfternoonExt +
"<br><div style='background-color:#62b9ae; overflow: auto; width:100%; text-align:center'><h3 style='color:#FFFFFF'> CONSEJOS GENERALES </h3></div><br>" + RecGeneralBase + "<br>" + RecGeneralExt ;
"<br><div style='background-color:#62b9ae; overflow: auto; width:100%; text-align:center'><h3 style='color:#FFFFFF'> CONSEJOS GENERALES </h3></div><br>" + RecGeneralBase + "<br>" + RecGeneralExt;
}
}
\ No newline at end of file
......@@ -9,14 +9,14 @@ namespace inutralia.Models
/// </summary>
public class ObservableEntityData : ObservableObject, IIdentifiableEntity
{
public ObservableEntityData ()
public ObservableEntityData()
{
// Los identificadores negativos indican que la entidad es nueva y no
// existe por tanto en la base de datos
Id = -1;
}
[JsonProperty ("id", Required = Required.Always)]
[JsonProperty("id", Required = Required.Always)]
public int Id { get; set; }
}
}
using Newtonsoft.Json;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Serialization;
namespace inutralia.Models
{
[JsonObject(MemberSerialization.OptIn)]
[DataPath("profile")]
public class Profile : ObservableEntityData
{
[JsonProperty("code")]
[DefaultValue("")]
public string Code { get; set; }
[JsonProperty("age")]
[DefaultValue(0)]
public int Age { get; set; }
[JsonProperty("gender")]
[DefaultValue('M')]
public char Gender { get; set; }
[JsonProperty("height")]
[DefaultValue(0)]
public int Height { get; set; }
[JsonProperty("weight")]
[DefaultValue(0)]
//public int _Weight;
//public int Weight { get { return _Weight;} set { SetProperty(ref _Weight,value);} }
public int Weight { get; set; }
[JsonProperty("physical")]
[DefaultValue(0)]
public int Physical { get; set; }
[JsonProperty("menopause")]
[JsonObject(MemberSerialization.OptIn)]
[DataPath("profile")]
public class Profile : ObservableEntityData
{
[JsonProperty("code")]
[DefaultValue("")]
public string Code { get; set; }
[JsonProperty("age")]
[DefaultValue(0)]
public int Age { get; set; }
[JsonProperty("gender")]
[DefaultValue('M')]
public char Gender { get; set; }
[JsonProperty("height")]
[DefaultValue(0)]
public int Height { get; set; }
[JsonProperty("weight")]
[DefaultValue(0)]
public int Weight { get; set; }
[JsonProperty("physical")]
[DefaultValue(0)]
public int Physical { get; set; }
[JsonProperty("menopause")]
[JsonConverter(typeof(BoolConverter))]
[DefaultValue("0")]
public bool Menopause { get; set; }
public bool Menopause { get; set; }
[JsonProperty("pregnancy")]
[JsonConverter(typeof(BoolConverter))]
[DefaultValue("0")]
......@@ -48,65 +44,62 @@ namespace inutralia.Models
[JsonProperty("lactation")]
[JsonConverter(typeof(BoolConverter))]
[DefaultValue("0")]
public bool Lactation { get; set; }
public bool Lactation { get; set; }
[JsonProperty("celiac")]
[JsonConverter(typeof(BoolConverter))]
[DefaultValue("0")]
public bool Celiac { get; set; }
public bool Celiac { get; set; }
[JsonProperty("lactose")]
[JsonConverter(typeof(BoolConverter))]
[DefaultValue("0")]
public bool Lactose { get; set; }
public bool Lactose { get; set; }
[JsonProperty("diabetes")]
[JsonConverter(typeof(BoolConverter))]
[DefaultValue("0")]
public bool Diabetes { get; set; }
public bool Diabetes { get; set; }
[JsonProperty("cholesterol")]
[JsonConverter(typeof(BoolConverter))]
[DefaultValue("0")]
public bool Cholesterol { get; set; }
public bool Cholesterol { get; set; }
[JsonProperty("hypertension")]
[JsonConverter(typeof(BoolConverter))]
[DefaultValue("0")]
public bool Hypertension { get; set; }
public bool Hypertension { get; set; }
[JsonProperty("triglycerides")]
[JsonConverter(typeof(BoolConverter))]
[DefaultValue("0")]
public bool Triglycerides { get; set; }
public bool Triglycerides { get; set; }
[JsonProperty("cv")]
[JsonConverter(typeof(BoolConverter))]
[DefaultValue("0")]
public bool Cv { get; set; }
public bool Cv { get; set; }
[JsonProperty("al_fish")]
[JsonConverter(typeof(BoolConverter))]
[DefaultValue("0")]
public bool Al_fish { get; set; }
public bool Al_fish { get; set; }
[JsonProperty("al_egg")]
[JsonConverter(typeof(BoolConverter))]
[DefaultValue("0")]
public bool Al_egg { get; set; }
public bool Al_egg { get; set; }
[JsonProperty("al_nuts")]
[JsonConverter(typeof(BoolConverter))]
[DefaultValue("0")]
public bool Al_nuts { get; set; }
public bool Al_nuts { get; set; }
[JsonProperty("preference")]
[DefaultValue(0)]
public int Preference { get; set; }
public int Preference { get; set; }
public Profile()
{
}
}
public Profile() { }
}
}

using Newtonsoft.Json;
using Newtonsoft.Json;
using System.Collections.Generic;
namespace inutralia.Models
{
[JsonObject(MemberSerialization.OptIn)]
[DataPath("recipe")]
[JsonObject(MemberSerialization.OptIn)]
[DataPath("recipe")]
public class Recipe : ObservableEntityData
{
public class Recipe : ObservableEntityData
{
[JsonProperty("name", Required = Required.Always)]
public string Name { get; set; }
[JsonProperty("shortName")]
public string ShortName { get; set; }
public string ShortName { get; set; }
[JsonProperty("excerpt")]
public string Excerpt { get; set; }
[JsonProperty("excerpt")]
public string Excerpt { get; set; }
[JsonProperty("description")]
public string Description { get; set; }
[JsonProperty("description")]
public string Description { get; set; }
[JsonProperty("image")]
public string Image { get; set; }
[JsonProperty("image")]
public string Image { get; set; }
[JsonProperty("time")]
public int Time { get; set; }
[JsonProperty("time")]
public int Time { get; set; }
[JsonProperty("difficulty")]
public string Difficulty { get; set; }
[JsonProperty("difficulty")]
public string Difficulty { get; set; }
[JsonProperty("energy")]
public string Energy { get; set; }
[JsonProperty("energy")]
public string Energy { get; set; }
[JsonProperty("protein")]
public string Protein { get; set; }
[JsonProperty("protein")]
public string Protein { get; set; }
[JsonProperty("carbohydrates")]
public string Carbohydrates { get; set; }
[JsonProperty("carbohydrates")]
public string Carbohydrates { get; set; }
[JsonProperty("lipids")]
public string Lipids { get; set; }
[JsonProperty("lipids")]
public string Lipids { get; set; }
[JsonProperty("fiber")]
public string Fiber { get; set; }
[JsonProperty("fiber")]
public string Fiber { get; set; }
[JsonProperty("cholesterol")]
[JsonProperty("cholesterol")]
public string Cholesterol { get; set; }
[JsonProperty("ingredients")]
public IList<Ingredient> Ingredients { get; set; }
public string ExcerptQuotes => $"\"{Excerpt}\"";
public Recipe()
{
}
}
public Recipe() { }
}
}
......@@ -2,10 +2,10 @@
namespace inutralia.Models
{
[JsonObject (MemberSerialization.OptIn)]
[JsonObject(MemberSerialization.OptIn)]
public class RecipeOption : ObservableEntityData
{
[JsonProperty ("name", Required = Required.Always)]
[JsonProperty("name", Required = Required.Always)]
public string Name { get; set; }
public bool Selected { get; set; }
......
......@@ -3,8 +3,9 @@ using System.Collections.Generic;
namespace inutralia.Models
{
[JsonObject (MemberSerialization.OptIn)]
[DataPath ("options")]
[JsonObject(MemberSerialization.OptIn)]
[DataPath("options")]
public class RecipeOptionGroup : ObservableEntityData
{
private bool _isExpanded = false;
......@@ -22,10 +23,10 @@ namespace inutralia.Models
}
}
[JsonProperty ("name", Required = Required.Always)]
[JsonProperty("name", Required = Required.Always)]
public string Name { get; set; }
[JsonProperty ("options")]
[JsonProperty("options")]
public IList<RecipeOption> Options { get; set; }
}
}
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace inutralia.Models
{
[JsonObject(MemberSerialization.OptIn)]
[DataPath("shoppingList")]
public class ShoppingList : ObservableEntityData
{
[JsonProperty("text", Required = Required.Always)]
public string Text { get; set; }
public string Text { get; set; }
[JsonProperty("select", Required = Required.Always)]
public bool Select { get; set; }
......
......@@ -4,20 +4,21 @@ using System.Collections.Generic;
namespace inutralia.Models
{
[JsonObject (MemberSerialization.OptIn)]
[DataPath ("game")]
[JsonObject(MemberSerialization.OptIn)]
[DataPath("game")]
public class TrivialGame : ObservableEntityData
{
[JsonProperty ("start", Required = Required.Always)]
[JsonProperty("start", Required = Required.Always)]
public string StartDate { get; protected set; }
[JsonProperty ("finish", Required = Required.Always )]
[JsonProperty("finish", Required = Required.Always)]
public string FinishDate { get; protected set; }
[JsonProperty ("questions", Required = Required.Always)]
[JsonProperty("questions", Required = Required.Always)]
public IList<TrivialQuestion> Questions;
[JsonProperty ("answers", Required = Required.Always)]
[JsonProperty("answers", Required = Required.Always)]
public IList<int> Answers;
public string Progress => $"{Answers.Count} / {Questions.Count}";
......@@ -28,13 +29,13 @@ namespace inutralia.Models
{
// Si no está todo respondido, no hay puntuación
int n = Answers.Count;
if ( (n < Questions.Count) || (n < 1) )
if ((n < Questions.Count) || (n < 1))
return "";
// Calcular respuestas correctas
int correctas = 0;
for (int i = 0; i < n; i++)
if (Questions [i].ValidIndex == Answers [i])
if (Questions[i].ValidIndex == Answers[i])
correctas++;
// TODO: Otro mecanismo de score ?
......@@ -43,28 +44,26 @@ namespace inutralia.Models
}
}
public static TrivialGame Create ( IList<TrivialQuestion> questions)
public static TrivialGame Create(IList<TrivialQuestion> questions)
{
TrivialGame game = new TrivialGame ();
TrivialGame game = new TrivialGame();
game.Questions = questions;
game.Answers = new List<int> ();
game.Answers = new List<int>();
game.StartDate = DateTime.Now.ToString();
game.FinishDate = "";
return game;
}
public bool Answer ( int answer)
public bool Answer(int answer)
{
int n = Answers.Count;
if(n < Questions.Count)
if (n < Questions.Count)
{
Answers.Add (answer);
OnPropertyChanged ("Answers");
OnPropertyChanged ("Progress");
OnPropertyChanged ("Score");
return Questions [n].ValidIndex == answer;
Answers.Add(answer);
OnPropertyChanged("Answers");
OnPropertyChanged("Progress");
OnPropertyChanged("Score");
return Questions[n].ValidIndex == answer;
} //endif
return false;
......
......@@ -4,21 +4,22 @@ using System.ComponentModel;
namespace inutralia.Models
{
[JsonObject (MemberSerialization.OptIn)]
[DataPath ("trivial")]
[JsonObject(MemberSerialization.OptIn)]
[DataPath("trivial")]
public class TrivialQuestion : ObservableEntityData
{
[JsonProperty ("image", DefaultValueHandling = DefaultValueHandling.Populate)]
[JsonProperty("image", DefaultValueHandling = DefaultValueHandling.Populate)]
[DefaultValue("")]
public string Image { get; set; }
[JsonProperty ("text", Required = Required.Always)]
[JsonProperty("text", Required = Required.Always)]
public string Text { get; set; }
[JsonProperty ("options", Required = Required.Always)]
[JsonProperty("options", Required = Required.Always)]
public IList<string> Options { get; set; }
[JsonProperty ("valid", Required = Required.Always)]
[JsonProperty("valid", Required = Required.Always)]
public int ValidIndex { get; set; }
}
}

using Newtonsoft.Json;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Serialization;
using Newtonsoft.Json;
namespace inutralia.Models
{
[JsonObject(MemberSerialization.OptIn)]
[DataPath("user")]
public class User : ObservableEntityData
{
public User()
{
[JsonObject(MemberSerialization.OptIn)]
[DataPath("user")]
}
}
public class User : ObservableEntityData
{
public User() { }
}
}
......@@ -3,39 +3,39 @@ using System.Globalization;
namespace inutralia.Utils
{
public static class DateUtilities
{
public static DateTime DateTimefromTimeStamp(int timestamp)
{
DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
dtDateTime = dtDateTime.AddSeconds(timestamp);
return dtDateTime;
}
public static class DateUtilities
{
public static DateTime DateTimefromTimeStamp(int timestamp)
{
DateTime dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
dtDateTime = dtDateTime.AddSeconds(timestamp);
return dtDateTime;
}
public static string formatedDateFromTimeStamp(int timestamp, string format = "dd/MM/YYYY")
{
DateTime time = DateTimefromTimeStamp(timestamp);
string d1 = DateTime.UtcNow.ToString("dd/MM/yyyy");
string d2 = time.ToString("dd/MM/yyyy");
if (d1 == d2)
{
format = "HH:mm";
}
return time.ToString(format);
}
public static string formatedDateFromTimeStamp(int timestamp, string format = "dd/MM/YYYY")
{
DateTime time = DateTimefromTimeStamp(timestamp);
string d1 = DateTime.UtcNow.ToString("dd/MM/yyyy");
string d2 = time.ToString("dd/MM/yyyy");
if (d1 == d2)
{
format = "HH:mm";
}
return time.ToString(format);
}
public static Int32 formatedDateToTimeStamp(string date, string format = "dd/mm/YYYY", CultureInfo CI = null)
{
if (CI == null)
{
CI = CultureInfo.CurrentCulture;
}
return formatedDateToTimeStamp(DateTime.ParseExact(date, format, CI));
}
public static Int32 formatedDateToTimeStamp(string date, string format = "dd/mm/YYYY", CultureInfo CI = null)
{
if (CI == null)
{
CI = CultureInfo.CurrentCulture;
}
return formatedDateToTimeStamp(DateTime.ParseExact(date, format, CI));
}
public static Int32 formatedDateToTimeStamp(DateTime date)
{
return (Int32)(date.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
}
}
public static Int32 formatedDateToTimeStamp(DateTime date)
{
return (Int32)(date.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
}
}
}
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 ();
FFImageLoading.Forms.Platform.CachedImageRenderer.Init(); // Initializing FFImageLoading
AnimationViewRenderer.Init(); // Initializing Lottie
// 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();
// Initializing FFImageLoading
FFImageLoading.Forms.Platform.CachedImageRenderer.Init();
// Initializing Lottie
AnimationViewRenderer.Init();
//Initializing GrialKit
GrialKit.Init(new ThemeColors(), "inutralia.GrialLicense");
UIApplication.SharedApplication.SetStatusBarHidden(true, true);
var tint = UIColor.White;
UIButton.AppearanceWhenContainedIn( typeof(UINavigationBar) ).TintColor = tint;
UIButton.AppearanceWhenContainedIn(typeof(UINavigationBar)).TintColor = tint;
app.SetStatusBarStyle(UIStatusBarStyle.LightContent, true);
//UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes{TextColor = UIColor.White});
UINavigationBar.Appearance.TintColor = UIColor.White;
FormsHelper.ForceLoadingAssemblyContainingType(typeof(UXDivers.Effects.Effects));
FormsHelper.ForceLoadingAssemblyContainingType<UXDivers.Effects.iOS.CircleEffect>();
LoadApplication(new App());
// 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);
}
}
return base.FinishedLaunching(app, options);
}
}
}
\ No newline at end of file
......@@ -2,14 +2,14 @@ using UIKit;
namespace inutralia
{
public class Application
{
// This is the main entry point of the application.
static void Main (string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main (args, null, "AppDelegate");
}
}
public class Application
{
// This is the main entry point of the application.
static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, "AppDelegate");
}
}
}
......@@ -197,10 +197,6 @@
</Reference>
<Reference Include="Xamarin.iOS" />
<Reference Include="System.Xml.Linq" />
<Reference Include="SkiaSharp">
<HintPath>..\packages\SkiaSharp.1.56.1\lib\XamariniOS\SkiaSharp.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Contents.json">
......@@ -372,9 +368,6 @@
<BundleResource Include="Resources\icon_info.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="icon_filter.png" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\icon_filter.png" />
</ItemGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
......
......@@ -5,11 +5,10 @@ namespace inutralia.API
class Constants
{
public static readonly string ApiUrlTemplate =
Device.OnPlatform ("http://i20.inutralia.com/api/v1/{0}?api-key=7745289b-f09c-4e0b-89d1-bb59c599c85e",
Device.OnPlatform("http://i20.inutralia.com/api/v1/{0}?api-key=7745289b-f09c-4e0b-89d1-bb59c599c85e",
"http://i20.inutralia.com/api/v1/{0}?api-key=7745289b-f09c-4e0b-89d1-bb59c599c85e",
"http://i20.inutralia.com/api/v1/{0}?api-key=7745289b-f09c-4e0b-89d1-bb59c599c85e");
// Url redirect a DEL SUPER
public const string ApiUrl = "https://delsuper.es/inutralia?ids=";
......
......@@ -11,25 +11,25 @@ namespace inutralia.API
/// </summary>
public interface IWebService : IDataPersistenceService
{
/// <summary>
/// Borra la información relativa a las credenciales
/// </summary>
void Reset();
/// <summary>
/// Borra la información relativa a las credenciales
/// </summary>
void Reset();
/// <summary>
/// <summary>
/// Establece las credenciales de acceso a la API
/// </summary>
/// <param name="username">Nombre del usuario accediendo a la API</param>
/// <param name="password">Contraseña del usuario</param>
void CredentialsSet (string username, string password);
void CredentialsSet(string username, string password);
/// <summary>
/// Registra un usuario en el servidor
/// </summary>
/// <param name="userName">Nombre del usuario solicitando registro</param>
/// <param name="passWord">Contraseña del usuario solicitando registro</param>
/// <param name="companyCode">Código de la compañía que solicita el registro</param>
Task<HttpStatusCode?> RegisterUser(string userName, string passWord, string companyCode);
/// <summary>
/// Registra un usuario en el servidor
/// </summary>
/// <param name="userName">Nombre del usuario solicitando registro</param>
/// <param name="passWord">Contraseña del usuario solicitando registro</param>
/// <param name="companyCode">Código de la compañía que solicita el registro</param>
Task<HttpStatusCode?> RegisterUser(string userName, string passWord, string companyCode);
/// <summary>
/// Cambia la contraseña del usuario actual
......@@ -38,50 +38,50 @@ namespace inutralia.API
/// <param name="newPass">Nueva contraseña</param>
Task<bool> PasswordChange(string currPass, string newPass);
/// <summary>
/// Obtiene de forma asíncrona una lista de elementos de cierto tipo
/// </summary>
/// <typeparam name="T">Tipo de datos de cada elemento</typeparam>
/// <param name="path">Path de acceso al recurso de la API</param>
/// <returns>Lista de elementos obtenidos</returns>
Task<List<T>> RefreshListAsync<T>(string path);
/// <summary>
/// Obtiene de forma asíncrona una lista de elementos de cierto tipo
/// </summary>
/// <typeparam name="T">Tipo de datos de cada elemento</typeparam>
/// <param name="path">Path de acceso al recurso de la API</param>
/// <returns>Lista de elementos obtenidos</returns>
Task<List<T>> RefreshListAsync<T>(string path);
/// <summary>
/// Petición directa al WebService
/// </summary>
/// <param name="method">Método HTTP de la petición</param>
/// <param name="resourcePath">Path del recurso REST al cual acceder</param>
/// <param name="data">Objeto a serializar en la petición</param>
/// <returns>Respuesta del servidor</returns>
Task<HttpResponseMessage> RawMessage(HttpMethod method, string resourcePath, object data = null);
/// <summary>
/// Petición directa al WebService
/// </summary>
/// <param name="method">Método HTTP de la petición</param>
/// <param name="resourcePath">Path del recurso REST al cual acceder</param>
/// <param name="data">Objeto a serializar en la petición</param>
/// <returns>Respuesta del servidor</returns>
Task<HttpResponseMessage> RawMessage(HttpMethod method, string resourcePath, object data = null);
/// <summary>
/// Petición directa al WebService (GET)
/// </summary>
/// <param name="resourcePath">Path del recurso REST al cual acceder</param>
/// <param name="data">Objeto a serializar en la petición</param>
/// <returns>Respuesta del servidor</returns>
Task<HttpResponseMessage> RawMessage(string resourcePath, object data = null);
/// <summary>
/// Petición directa al WebService (GET)
/// </summary>
/// <param name="resourcePath">Path del recurso REST al cual acceder</param>
/// <param name="data">Objeto a serializar en la petición</param>
/// <returns>Respuesta del servidor</returns>
Task<HttpResponseMessage> RawMessage(string resourcePath, object data = null);
/// <summary>
/// Procesa la respuesta de una petición directa
/// </summary>
/// <typeparam name="T">Tipo de datos en el que convertir los datos de respuesta</typeparam>
/// <param name="response">Respuesta devuelta por RawMessage</param>
/// <param name="data">Objeto a poblar con los datos de respuesta. Se creará un nuevo objeto si este parámetro es null</param>
/// <returns>El objeto poblado / creado. Si el status de la petición no es 2XX se devuelve null</returns>
Task<T> ResponseProcess<T>(HttpResponseMessage response, T data = null) where T : class;
/// <summary>
/// Procesa la respuesta de una petición directa
/// </summary>
/// <typeparam name="T">Tipo de datos en el que convertir los datos de respuesta</typeparam>
/// <param name="response">Respuesta devuelta por RawMessage</param>
/// <param name="data">Objeto a poblar con los datos de respuesta. Se creará un nuevo objeto si este parámetro es null</param>
/// <returns>El objeto poblado / creado. Si el status de la petición no es 2XX se devuelve null</returns>
Task<T> ResponseProcess<T>(HttpResponseMessage response, T data = null) where T : class;
/// <summary>
/// Realiza un petición directa y procesa su respuesta
/// </summary>
/// <typeparam name="T">Tipo de datos en el que convertir los datos de respuesta</typeparam>
/// <param name="method">Método HTTP de la petición</param>
/// <param name="resourcePath">Path del recurso REST al cual acceder</param>
/// <param name="input">Objeto a serializar en la petición</param>
/// <param name="output">Objeto a poblar con los datos de respuesta. Se creará un nuevo objeto si este parámetro es null</param>
/// <returns>El objeto poblado / creado. Si el status de la petición no es 2XX se devuelve null</returns>
Task<T> RawMessage<T>(HttpMethod method, string resourcePath, object input = null, T output = null) where T : class;
/// <summary>
/// Realiza un petición directa y procesa su respuesta
/// </summary>
/// <typeparam name="T">Tipo de datos en el que convertir los datos de respuesta</typeparam>
/// <param name="method">Método HTTP de la petición</param>
/// <param name="resourcePath">Path del recurso REST al cual acceder</param>
/// <param name="input">Objeto a serializar en la petición</param>
/// <param name="output">Objeto a poblar con los datos de respuesta. Se creará un nuevo objeto si este parámetro es null</param>
/// <returns>El objeto poblado / creado. Si el status de la petición no es 2XX se devuelve null</returns>
Task<T> RawMessage<T>(HttpMethod method, string resourcePath, object input = null, T output = null) where T : class;
}
}
......@@ -5,9 +5,7 @@ using Plugin.Settings;
using Plugin.Settings.Abstractions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace inutralia.API
......@@ -22,96 +20,96 @@ namespace inutralia.API
#pragma warning disable CS1998 // Sabemos que no vamos a poner await en los métodos async, por lo que deshabilitamos el warning
public async Task<bool> DeleteItemAsync<T> (T item) where T : IIdentifiableEntity
public async Task<bool> DeleteItemAsync<T>(T item) where T : IIdentifiableEntity
{
Type type = item.GetType ();
string path = GetItemPath (item);
if(AppSettings.Contains(path))
Type type = item.GetType();
string path = GetItemPath(item);
if (AppSettings.Contains(path))
{
// Eliminar elemento
AppSettings.Remove (path);
AppSettings.Remove(path);
// Eliminar de la lista de elementos
var list = GetIdList (type);
list.Remove (item.Id);
SetIdList (type, list);
var list = GetIdList(type);
list.Remove(item.Id);
SetIdList(type, list);
} //endif
return true;
}
public async Task<T> GetItemAsync<T> (int id) where T : IIdentifiableEntity
public async Task<T> GetItemAsync<T>(int id) where T : IIdentifiableEntity
{
string path = string.Format ("Models/{0}/{1}", GetDataPath (typeof (T)), id);
if(AppSettings.Contains(path))
string path = string.Format("Models/{0}/{1}", GetDataPath(typeof(T)), id);
if (AppSettings.Contains(path))
{
var content = AppSettings.GetValueOrDefault<string> (path);
return JsonConvert.DeserializeObject<T> (content);
var content = AppSettings.GetValueOrDefault<string>(path);
return JsonConvert.DeserializeObject<T>(content);
} //endif
return default (T);
return default(T);
}
public async Task<bool> RefreshItemAsync<T> (T item) where T : IIdentifiableEntity
public async Task<bool> RefreshItemAsync<T>(T item) where T : IIdentifiableEntity
{
string path = GetItemPath (item);
if(AppSettings.Contains(path))
string path = GetItemPath(item);
if (AppSettings.Contains(path))
{
var content = AppSettings.GetValueOrDefault<string> (path);
JsonConvert.PopulateObject (content, item);
var content = AppSettings.GetValueOrDefault<string>(path);
JsonConvert.PopulateObject(content, item);
return true;
} //endif
return false;
}
public async Task<List<T>> RefreshListAsync<T> () where T : IIdentifiableEntity
public async Task<List<T>> RefreshListAsync<T>() where T : IIdentifiableEntity
{
Type type = typeof (T);
string basePath = GetDataPath (type);
List<int> idList = GetIdList (type);
List<T> retVal = new List<T> ();
List<int> idsToRemove = new List<int> ();
Type type = typeof(T);
string basePath = GetDataPath(type);
List<int> idList = GetIdList(type);
List<T> retVal = new List<T>();
List<int> idsToRemove = new List<int>();
foreach(int id in idList)
foreach (int id in idList)
{
string path = string.Format ("Models/{0}/{1}", basePath, id);
if (AppSettings.Contains (path))
string path = string.Format("Models/{0}/{1}", basePath, id);
if (AppSettings.Contains(path))
{
var content = AppSettings.GetValueOrDefault<string> (path);
retVal.Add (JsonConvert.DeserializeObject<T> (content));
var content = AppSettings.GetValueOrDefault<string>(path);
retVal.Add(JsonConvert.DeserializeObject<T>(content));
}
else
{
idsToRemove.Add (id);
idsToRemove.Add(id);
} //endif
} //endforeach
if(idsToRemove.Count > 0)
if (idsToRemove.Count > 0)
{
// Borrar de la lista inicial los que haya que elilminar, y guardar la lista
idList.RemoveAll ((i) => { return idsToRemove.Contains (i); });
SetIdList (type, idList);
idList.RemoveAll((i) => { return idsToRemove.Contains(i); });
SetIdList(type, idList);
} //endif
return retVal;
}
public async Task<int?> UpdateItemAsync<T> (T item, bool isNew = false) where T : IIdentifiableEntity
public async Task<int?> UpdateItemAsync<T>(T item, bool isNew = false) where T : IIdentifiableEntity
{
if(isNew)
if (isNew)
{
// Elemento nuevo: asignarle Id. Cogemos la lista de ids ...
List<int> idList = GetIdList (item.GetType ());
List<int> idList = GetIdList(item.GetType());
// ... buscamos el máximo y le sumamos 1
//item.Id = (idList.Count < 1) ? 1 : idList.Max () + 1;
// ... añadimos el nuevo id a la lista
idList.Add (item.Id);
idList.Add(item.Id);
// ... y la guardamos
SetIdList (item.GetType (), idList);
SetIdList(item.GetType(), idList);
}
else if (!AppSettings.Contains(GetItemPath(item)))
{
......@@ -120,7 +118,7 @@ namespace inutralia.API
} //endif
// Guardar elemento
AppSettings.AddOrUpdateValue (GetItemPath (item), JsonConvert.SerializeObject (item));
AppSettings.AddOrUpdateValue(GetItemPath(item), JsonConvert.SerializeObject(item));
// Retornar su id
return item.Id;
......@@ -128,38 +126,38 @@ namespace inutralia.API
#pragma warning restore CS1998 // Sabemos que no vamos a poner await en los métodos async, por lo que deshabilitamos el warning
private static List<int> GetIdList (Type t, List<int> listToFill = null)
private static List<int> GetIdList(Type t, List<int> listToFill = null)
{
// Crear lista si no nos pasan ninguna. Vaciarla.
List<int> retVal = listToFill ?? new List<int> ();
retVal.Clear ();
List<int> retVal = listToFill ?? new List<int>();
retVal.Clear();
// Leer lista de ids (sólo si existe)
string path = string.Format ("ModelIdList/{0}", GetDataPath (t));
if (AppSettings.Contains (path))
string path = string.Format("ModelIdList/{0}", GetDataPath(t));
if (AppSettings.Contains(path))
{
// Deserializar valor json
string value = AppSettings.GetValueOrDefault<string> (path);
JsonConvert.PopulateObject (value, retVal);
string value = AppSettings.GetValueOrDefault<string>(path);
JsonConvert.PopulateObject(value, retVal);
} //endif
return retVal;
}
private static void SetIdList (Type t, List<int> idList)
private static void SetIdList(Type t, List<int> idList)
{
string path = string.Format ("ModelIdList/{0}", GetDataPath (t));
string path = string.Format("ModelIdList/{0}", GetDataPath(t));
if ((idList == null) || (idList.Count < 1))
{
// Si la lista está vacía, borrar la entrada de settings
AppSettings.Remove (path);
AppSettings.Remove(path);
}
else
{
// Serializar con JSON y guardar
string value = JsonConvert.SerializeObject (idList);
AppSettings.AddOrUpdateValue (path, value);
string value = JsonConvert.SerializeObject(idList);
AppSettings.AddOrUpdateValue(path, value);
} //endif
}
......@@ -168,15 +166,15 @@ namespace inutralia.API
/// </summary>
/// <param name="t">Tipo de dato de la entidad</typeparam>
/// <returns>El path correspondiente dentro del API</returns>
private static string GetDataPath (Type t)
private static string GetDataPath(Type t)
{
// Si tiene el atributo DataPath, lo utilizamos
DataPathAttribute attr = t.GetTypeInfo ().GetCustomAttribute<DataPathAttribute> ();
DataPathAttribute attr = t.GetTypeInfo().GetCustomAttribute<DataPathAttribute>();
if (attr != null)
return attr.DataPath;
// En caso contrario devolvemos el nombre de la clase en minúsculas y en plural
return t.Name.ToLowerInvariant () + "s";
return t.Name.ToLowerInvariant() + "s";
}
/// <summary>
......@@ -185,11 +183,9 @@ namespace inutralia.API
/// <typeparam name="T"></typeparam>
/// <param name="item"></param>
/// <returns></returns>
private static string GetItemPath<T> (T item) where T: IIdentifiableEntity
private static string GetItemPath<T>(T item) where T : IIdentifiableEntity
{
return string.Format ("Models/{0}/{1}", GetDataPath (item.GetType ()), item.Id);
return string.Format("Models/{0}/{1}", GetDataPath(item.GetType()), item.Id);
}
}
}
......@@ -9,103 +9,102 @@ using System.Net.Http.Headers;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace inutralia.API
{
/// <summary>
/// Interfaz con el WebService de peticiones de la API de iNutralia
/// </summary>
public class WebService : IWebService
{
/// <summary>
/// Procesa las peticiones
/// </summary>
private HttpClient _client;
/// <summary>
/// Nombre del usuario actual
/// </summary>
private string _username;
private JsonSerializerSettings _serializerSettings = new JsonSerializerSettings { ObjectCreationHandling = ObjectCreationHandling.Replace, NullValueHandling = NullValueHandling.Ignore };
public WebService()
{
Reset();
}
#region IDataPersistenceService
/// <summary>
/// Recupera de forma asíncrona los datos de una entidad a partir de su
/// identificador
/// </summary>
/// <typeparam name="T">Tipo de dato de cada entidad</typeparam>
/// <param name="id">Identificador de la entidad</param>
/// <returns>Instancia de T correspondiente al identificador</returns>
public async Task<T> GetItemAsync<T>(int id) where T : IIdentifiableEntity
{
// Preparar el path de acceso al elemento
string fullPath = string.Format("{0}/{1}", GetDataPath<T>(), id);
// Crear uri a partir de la URL base y el path
var uri = new Uri(string.Format(Constants.ApiUrlTemplate, fullPath));
/// <summary>
/// Interfaz con el WebService de peticiones de la API de iNutralia
/// </summary>
public class WebService : IWebService
{
/// <summary>
/// Procesa las peticiones
/// </summary>
private HttpClient _client;
/// <summary>
/// Nombre del usuario actual
/// </summary>
private string _username;
private JsonSerializerSettings _serializerSettings = new JsonSerializerSettings { ObjectCreationHandling = ObjectCreationHandling.Replace, NullValueHandling = NullValueHandling.Ignore };
public WebService()
{
Reset();
}
#region IDataPersistenceService
/// <summary>
/// Recupera de forma asíncrona los datos de una entidad a partir de su
/// identificador
/// </summary>
/// <typeparam name="T">Tipo de dato de cada entidad</typeparam>
/// <param name="id">Identificador de la entidad</param>
/// <returns>Instancia de T correspondiente al identificador</returns>
public async Task<T> GetItemAsync<T>(int id) where T : IIdentifiableEntity
{
// Preparar el path de acceso al elemento
string fullPath = string.Format("{0}/{1}", GetDataPath<T>(), id);
// Crear uri a partir de la URL base y el path
var uri = new Uri(string.Format(Constants.ApiUrlTemplate, fullPath));
try
{
// Hacer la petición
var response = await _client.GetAsync (uri);
var response = await _client.GetAsync(uri);
if (response.IsSuccessStatusCode)
{
// Si es correcta, traer los datos y deserializarlos
var content = await response.Content.ReadAsStringAsync ();
return JsonConvert.DeserializeObject<T> (content);
var content = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<T>(content);
} //endif
}
catch(Exception)
catch (Exception)
{ }
// En caso contrario retornar error
return default(T);
}
/// <summary>
/// Obtiene de forma asíncrona una lista de elementos de cierto tipo
/// </summary>
/// <typeparam name="T">Tipo de datos de cada elemento</typeparam>
/// <returns>Lista de elementos obtenidos</returns>
public async Task<List<T>> RefreshListAsync<T>() where T : IIdentifiableEntity
{
// Crear uri a partir de la URL base y el path
return await RefreshListAsync<T>(GetDataPath<T>());
}
/// <summary>
/// Recupera de forma asíncrona los datos de una entidad
/// </summary>
/// <typeparam name="T">Tipo de dato de la entidad</typeparam>
/// <param name="item">La entidad a actualizar</param>
/// <returns>La entidad actualizada</returns>
public async Task<bool> RefreshItemAsync<T>(T item) where T : IIdentifiableEntity
{
// Preparar el path de acceso al elemento
string fullPath = string.Format("{0}/{1}", GetDataPath(item.GetType() ), item.Id);
// Crear uri a partir de la URL base y el path
var uri = new Uri(string.Format(Constants.ApiUrlTemplate, fullPath));
// En caso contrario retornar error
return default(T);
}
/// <summary>
/// Obtiene de forma asíncrona una lista de elementos de cierto tipo
/// </summary>
/// <typeparam name="T">Tipo de datos de cada elemento</typeparam>
/// <returns>Lista de elementos obtenidos</returns>
public async Task<List<T>> RefreshListAsync<T>() where T : IIdentifiableEntity
{
// Crear uri a partir de la URL base y el path
return await RefreshListAsync<T>(GetDataPath<T>());
}
/// <summary>
/// Recupera de forma asíncrona los datos de una entidad
/// </summary>
/// <typeparam name="T">Tipo de dato de la entidad</typeparam>
/// <param name="item">La entidad a actualizar</param>
/// <returns>La entidad actualizada</returns>
public async Task<bool> RefreshItemAsync<T>(T item) where T : IIdentifiableEntity
{
// Preparar el path de acceso al elemento
string fullPath = string.Format("{0}/{1}", GetDataPath(item.GetType()), item.Id);
// Crear uri a partir de la URL base y el path
var uri = new Uri(string.Format(Constants.ApiUrlTemplate, fullPath));
try
{
// Hacer la petición
var response = await _client.GetAsync (uri);
var response = await _client.GetAsync(uri);
if (response.IsSuccessStatusCode)
{
// Si es correcta, traer los datos y deserializarlos
var responseContent = await response.Content.ReadAsStringAsync ();
var responseContent = await response.Content.ReadAsStringAsync();
try
{
JsonConvert.PopulateObject (responseContent, item, _serializerSettings);
JsonConvert.PopulateObject(responseContent, item, _serializerSettings);
}
catch (Exception e)
{
......@@ -115,88 +114,87 @@ namespace inutralia.API
return true;
} //endif
}
catch(Exception)
catch (Exception)
{ }
// En caso contrario retornar error
return false;
}
/// <summary>
/// Actualiza de forma asíncrona los datos de una entidad
/// </summary>
/// <typeparam name="T">Tipo de datos de cada entidad</typeparam>
/// <param name="dataPath">El path dentro del API</param>
/// <param name="item">Los datos de la entidad a actualizar</param>
/// <param name="isNew">Indica si hay que crear una entidad nueva o modificar una existente</param>
/// <returns>El ID de la entidad. Null en caso de error</returns>
public async Task<int?> UpdateItemAsync<T>(T item, bool isNew = false) where T : IIdentifiableEntity
{
// Preparar el path de acceso al elemento
string dataPath = GetDataPath(item.GetType());
string fullPath = isNew ? dataPath : string.Format("{0}/{1}", dataPath, item.Id);
// Crear uri a partir de la URL base y el path
var uri = new Uri(string.Format(Constants.ApiUrlTemplate, fullPath));
try
{
// En caso contrario retornar error
return false;
}
/// <summary>
/// Actualiza de forma asíncrona los datos de una entidad
/// </summary>
/// <typeparam name="T">Tipo de datos de cada entidad</typeparam>
/// <param name="dataPath">El path dentro del API</param>
/// <param name="item">Los datos de la entidad a actualizar</param>
/// <param name="isNew">Indica si hay que crear una entidad nueva o modificar una existente</param>
/// <returns>El ID de la entidad. Null en caso de error</returns>
public async Task<int?> UpdateItemAsync<T>(T item, bool isNew = false) where T : IIdentifiableEntity
{
// Preparar el path de acceso al elemento
string dataPath = GetDataPath(item.GetType());
string fullPath = isNew ? dataPath : string.Format("{0}/{1}", dataPath, item.Id);
// Crear uri a partir de la URL base y el path
var uri = new Uri(string.Format(Constants.ApiUrlTemplate, fullPath));
try
{
// Serializar el objeto
var json = JsonConvert.SerializeObject(item);
var content = new StringContent(json, Encoding.UTF8, "application/json");
if (isNew)
{
// Utilizamos POST cuando el objeto es nuevo
var response = await _client.PostAsync(uri, content);
// Si todo fue bien, recibimos el objeto de vuelta (con el id con el que fue creado)
if (response.IsSuccessStatusCode)
{
var responseContent = await response.Content.ReadAsStringAsync();
JsonConvert.PopulateObject(responseContent, item, _serializerSettings);
return item.Id;
} //endif
}
else
{
// Utilizamos PUT cuando el objeto no es nuevo
var response = await _client.PutAsync(uri, content);
// Si todo fue bien, el servidor suele responder con 204 No Content
if (response.IsSuccessStatusCode)
return item.Id;
} //endif
var json = JsonConvert.SerializeObject(item);
var content = new StringContent(json, Encoding.UTF8, "application/json");
if (isNew)
{
// Utilizamos POST cuando el objeto es nuevo
var response = await _client.PostAsync(uri, content);
// Si todo fue bien, recibimos el objeto de vuelta (con el id con el que fue creado)
if (response.IsSuccessStatusCode)
{
var responseContent = await response.Content.ReadAsStringAsync();
JsonConvert.PopulateObject(responseContent, item, _serializerSettings);
return item.Id;
} //endif
}
else
{
// Utilizamos PUT cuando el objeto no es nuevo
var response = await _client.PutAsync(uri, content);
// Si todo fue bien, el servidor suele responder con 204 No Content
if (response.IsSuccessStatusCode)
return item.Id;
} //endif
}
catch (Exception)
{ }
// Si llegamos aquí, es que la petición devolvió error
return null;
}
/// <summary>
/// Elimina de forma asíncrona una entidad
/// </summary>
/// <typeparam name="T">Tipo de dato de la entidad</typeparam>
/// <param name="item">La entidad a eliminar</param>
/// <returns>Si la operación se realizó correctamente</returns>
public async Task<bool> DeleteItemAsync<T>(T item) where T : IIdentifiableEntity
{
// Preparar el path de acceso al elemento
string fullPath = string.Format("{0}/{1}", GetDataPath(item.GetType()), item.Id);
// Crear uri a partir de la URL base y el path
var uri = new Uri(string.Format(Constants.ApiUrlTemplate, fullPath));
}
/// <summary>
/// Elimina de forma asíncrona una entidad
/// </summary>
/// <typeparam name="T">Tipo de dato de la entidad</typeparam>
/// <param name="item">La entidad a eliminar</param>
/// <returns>Si la operación se realizó correctamente</returns>
public async Task<bool> DeleteItemAsync<T>(T item) where T : IIdentifiableEntity
{
// Preparar el path de acceso al elemento
string fullPath = string.Format("{0}/{1}", GetDataPath(item.GetType()), item.Id);
// Crear uri a partir de la URL base y el path
var uri = new Uri(string.Format(Constants.ApiUrlTemplate, fullPath));
try
{
// Hacer la petición
var response = await _client.DeleteAsync(uri);
{
// Hacer la petición
var response = await _client.DeleteAsync(uri);
// Indicar si todo fue correcto
return response.IsSuccessStatusCode;
// Indicar si todo fue correcto
return response.IsSuccessStatusCode;
}
catch (Exception)
{ }
......@@ -212,163 +210,163 @@ namespace inutralia.API
/// Borra la información relativa a las credenciales
/// </summary>
public void Reset()
{
_client = new HttpClient();
_username = string.Empty;
}
/// <summary>
/// Establece las credenciales de acceso a la API
/// </summary>
/// <param name="username">Nombre del usuario accediendo a la API</param>
/// <param name="password">Contraseña del usuario</param>
public void CredentialsSet(string username, string password)
{
// Nos guardamos el nombre del usuario
_username = username;
// Creamos el string de autenticación (base64(user:pass) )
var authData = string.Format("{0}:{1}", username, password);
var authHeaderValue = Convert.ToBase64String(Encoding.UTF8.GetBytes(authData));
// Lo establecemos como cabecera por defecto para todas las peticiones que hagamos a partir de ahora
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeaderValue);
}
/// <summary>
/// Cambia la contraseña del usuario actual
/// </summary>
/// <param name="currPass">Contraseña actual (para verificación)</param>
/// <param name="newPass">Nueva contraseña</param>
public async Task<bool> PasswordChange(string currPass, string newPass)
{
// Creamos el string de cambio de autenticación
var newAuth = string.Format("{0}:{1}:{2}", _username, currPass, newPass);
var param = Convert.ToBase64String(Encoding.UTF8.GetBytes(newAuth));
// Crear uri a partir de la URL base y el path
var path = string.Format("password/{0}", param);
var uri = new Uri(string.Format(Constants.ApiUrlTemplate, path));
{
_client = new HttpClient();
_username = string.Empty;
}
/// <summary>
/// Establece las credenciales de acceso a la API
/// </summary>
/// <param name="username">Nombre del usuario accediendo a la API</param>
/// <param name="password">Contraseña del usuario</param>
public void CredentialsSet(string username, string password)
{
// Nos guardamos el nombre del usuario
_username = username;
// Creamos el string de autenticación (base64(user:pass) )
var authData = string.Format("{0}:{1}", username, password);
var authHeaderValue = Convert.ToBase64String(Encoding.UTF8.GetBytes(authData));
// Lo establecemos como cabecera por defecto para todas las peticiones que hagamos a partir de ahora
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authHeaderValue);
}
/// <summary>
/// Cambia la contraseña del usuario actual
/// </summary>
/// <param name="currPass">Contraseña actual (para verificación)</param>
/// <param name="newPass">Nueva contraseña</param>
public async Task<bool> PasswordChange(string currPass, string newPass)
{
// Creamos el string de cambio de autenticación
var newAuth = string.Format("{0}:{1}:{2}", _username, currPass, newPass);
var param = Convert.ToBase64String(Encoding.UTF8.GetBytes(newAuth));
// Crear uri a partir de la URL base y el path
var path = string.Format("password/{0}", param);
var uri = new Uri(string.Format(Constants.ApiUrlTemplate, path));
bool retVal = false;
try
{
// Realizamos la petición de cambio
var response = await _client.GetAsync(uri);
{
// Realizamos la petición de cambio
var response = await _client.GetAsync(uri);
// Miramos si es correcta
retVal = response.IsSuccessStatusCode;
// Miramos si es correcta
retVal = response.IsSuccessStatusCode;
// Si es correcta actualizamos las credenciales
if (retVal)
CredentialsSet(_username, newPass);
// Si es correcta actualizamos las credenciales
if (retVal)
CredentialsSet(_username, newPass);
}
catch (Exception)
{ }
return retVal;
}
/// <summary>
/// Petición directa al WebService (GET)
/// </summary>
/// <param name="resourcePath">Path del recurso REST al cual acceder</param>
/// <param name="data">Objeto a serializar en la petición</param>
/// <returns>Respuesta del servidor</returns>
public async Task<HttpResponseMessage> RawMessage(string resourcePath, object data = null)
{
return await this.RawMessage(HttpMethod.Get, resourcePath, data);
}
/// <summary>
/// Petición directa al WebService
/// </summary>
/// <param name="method">Método HTTP de la petición</param>
/// <param name="resourcePath">Path del recurso REST al cual acceder</param>
/// <param name="data">Objeto a serializar en la petición</param>
/// <returns>Respuesta del servidor</returns>
public async Task<HttpResponseMessage> RawMessage(HttpMethod method, string resourcePath, object data = null)
{
string fullPath = string.Format(Constants.ApiUrlTemplate, resourcePath);
var req = new HttpRequestMessage(method, fullPath);
if (data != null)
{
// Serializar el objeto
var json = JsonConvert.SerializeObject(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
req.Content = content;
} //endif
return await _client.SendAsync(req);
}
/// <summary>
/// Procesa la respuesta de una petición directa
/// </summary>
/// <typeparam name="T">Tipo de datos en el que convertir los datos de respuesta</typeparam>
/// <param name="response">Respuesta devuelta por RawMessage</param>
/// <param name="data">Objeto a poblar con los datos de respuesta. Se creará un nuevo objeto si este parámetro es null</param>
/// <returns>El objeto poblado / creado. Si el status de la petición no es 2XX se devuelve null</returns>
public async Task<T> ResponseProcess<T>(HttpResponseMessage response, T data = null) where T : class
{
if (response.IsSuccessStatusCode)
{
var content = await response.Content.ReadAsStringAsync();
if (data == null)
return JsonConvert.DeserializeObject<T>(content);
JsonConvert.PopulateObject(content, data, _serializerSettings);
return data;
} //endif
return null;
}
/// <summary>
/// Realiza un petición directa y procesa su respuesta
/// </summary>
/// <typeparam name="T">Tipo de datos en el que convertir los datos de respuesta</typeparam>
/// <param name="method">Método HTTP de la petición</param>
/// <param name="resourcePath">Path del recurso REST al cual acceder</param>
/// <param name="input">Objeto a serializar en la petición</param>
/// <param name="output">Objeto a poblar con los datos de respuesta. Se creará un nuevo objeto si este parámetro es null</param>
/// <returns>El objeto poblado / creado. Si el status de la petición no es 2XX se devuelve null</returns>
public async Task<T> RawMessage<T>(HttpMethod method, string resourcePath, object input = null, T output = null) where T : class
{
return await ResponseProcess(await RawMessage(method, resourcePath, input), output);
}
/// <summary>
/// Obtiene de forma asíncrona una lista de elementos de cierto tipo
/// </summary>
/// <typeparam name="T">Tipo de datos de cada elemento</typeparam>
/// <param name="path">Path de acceso al recurso de la API</param>
/// <returns>Lista de elementos obtenidos</returns>
public async Task<List<T>> RefreshListAsync<T>(string path)
{
// Hacer la petición
var response = await _client.GetAsync(string.Format(Constants.ApiUrlTemplate, path));
if (response.IsSuccessStatusCode)
{
// Si es correcta, traer los datos y deserializarlos
var content = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<List<T>>(content);
} //endif
// La respuesta no es correcta, distinguir código de error
switch (response.StatusCode)
{
// El usuario y contraseña son incorrectos
case HttpStatusCode.Unauthorized:
throw new UnauthorizedAccessException();
// Cualquier otro
default:
throw new Exception(response.ReasonPhrase);
} //endswitch
}
}
/// <summary>
/// Petición directa al WebService (GET)
/// </summary>
/// <param name="resourcePath">Path del recurso REST al cual acceder</param>
/// <param name="data">Objeto a serializar en la petición</param>
/// <returns>Respuesta del servidor</returns>
public async Task<HttpResponseMessage> RawMessage(string resourcePath, object data = null)
{
return await this.RawMessage(HttpMethod.Get, resourcePath, data);
}
/// <summary>
/// Petición directa al WebService
/// </summary>
/// <param name="method">Método HTTP de la petición</param>
/// <param name="resourcePath">Path del recurso REST al cual acceder</param>
/// <param name="data">Objeto a serializar en la petición</param>
/// <returns>Respuesta del servidor</returns>
public async Task<HttpResponseMessage> RawMessage(HttpMethod method, string resourcePath, object data = null)
{
string fullPath = string.Format(Constants.ApiUrlTemplate, resourcePath);
var req = new HttpRequestMessage(method, fullPath);
if (data != null)
{
// Serializar el objeto
var json = JsonConvert.SerializeObject(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
req.Content = content;
} //endif
return await _client.SendAsync(req);
}
/// <summary>
/// Procesa la respuesta de una petición directa
/// </summary>
/// <typeparam name="T">Tipo de datos en el que convertir los datos de respuesta</typeparam>
/// <param name="response">Respuesta devuelta por RawMessage</param>
/// <param name="data">Objeto a poblar con los datos de respuesta. Se creará un nuevo objeto si este parámetro es null</param>
/// <returns>El objeto poblado / creado. Si el status de la petición no es 2XX se devuelve null</returns>
public async Task<T> ResponseProcess<T>(HttpResponseMessage response, T data = null) where T : class
{
if (response.IsSuccessStatusCode)
{
var content = await response.Content.ReadAsStringAsync();
if (data == null)
return JsonConvert.DeserializeObject<T>(content);
JsonConvert.PopulateObject(content, data, _serializerSettings);
return data;
} //endif
return null;
}
/// <summary>
/// Realiza un petición directa y procesa su respuesta
/// </summary>
/// <typeparam name="T">Tipo de datos en el que convertir los datos de respuesta</typeparam>
/// <param name="method">Método HTTP de la petición</param>
/// <param name="resourcePath">Path del recurso REST al cual acceder</param>
/// <param name="input">Objeto a serializar en la petición</param>
/// <param name="output">Objeto a poblar con los datos de respuesta. Se creará un nuevo objeto si este parámetro es null</param>
/// <returns>El objeto poblado / creado. Si el status de la petición no es 2XX se devuelve null</returns>
public async Task<T> RawMessage<T>(HttpMethod method, string resourcePath, object input = null, T output = null) where T : class
{
return await ResponseProcess(await RawMessage(method, resourcePath, input), output);
}
/// <summary>
/// Obtiene de forma asíncrona una lista de elementos de cierto tipo
/// </summary>
/// <typeparam name="T">Tipo de datos de cada elemento</typeparam>
/// <param name="path">Path de acceso al recurso de la API</param>
/// <returns>Lista de elementos obtenidos</returns>
public async Task<List<T>> RefreshListAsync<T>(string path)
{
// Hacer la petición
var response = await _client.GetAsync(string.Format(Constants.ApiUrlTemplate, path));
if (response.IsSuccessStatusCode)
{
// Si es correcta, traer los datos y deserializarlos
var content = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<List<T>>(content);
} //endif
// La respuesta no es correcta, distinguir código de error
switch (response.StatusCode)
{
// El usuario y contraseña son incorrectos
case HttpStatusCode.Unauthorized:
throw new UnauthorizedAccessException();
// Cualquier otro
default:
throw new Exception(response.ReasonPhrase);
} //endswitch
}
#endregion
......@@ -377,9 +375,9 @@ namespace inutralia.API
/// </summary>
/// <typeparam name="T">Tipo de dato de la entidad</typeparam>
/// <returns>El path correspondiente dentro del API</returns>
private static string GetDataPath<T> ()
private static string GetDataPath<T>()
{
return GetDataPath (typeof (T));
return GetDataPath(typeof(T));
}
/// <summary>
......@@ -388,30 +386,30 @@ namespace inutralia.API
/// <param name="t">Tipo de dato de la entidad</typeparam>
/// <returns>El path correspondiente dentro del API</returns>
private static string GetDataPath(Type t)
{
// Si tiene el atributo DataPath, lo utilizamos
DataPathAttribute attr = t.GetTypeInfo().GetCustomAttribute<DataPathAttribute>();
if (attr != null)
return attr.DataPath;
{
// Si tiene el atributo DataPath, lo utilizamos
DataPathAttribute attr = t.GetTypeInfo().GetCustomAttribute<DataPathAttribute>();
if (attr != null)
return attr.DataPath;
// En caso contrario devolvemos el nombre de la clase en minúsculas y en plural
return t.Name.ToLowerInvariant() + "s";
}
// En caso contrario devolvemos el nombre de la clase en minúsculas y en plural
return t.Name.ToLowerInvariant() + "s";
}
public async Task<HttpStatusCode?> RegisterUser(string userName, string passWord, string companyCode)
{
var dataChain = string.Format("{0}:{1}:{2}", userName, passWord, companyCode);
var param = Convert.ToBase64String(Encoding.UTF8.GetBytes(dataChain));
public async Task<HttpStatusCode?> RegisterUser(string userName, string passWord, string companyCode)
{
var dataChain = string.Format("{0}:{1}:{2}", userName, passWord, companyCode);
var param = Convert.ToBase64String(Encoding.UTF8.GetBytes(dataChain));
var path = string.Format("register/{0}", param);
var uri = new Uri(string.Format(Constants.ApiUrlTemplate, path));
var path = string.Format("register/{0}", param);
var uri = new Uri(string.Format(Constants.ApiUrlTemplate, path));
try
{
var response = await _client.GetAsync(uri);
{
var response = await _client.GetAsync(uri);
if (response.IsSuccessStatusCode)
return null;
if (response.IsSuccessStatusCode)
return null;
var content = await response.Content.ReadAsStringAsync();
var respuesta = JsonConvert.DeserializeObject<dataResponse>(content);
......@@ -427,9 +425,8 @@ namespace inutralia.API
}
public class dataResponse
{
public string error { get; set; }
}
}
{
public string error { get; set; }
}
}
}
......@@ -9,791 +9,771 @@
xmlns:effects="clr-namespace:UXDivers.Effects;assembly=UXDivers.Effects"
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms">
<Application.Resources>
<Application.Resources>
<!--<ResourceDictionary MergedWith="local:GrialLightTheme">-->
<!--<ResourceDictionary MergedWith="local:GrialDarkTheme">-->
<!--<ResourceDictionary MergedWith="local:GrialEnterpriseTheme">-->
<ResourceDictionary MergedWith="local:MyAppTheme">
<!--
<!--<ResourceDictionary MergedWith="local:GrialLightTheme">-->
<!--<ResourceDictionary MergedWith="local:GrialDarkTheme">-->
<!--<ResourceDictionary MergedWith="local:GrialEnterpriseTheme">-->
<ResourceDictionary MergedWith="local:MyAppTheme">
<!--
Use the following file as your theme colors.
Simply replace colors to march your brand.
(It is based on GrialLightTheme but you can use the colors
of any other theme)
-->
<!--<ResourceDictionary MergedWith="local:MyAppTheme">-->
<!-- UNITS -->
<x:Double x:Key="BaseFontSize">16</x:Double>
<x:Double x:Key="BaseButtonHeight">44</x:Double>
<x:Double x:Key="BaseButtonBorderRadius">22</x:Double>
<!--<ResourceDictionary MergedWith="local:MyAppTheme">-->
<!-- UNITS -->
<x:Double x:Key="BaseFontSize">16</x:Double>
<x:Double x:Key="BaseButtonHeight">44</x:Double>
<x:Double x:Key="BaseButtonBorderRadius">22</x:Double>
<x:Double x:Key="MainMenuLabelFontsize">18</x:Double>
<x:Double x:Key="MainMenuIconFontsize">20</x:Double>
<x:Double x:Key="MainMenuHeaderFontsize">18</x:Double>
<x:Double x:Key="MainMenuLabelTranslationX">10</x:Double>
<x:Double x:Key="MainMenuChevronRightFontsize">24</x:Double>
<x:Double x:Key="MainMenuIconWidthRequest">22</x:Double>
<x:Double x:Key="MainMenuLabelFontsize">18</x:Double>
<x:Double x:Key="MainMenuIconFontsize">20</x:Double>
<x:Double x:Key="MainMenuHeaderFontsize">18</x:Double>
<x:Double x:Key="MainMenuLabelTranslationX">10</x:Double>
<x:Double x:Key="MainMenuChevronRightFontsize">24</x:Double>
<x:Double x:Key="MainMenuIconWidthRequest">22</x:Double>
<x:String x:Key="LoginWelcomeText">Bienvenido a iNutralia</x:String>
<x:String x:Key="WebViewPageURL">http://www.grialkit.com</x:String>
<x:String x:Key="WebViewPageTitle">Grial UI Kit</x:String>
<x:String x:Key="GrialShapesFontFamily">grialshapes</x:String>
<!-- PUT YOUR OWN ICONS FONT FAMILY BELOW -->
<x:String x:Key="WebViewPageURL">http://www.grialkit.com</x:String>
<x:String x:Key="WebViewPageTitle">Grial UI Kit</x:String>
<x:String x:Key="GrialShapesFontFamily">grialshapes</x:String>
<!-- PUT YOUR OWN ICONS FONT FAMILY BELOW -->
<!--<x:String x:Key="IconsFontFamily">grialshapes</x:String>-->
<!--<x:String x:Key="IconsFontFamily">FontAwesome</x:String>-->
<x:String x:Key="IconsFontFamily">Ionicons</x:String>
<!-- STATIC IMAGES -->
<FileImageSource x:Key="HamburguerIcon">hamburguer_icon.png</FileImageSource>
<FileImageSource x:Key="WelcomeBackgroundImagePhone">welcome_bg.jpg</FileImageSource>
<FileImageSource x:Key="WelcomeBackgroundImageTablet">welcome_bg_tablet.jpg</FileImageSource>
<!--<FileImageSource x:Key="BrandImage">logo.png</FileImageSource>-->
<FileImageSource x:Key="BrandImage">logo_empresa.png</FileImageSource>
<FileImageSource x:Key="GenericBackgroundImage">generic_bg_image.jpg</FileImageSource>
<FileImageSource x:Key="SignUpBackgroundImagePhone">signup_bg.jpg</FileImageSource>
<FileImageSource x:Key="SignUpBackgroundImageTablet">signup_bg_tablet.jpg</FileImageSource>
<FileImageSource x:Key="LoginBackgroundImagePhone">login_bg.jpg</FileImageSource>
<FileImageSource x:Key="LoginBackgroundImageTablet">login_bg_tablet.jpg</FileImageSource>
<FileImageSource x:Key="PasswordRecoveryBackgroundImagePhone">pass_recovery_bg.jpg</FileImageSource>
<FileImageSource x:Key="PasswordRecoveryBackgroundImageTablet">pass_recovery_bg_tablet.jpg</FileImageSource>
<FileImageSource x:Key="WalkthroughStepGenericPhoneBackgroundImage">walkthrough_generic_phone_bg.png</FileImageSource>
<FileImageSource x:Key="ThemeAvatarSample0Image">user_profile_0.jpg</FileImageSource>
<FileImageSource x:Key="ThemeAvatarSample1Image">user_profile_1.jpg</FileImageSource>
<FileImageSource x:Key="SocialHeaderBackgroundImage0">social_header_bg_0.jpg</FileImageSource>
<FileImageSource x:Key="SocialHeaderBackgroundImage1">social_header_bg_1.jpg</FileImageSource>
<!-- RESPONSIVE COMMON -->
<OnIdiom x:Key="MainWrapperPadding" x:TypeArguments="Thickness">
<OnIdiom.Phone>0</OnIdiom.Phone>
<OnIdiom.Tablet>100,0,100,0</OnIdiom.Tablet>
</OnIdiom>
<!-- END RESPONSIVE COMMON -->
<!-- BEGINS RESPONSIVE HELPERS -->
<OnIdiom x:Key="TabletVisible" x:TypeArguments="x:Boolean">
<OnIdiom.Phone>false</OnIdiom.Phone>
<OnIdiom.Tablet>true</OnIdiom.Tablet>
</OnIdiom>
<OnIdiom x:Key="PhoneVisible" x:TypeArguments="x:Boolean">
<OnIdiom.Phone>true</OnIdiom.Phone>
<OnIdiom.Tablet>false</OnIdiom.Tablet>
</OnIdiom>
<OnPlatform x:Key="AndroidVisible" x:TypeArguments="x:Boolean">
<OnPlatform.iOS>false</OnPlatform.iOS>
<OnPlatform.Android>true</OnPlatform.Android>
</OnPlatform>
<OnPlatform x:Key="iOSVisible" x:TypeArguments="x:Boolean">
<OnPlatform.iOS>true</OnPlatform.iOS>
<OnPlatform.Android>false</OnPlatform.Android>
</OnPlatform>
<!-- ENDS RESPONSIVE HELPERS -->
<!-- IMPLICIT STYLES -->
<Style TargetType="Frame">
<Setter Property="OutlineColor" Value="{DynamicResource BrandColor}" />
</Style>
<Style TargetType="Entry">
<Setter Property="TextColor" Value="{DynamicResource BaseTextColor}" />
</Style>
<Style TargetType="ActivityIndicator">
<Setter Property="Color" Value="{DynamicResource AccentColor}" />
</Style>
<Style TargetType="ContentPage">
<Setter Property="BackgroundColor" Value="{DynamicResource BasePageColor}" />
</Style>
<Style TargetType="ContentView">
<Setter Property="BackgroundColor" Value="{DynamicResource BasePageColor}" />
</Style>
<Style TargetType="ScrollView">
<Setter Property="BackgroundColor" Value="Transparent" />
</Style>
<Style TargetType="TabbedPage">
<Setter Property="BackgroundColor" Value="{DynamicResource BaseTabbedPageColor}" />
</Style>
<Style TargetType="Label">
<Setter Property="FontSize" Value="{DynamicResource BaseFontSize}" />
<Setter Property="TextColor" Value="{DynamicResource BaseTextColor}" />
</Style>
<Style TargetType="ListView">
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="SeparatorColor" Value="{DynamicResource ListViewSeparatorColor}" />
<Setter Property="SeparatorVisibility" Value="Default" />
</Style>
<Style TargetType="TableView">
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="artina:TableViewProperties.HeaderFooterTextColor" Value="{DynamicResource AccentColor}" />
</Style>
<Style TargetType="Image">
<Setter Property="IsOpaque">
<Setter.Value>
<OnPlatform x:TypeArguments="x:Boolean" Android="true" />
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ProgressBar">
<Setter Property="artina:ProgressBarProperties.TintColor" Value="{DynamicResource AccentColor}" />
</Style>
<Style TargetType="Slider">
<Setter Property="artina:SliderProperties.TintColor" Value="{DynamicResource AccentColor}" />
</Style>
<Style TargetType="TextCell">
<Setter Property="TextColor" Value="{ DynamicResource AccentColor }" />
</Style>
<Style TargetType="Button">
<Setter Property="FontSize" Value="{DynamicResource BaseFontSize}" />
<Setter Property="BorderRadius" Value="22" />
<Setter Property="BorderWidth" Value="0" />
<Setter Property="BorderColor" Value="Transparent" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
<!--
<FileImageSource x:Key="HamburguerIcon">hamburguer_icon.png</FileImageSource>
<FileImageSource x:Key="WelcomeBackgroundImagePhone">welcome_bg.jpg</FileImageSource>
<FileImageSource x:Key="WelcomeBackgroundImageTablet">welcome_bg_tablet.jpg</FileImageSource>
<!--<FileImageSource x:Key="BrandImage">logo.png</FileImageSource>-->
<FileImageSource x:Key="BrandImage">logo_empresa.png</FileImageSource>
<FileImageSource x:Key="GenericBackgroundImage">generic_bg_image.jpg</FileImageSource>
<FileImageSource x:Key="SignUpBackgroundImagePhone">signup_bg.jpg</FileImageSource>
<FileImageSource x:Key="SignUpBackgroundImageTablet">signup_bg_tablet.jpg</FileImageSource>
<FileImageSource x:Key="LoginBackgroundImagePhone">login_bg.jpg</FileImageSource>
<FileImageSource x:Key="LoginBackgroundImageTablet">login_bg_tablet.jpg</FileImageSource>
<FileImageSource x:Key="PasswordRecoveryBackgroundImagePhone">pass_recovery_bg.jpg</FileImageSource>
<FileImageSource x:Key="PasswordRecoveryBackgroundImageTablet">pass_recovery_bg_tablet.jpg</FileImageSource>
<FileImageSource x:Key="WalkthroughStepGenericPhoneBackgroundImage">walkthrough_generic_phone_bg.png</FileImageSource>
<FileImageSource x:Key="ThemeAvatarSample0Image">user_profile_0.jpg</FileImageSource>
<FileImageSource x:Key="ThemeAvatarSample1Image">user_profile_1.jpg</FileImageSource>
<FileImageSource x:Key="SocialHeaderBackgroundImage0">social_header_bg_0.jpg</FileImageSource>
<FileImageSource x:Key="SocialHeaderBackgroundImage1">social_header_bg_1.jpg</FileImageSource>
<!-- RESPONSIVE COMMON -->
<OnIdiom x:Key="MainWrapperPadding" x:TypeArguments="Thickness">
<OnIdiom.Phone>0</OnIdiom.Phone>
<OnIdiom.Tablet>100,0,100,0</OnIdiom.Tablet>
</OnIdiom>
<!-- END RESPONSIVE COMMON -->
<!-- BEGINS RESPONSIVE HELPERS -->
<OnIdiom x:Key="TabletVisible" x:TypeArguments="x:Boolean">
<OnIdiom.Phone>false</OnIdiom.Phone>
<OnIdiom.Tablet>true</OnIdiom.Tablet>
</OnIdiom>
<OnIdiom x:Key="PhoneVisible" x:TypeArguments="x:Boolean">
<OnIdiom.Phone>true</OnIdiom.Phone>
<OnIdiom.Tablet>false</OnIdiom.Tablet>
</OnIdiom>
<OnPlatform x:Key="AndroidVisible" x:TypeArguments="x:Boolean">
<OnPlatform.iOS>false</OnPlatform.iOS>
<OnPlatform.Android>true</OnPlatform.Android>
</OnPlatform>
<OnPlatform x:Key="iOSVisible" x:TypeArguments="x:Boolean">
<OnPlatform.iOS>true</OnPlatform.iOS>
<OnPlatform.Android>false</OnPlatform.Android>
</OnPlatform>
<!-- ENDS RESPONSIVE HELPERS -->
<!-- IMPLICIT STYLES -->
<Style TargetType="Frame">
<Setter Property="OutlineColor" Value="{DynamicResource BrandColor}" />
</Style>
<Style TargetType="Entry">
<Setter Property="TextColor" Value="{DynamicResource BaseTextColor}" />
</Style>
<Style TargetType="ActivityIndicator">
<Setter Property="Color" Value="{DynamicResource AccentColor}" />
</Style>
<Style TargetType="ContentPage">
<Setter Property="BackgroundColor" Value="{DynamicResource BasePageColor}" />
</Style>
<Style TargetType="ContentView">
<Setter Property="BackgroundColor" Value="{DynamicResource BasePageColor}" />
</Style>
<Style TargetType="ScrollView">
<Setter Property="BackgroundColor" Value="Transparent" />
</Style>
<Style TargetType="TabbedPage">
<Setter Property="BackgroundColor" Value="{DynamicResource BaseTabbedPageColor}" />
</Style>
<Style TargetType="Label">
<Setter Property="FontSize" Value="{DynamicResource BaseFontSize}" />
<Setter Property="TextColor" Value="{DynamicResource BaseTextColor}" />
</Style>
<Style TargetType="ListView">
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="SeparatorColor" Value="{DynamicResource ListViewSeparatorColor}" />
<Setter Property="SeparatorVisibility" Value="Default" />
</Style>
<Style TargetType="TableView">
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="artina:TableViewProperties.HeaderFooterTextColor" Value="{DynamicResource AccentColor}" />
</Style>
<Style TargetType="Image">
<Setter Property="IsOpaque">
<Setter.Value>
<OnPlatform x:TypeArguments="x:Boolean" Android="true" />
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ProgressBar">
<Setter Property="artina:ProgressBarProperties.TintColor" Value="{DynamicResource AccentColor}" />
</Style>
<Style TargetType="Slider">
<Setter Property="artina:SliderProperties.TintColor" Value="{DynamicResource AccentColor}" />
</Style>
<Style TargetType="TextCell">
<Setter Property="TextColor" Value="{ DynamicResource AccentColor }" />
</Style>
<Style TargetType="Button">
<Setter Property="FontSize" Value="{DynamicResource BaseFontSize}" />
<Setter Property="BorderRadius" Value="22" />
<Setter Property="BorderWidth" Value="0" />
<Setter Property="BorderColor" Value="Transparent" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
<!--
Mimic Android Buttons background color
If no background color is set,
the button won't render with height as specified here
-->
<Setter Property="BackgroundColor">
<Setter.Value>
<OnPlatform x:TypeArguments="Color" Android="#d6d6d6" />
</Setter.Value>
</Setter>
</Style>
<Style TargetType="artina:Button">
<Setter Property="FontSize" Value="{DynamicResource BaseFontSize}" />
<Setter Property="BorderRadius" Value="22" />
<Setter Property="BorderWidth" Value="0" />
<Setter Property="BorderColor" Value="Transparent" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
<!--
<Setter Property="BackgroundColor">
<Setter.Value>
<OnPlatform x:TypeArguments="Color" Android="#d6d6d6" />
</Setter.Value>
</Setter>
</Style>
<Style TargetType="artina:Button">
<Setter Property="FontSize" Value="{DynamicResource BaseFontSize}" />
<Setter Property="BorderRadius" Value="22" />
<Setter Property="BorderWidth" Value="0" />
<Setter Property="BorderColor" Value="Transparent" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
<!--
Mimic Android Buttons background color
If no background color is set,
the button won't render with height as specified here
-->
<Setter Property="BackgroundColor">
<Setter.Value>
<OnPlatform x:TypeArguments="Color" Android="#d6d6d6" />
</Setter.Value>
</Setter>
</Style>
<Setter Property="BackgroundColor">
<Setter.Value>
<OnPlatform x:TypeArguments="Color" Android="#d6d6d6" />
</Setter.Value>
</Setter>
</Style>
<!-- FFIMAGELOADING STYLES -->
<Style TargetType="ffimageloading:CachedImage">
<!-- FFIMAGELOADING STYLES -->
<Style TargetType="ffimageloading:CachedImage">
<Setter Property="LoadingPlaceholder" Value="image_default_empresa.png" />
<Setter Property="BitmapOptimizations" Value="true" />
<Setter Property="DownsampleToViewSize" Value="true" />
<Setter Property="TransparencyEnabled" Value="false" />
<Setter Property="RetryCount" Value="3" />
<Setter Property="RetryDelay" Value="250" />
</Style>
<!-- BASE STYLES -->
<Style x:Key="FontIcon" TargetType="Label">
<Setter Property="FontFamily" Value="{ DynamicResource IconsFontFamily }" />
</Style>
<Style x:Key="FontIconBase" TargetType="Label">
<Setter Property="FontFamily" Value="{ DynamicResource GrialShapesFontFamily }" />
</Style>
<Style x:Key="RoundedButtonStyle" TargetType="Button">
<Setter Property="FontSize" Value="{DynamicResource BaseFontSize}" />
<Setter Property="BorderRadius" Value="22" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
</Style>
<Style x:Key="SquaredButtonStyle" TargetType="Button">
<Setter Property="Margin" Value="0,0,5,0" />
<Setter Property="FontSize" Value="{DynamicResource BaseFontSize}" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
</Style>
<Style x:Key="Horizontal1ptLineStyle" TargetType="BoxView">
<Setter Property="HeightRequest" Value="1" />
<Setter Property="BackgroundColor" Value="#11000000" />
</Style>
<Style x:Key="StatusLabelStyle" TargetType="Label">
<Setter Property="Text" Value=" AVAILABLE " />
<Setter Property="VerticalOptions" Value="End" />
<Setter Property="HorizontalOptions" Value="Start" />
<Setter Property="FontSize" Value="14" />
</Style>
<!-- SPECIFIC STYLES -->
<Style x:Key="IconCloseLabelStyle" TargetType="Label" BasedOn="{StaticResource FontIcon}">
<Setter Property="FontSize" Value="20" />
<Setter Property="HorizontalOptions" Value="FillAndExpand" />
<Setter Property="VerticalOptions" Value="FillAndExpand" />
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.Close }" />
<Setter Property="HorizontalTextAlignment" Value="Center" />
<Setter Property="VerticalTextAlignment" Value="Center" />
<Setter Property="TextColor" Value="{ DynamicResource OverImageTextColor }" />
<Setter Property="HeightRequest" Value="30" />
<Setter Property="WidthRequest" Value="30" />
</Style>
<Style x:Key="IconBackLabelStyle" TargetType="Label" BasedOn="{StaticResource IconCloseLabelStyle}">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.ArrowLeft }" />
</Style>
<!-- COMMON -->
<Style x:Key="AvailableStatusStyle" TargetType="Label" BasedOn="{StaticResource StatusLabelStyle}">
<Setter Property="BackgroundColor" Value="{StaticResource OkColor}" />
<Setter Property="TextColor" Value="White" />
</Style>
<Style x:Key="RoundShape" TargetType="Label" BasedOn="{ StaticResource FontIconBase }">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.Circle }" />
</Style>
<!-- MAIN MENU STYLES -->
<Style x:Key="MainMenuStyle" TargetType="ContentPage">
<Setter Property="BackgroundColor" Value="{DynamicResource MainMenuBackgroundColor}" />
</Style>
<Style x:Key="MainMenuListViewStyle" TargetType="ListView">
<Setter Property="BackgroundColor" Value="{DynamicResource MainMenuBackgroundColor}" />
<Setter Property="SeparatorVisibility" Value="None" />
<Setter Property="SeparatorColor" Value="{DynamicResource MainMenuSeparatorColor}" />
<Setter Property="RowHeight" Value="55" />
</Style>
<Style x:Key="MainMenuIconStyle" TargetType="Label">
<Setter Property="TextColor" Value="{ DynamicResource MainMenuIconColor }" />
<Setter Property="FontFamily" Value="grialshapes" />
<Setter Property="FontSize" Value="{ DynamicResource MainMenuIconFontsize }" />
<Setter Property="VerticalOptions" Value="CenterAndExpand" />
</Style>
<Style x:Key="MainMenuHeaderStyle" TargetType="Label">
<Setter Property="BackgroundColor" Value="{DynamicResource MainMenuBackgroundColor}" />
<Setter Property="TextColor" Value="{ DynamicResource MainMenuTextColor }" />
<Setter Property="VerticalTextAlignment" Value="Center" />
<Setter Property="FontSize" Value="{DynamicResource MainMenuHeaderFontsize }" />
<Setter Property="FontAttributes" Value="Bold" />
</Style>
<Style x:Key="MainMenuLabelStyle" TargetType="Label">
<Setter Property="TextColor" Value="{ DynamicResource MainMenuTextColor }" />
<Setter Property="VerticalTextAlignment" Value="Center" />
<Setter Property="TranslationX" Value="{DynamicResource MainMenuLabelTranslationX}" />
<Setter Property="FontSize" Value="{DynamicResource MainMenuLabelFontsize}" />
<Setter Property="HorizontalOptions" Value="StartAndExpand" />
<Setter Property="VerticalOptions" Value="CenterAndExpand" />
<Setter Property="LineBreakMode" Value="TailTruncation" />
</Style>
<Style x:Key="MainMenuRightChevronStyle" TargetType="Label" BasedOn="{ StaticResource FontIconBase }">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.ArrowRight }" />
<Setter Property="TextColor" Value="{ DynamicResource MainMenuIconColor }" />
<Setter Property="VerticalTextAlignment" Value="Center" />
<Setter Property="FontSize" Value="{DynamicResource MainMenuChevronRightFontsize}" />
<Setter Property="HorizontalOptions" Value="End" />
</Style>
<!-- NOTIFICATION STYLES -->
<Style x:Key="NotificationItemTemplateShape" TargetType="Label" BasedOn="{ StaticResource FontIconBase }">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.Circle }" />
<Setter Property="FontSize">
<Setter.Value>
<OnIdiom x:TypeArguments="x:Double" Phone="25" Tablet="35" />
</Setter.Value>
</Setter>
<Setter Property="Opacity" Value="1" />
</Style>
<!-- WELCOME STYLES -->
<Style x:Key="WelcomeBackgroundImage" TargetType="Image">
<Setter Property="Aspect" Value="AspectFill" />
<Setter Property="Source">
<Setter.Value>
<OnIdiom x:TypeArguments="ImageSource" Phone="{ StaticResource WelcomeBackgroundImagePhone }" Tablet="{ StaticResource WelcomeBackgroundImageTablet }" />
</Setter.Value>
</Setter>
</Style>
<!-- LOGINS STYLES -->
<Style x:Key="SignUpBackgroundImage" TargetType="Image">
<Setter Property="Aspect" Value="AspectFill" />
<Setter Property="Source">
<Setter.Value>
<OnIdiom x:TypeArguments="ImageSource" Phone="{ StaticResource SignUpBackgroundImagePhone }" Tablet="{ StaticResource LoginBackgroundImageTablet }" />
</Setter.Value>
</Setter>
</Style>
<Style x:Key="LoginBackgroundImage" TargetType="Image">
<Setter Property="Aspect" Value="AspectFill" />
<Setter Property="Source">
<Setter.Value>
<OnIdiom x:TypeArguments="ImageSource" Phone="{ StaticResource LoginBackgroundImagePhone }" Tablet="{ StaticResource LoginBackgroundImageTablet }" />
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PasswordRecoveryBackgroundImage" TargetType="Image">
<Setter Property="Aspect" Value="AspectFill" />
<Setter Property="Source">
<Setter.Value>
<OnIdiom x:TypeArguments="ImageSource" Phone="{ StaticResource PasswordRecoveryBackgroundImagePhone }" Tablet="{ StaticResource LoginBackgroundImageTablet }" />
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PrimaryActionButtonStyle" TargetType="Button" BasedOn="{StaticResource RoundedButtonStyle}">
<Setter Property="BackgroundColor" Value="{DynamicResource AccentColor}" />
<Setter Property="TextColor" Value="{DynamicResource LabelButtonColor}" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
</Style>
<Style x:Key="SecondaryActionButtonStyle" TargetType="Button" BasedOn="{StaticResource RoundedButtonStyle}">
<Setter Property="BackgroundColor" Value="{DynamicResource ComplementColor}" />
<Setter Property="TextColor" Value="{DynamicResource LabelButtonColor}" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
</Style>
<Style x:Key="TransparentButtonStyle" TargetType="Button" BasedOn="{StaticResource RoundedButtonStyle}">
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="TextColor" Value="{DynamicResource LabelButtonColor}" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
</Style>
<!-- ENTRY FIELDS -->
<Style x:Key="ArtinaEntryStyle" TargetType="Entry">
<Setter Property="TextColor" Value="White" />
<Setter Property="artina:EntryProperties.BorderStyle" Value="BottomLine" />
<Setter Property="artina:EntryProperties.BorderWidth" Value="1" />
<Style.Triggers>
<Trigger TargetType="Entry" Property="IsFocused" Value="True">
<Setter Property="artina:EntryProperties.BorderColor" Value="{DynamicResource AccentColor}" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="LoginEntryStyle" TargetType="Entry">
<Setter Property="TextColor" Value="White" />
<Setter Property="BackgroundColor" Value="Transparent" />
</Style>
<Style x:Key="ArtinaLoginEntryStyle" TargetType="Entry" BasedOn="{ StaticResource LoginEntryStyle }">
<Setter Property="artina:EntryProperties.BorderStyle" Value="BottomLine" />
<Setter Property="artina:EntryProperties.BorderColor" Value="{ DynamicResource OverImageTextColor }" />
<Setter Property="artina:EntryProperties.PlaceholderColor" Value="{ DynamicResource OverImageTextColor }" />
<Style.Triggers>
<Trigger TargetType="Entry" Property="IsFocused" Value="True">
<Setter Property="artina:EntryProperties.BorderColor" Value="{ DynamicResource AccentColor }" />
</Trigger>
</Style.Triggers>
</Style>
<!-- VALIDATIONS -->
<Style x:Key="ValidationEntryErrorStyle" TargetType="Label">
<Setter Property="BackgroundColor" Value="{ DynamicResource ErrorColor }" />
<Setter Property="TextColor" Value="White" />
<Setter Property="FontSize" Value="12" />
</Style>
<Style x:Key="ValidationEntryWarningStyle" TargetType="Label">
<Setter Property="BackgroundColor" Value="{ DynamicResource WarningColor }" />
<Setter Property="TextColor" Value="White" />
<Setter Property="FontSize" Value="12" />
</Style>
<!-- CHAT STYLES -->
<Style x:Key="ChatMessageItemBaseStyle" TargetType="Label">
<Setter Property="FontSize" Value="14" />
</Style>
<Style x:Key="ChatMessageItemInfoBaseStyle" TargetType="Label">
<Setter Property="FontSize" Value="12" />
<Setter Property="TextColor" Value="#FF212121" />
</Style>
<Style x:Key="ChatMessageItemBalloonBaseStyle" TargetType="StackLayout">
<Setter Property="Padding" Value="10" />
</Style>
<Style x:Key="ChatIconButtonBaseStyle" TargetType="Label" BasedOn="{ StaticResource FontIcon }">
<Setter Property="HorizontalTextAlignment" Value="Center" />
<Setter Property="VerticalTextAlignment" Value="Center" />
<Setter Property="FontSize" Value="20" />
</Style>
<Style x:Key="ChatIconButtonPictureStyle" TargetType="Label" BasedOn="{ StaticResource ChatIconButtonBaseStyle }">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.PhotoCamera }" />
</Style>
<Style x:Key="ChatIconButtonSendStyle" TargetType="Label" BasedOn="{ StaticResource ChatIconButtonBaseStyle }">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.Send }" />
<Setter Property="TextColor" Value="{ DynamicResource AccentColor }" />
</Style>
<Style x:Key="ChatMessageEntryStyle" TargetType="Entry">
<Setter Property="FontSize" Value="12" />
<Setter Property="BackgroundColor">
<Setter.Value>
<OnPlatform x:TypeArguments="Color"
<Setter Property="BitmapOptimizations" Value="true" />
<Setter Property="DownsampleToViewSize" Value="true" />
<Setter Property="TransparencyEnabled" Value="false" />
<Setter Property="RetryCount" Value="3" />
<Setter Property="RetryDelay" Value="250" />
</Style>
<!-- BASE STYLES -->
<Style x:Key="FontIcon" TargetType="Label">
<Setter Property="FontFamily" Value="{ DynamicResource IconsFontFamily }" />
</Style>
<Style x:Key="FontIconBase" TargetType="Label">
<Setter Property="FontFamily" Value="{ DynamicResource GrialShapesFontFamily }" />
</Style>
<Style x:Key="RoundedButtonStyle" TargetType="Button">
<Setter Property="FontSize" Value="{DynamicResource BaseFontSize}" />
<Setter Property="BorderRadius" Value="22" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
</Style>
<Style x:Key="SquaredButtonStyle" TargetType="Button">
<Setter Property="Margin" Value="0,0,5,0" />
<Setter Property="FontSize" Value="{DynamicResource BaseFontSize}" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
</Style>
<Style x:Key="Horizontal1ptLineStyle" TargetType="BoxView">
<Setter Property="HeightRequest" Value="1" />
<Setter Property="BackgroundColor" Value="#11000000" />
</Style>
<Style x:Key="StatusLabelStyle" TargetType="Label">
<Setter Property="Text" Value=" AVAILABLE " />
<Setter Property="VerticalOptions" Value="End" />
<Setter Property="HorizontalOptions" Value="Start" />
<Setter Property="FontSize" Value="14" />
</Style>
<!-- SPECIFIC STYLES -->
<Style x:Key="IconCloseLabelStyle" TargetType="Label" BasedOn="{StaticResource FontIcon}">
<Setter Property="FontSize" Value="20" />
<Setter Property="HorizontalOptions" Value="FillAndExpand" />
<Setter Property="VerticalOptions" Value="FillAndExpand" />
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.Close }" />
<Setter Property="HorizontalTextAlignment" Value="Center" />
<Setter Property="VerticalTextAlignment" Value="Center" />
<Setter Property="TextColor" Value="{ DynamicResource OverImageTextColor }" />
<Setter Property="HeightRequest" Value="30" />
<Setter Property="WidthRequest" Value="30" />
</Style>
<Style x:Key="IconBackLabelStyle" TargetType="Label" BasedOn="{StaticResource IconCloseLabelStyle}">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.ArrowLeft }" />
</Style>
<!-- COMMON -->
<Style x:Key="AvailableStatusStyle" TargetType="Label" BasedOn="{StaticResource StatusLabelStyle}">
<Setter Property="BackgroundColor" Value="{StaticResource OkColor}" />
<Setter Property="TextColor" Value="White" />
</Style>
<Style x:Key="RoundShape" TargetType="Label" BasedOn="{ StaticResource FontIconBase }">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.Circle }" />
</Style>
<!-- MAIN MENU STYLES -->
<Style x:Key="MainMenuStyle" TargetType="ContentPage">
<Setter Property="BackgroundColor" Value="{DynamicResource MainMenuBackgroundColor}" />
</Style>
<Style x:Key="MainMenuListViewStyle" TargetType="ListView">
<Setter Property="BackgroundColor" Value="{DynamicResource MainMenuBackgroundColor}" />
<Setter Property="SeparatorVisibility" Value="None" />
<Setter Property="SeparatorColor" Value="{DynamicResource MainMenuSeparatorColor}" />
<Setter Property="RowHeight" Value="55" />
</Style>
<Style x:Key="MainMenuIconStyle" TargetType="Label">
<Setter Property="TextColor" Value="{ DynamicResource MainMenuIconColor }" />
<Setter Property="FontFamily" Value="grialshapes" />
<Setter Property="FontSize" Value="{ DynamicResource MainMenuIconFontsize }" />
<Setter Property="VerticalOptions" Value="CenterAndExpand" />
</Style>
<Style x:Key="MainMenuHeaderStyle" TargetType="Label">
<Setter Property="BackgroundColor" Value="{DynamicResource MainMenuBackgroundColor}" />
<Setter Property="TextColor" Value="{ DynamicResource MainMenuTextColor }" />
<Setter Property="VerticalTextAlignment" Value="Center" />
<Setter Property="FontSize" Value="{DynamicResource MainMenuHeaderFontsize }" />
<Setter Property="FontAttributes" Value="Bold" />
</Style>
<Style x:Key="MainMenuLabelStyle" TargetType="Label">
<Setter Property="TextColor" Value="{ DynamicResource MainMenuTextColor }" />
<Setter Property="VerticalTextAlignment" Value="Center" />
<Setter Property="TranslationX" Value="{DynamicResource MainMenuLabelTranslationX}" />
<Setter Property="FontSize" Value="{DynamicResource MainMenuLabelFontsize}" />
<Setter Property="HorizontalOptions" Value="StartAndExpand" />
<Setter Property="VerticalOptions" Value="CenterAndExpand" />
<Setter Property="LineBreakMode" Value="TailTruncation" />
</Style>
<Style x:Key="MainMenuRightChevronStyle" TargetType="Label" BasedOn="{ StaticResource FontIconBase }">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.ArrowRight }" />
<Setter Property="TextColor" Value="{ DynamicResource MainMenuIconColor }" />
<Setter Property="VerticalTextAlignment" Value="Center" />
<Setter Property="FontSize" Value="{DynamicResource MainMenuChevronRightFontsize}" />
<Setter Property="HorizontalOptions" Value="End" />
</Style>
<!-- NOTIFICATION STYLES -->
<Style x:Key="NotificationItemTemplateShape" TargetType="Label" BasedOn="{ StaticResource FontIconBase }">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.Circle }" />
<Setter Property="FontSize">
<Setter.Value>
<OnIdiom x:TypeArguments="x:Double" Phone="25" Tablet="35" />
</Setter.Value>
</Setter>
<Setter Property="Opacity" Value="1" />
</Style>
<!-- WELCOME STYLES -->
<Style x:Key="WelcomeBackgroundImage" TargetType="Image">
<Setter Property="Aspect" Value="AspectFill" />
<Setter Property="Source">
<Setter.Value>
<OnIdiom x:TypeArguments="ImageSource" Phone="{ StaticResource WelcomeBackgroundImagePhone }" Tablet="{ StaticResource WelcomeBackgroundImageTablet }" />
</Setter.Value>
</Setter>
</Style>
<!-- LOGINS STYLES -->
<Style x:Key="SignUpBackgroundImage" TargetType="Image">
<Setter Property="Aspect" Value="AspectFill" />
<Setter Property="Source">
<Setter.Value>
<OnIdiom x:TypeArguments="ImageSource" Phone="{ StaticResource SignUpBackgroundImagePhone }" Tablet="{ StaticResource LoginBackgroundImageTablet }" />
</Setter.Value>
</Setter>
</Style>
<Style x:Key="LoginBackgroundImage" TargetType="Image">
<Setter Property="Aspect" Value="AspectFill" />
<Setter Property="Source">
<Setter.Value>
<OnIdiom x:TypeArguments="ImageSource" Phone="{ StaticResource LoginBackgroundImagePhone }" Tablet="{ StaticResource LoginBackgroundImageTablet }" />
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PasswordRecoveryBackgroundImage" TargetType="Image">
<Setter Property="Aspect" Value="AspectFill" />
<Setter Property="Source">
<Setter.Value>
<OnIdiom x:TypeArguments="ImageSource" Phone="{ StaticResource PasswordRecoveryBackgroundImagePhone }" Tablet="{ StaticResource LoginBackgroundImageTablet }" />
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PrimaryActionButtonStyle" TargetType="Button" BasedOn="{StaticResource RoundedButtonStyle}">
<Setter Property="BackgroundColor" Value="{DynamicResource AccentColor}" />
<Setter Property="TextColor" Value="{DynamicResource LabelButtonColor}" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
</Style>
<Style x:Key="SecondaryActionButtonStyle" TargetType="Button" BasedOn="{StaticResource RoundedButtonStyle}">
<Setter Property="BackgroundColor" Value="{DynamicResource ComplementColor}" />
<Setter Property="TextColor" Value="{DynamicResource LabelButtonColor}" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
</Style>
<Style x:Key="TransparentButtonStyle" TargetType="Button" BasedOn="{StaticResource RoundedButtonStyle}">
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="TextColor" Value="{DynamicResource LabelButtonColor}" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
</Style>
<!-- ENTRY FIELDS -->
<Style x:Key="ArtinaEntryStyle" TargetType="Entry">
<Setter Property="TextColor" Value="White" />
<Setter Property="artina:EntryProperties.BorderStyle" Value="BottomLine" />
<Setter Property="artina:EntryProperties.BorderWidth" Value="1" />
<Style.Triggers>
<Trigger TargetType="Entry" Property="IsFocused" Value="True">
<Setter Property="artina:EntryProperties.BorderColor" Value="{DynamicResource AccentColor}" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="LoginEntryStyle" TargetType="Entry">
<Setter Property="TextColor" Value="White" />
<Setter Property="BackgroundColor" Value="Transparent" />
</Style>
<Style x:Key="ArtinaLoginEntryStyle" TargetType="Entry" BasedOn="{ StaticResource LoginEntryStyle }">
<Setter Property="artina:EntryProperties.BorderStyle" Value="BottomLine" />
<Setter Property="artina:EntryProperties.BorderColor" Value="{ DynamicResource OverImageTextColor }" />
<Setter Property="artina:EntryProperties.PlaceholderColor" Value="{ DynamicResource OverImageTextColor }" />
<Style.Triggers>
<Trigger TargetType="Entry" Property="IsFocused" Value="True">
<Setter Property="artina:EntryProperties.BorderColor" Value="{ DynamicResource AccentColor }" />
</Trigger>
</Style.Triggers>
</Style>
<!-- VALIDATIONS -->
<Style x:Key="ValidationEntryErrorStyle" TargetType="Label">
<Setter Property="BackgroundColor" Value="{ DynamicResource ErrorColor }" />
<Setter Property="TextColor" Value="White" />
<Setter Property="FontSize" Value="12" />
</Style>
<Style x:Key="ValidationEntryWarningStyle" TargetType="Label">
<Setter Property="BackgroundColor" Value="{ DynamicResource WarningColor }" />
<Setter Property="TextColor" Value="White" />
<Setter Property="FontSize" Value="12" />
</Style>
<!-- CHAT STYLES -->
<Style x:Key="ChatMessageItemBaseStyle" TargetType="Label">
<Setter Property="FontSize" Value="14" />
</Style>
<Style x:Key="ChatMessageItemInfoBaseStyle" TargetType="Label">
<Setter Property="FontSize" Value="12" />
<Setter Property="TextColor" Value="#FF212121" />
</Style>
<Style x:Key="ChatMessageItemBalloonBaseStyle" TargetType="StackLayout">
<Setter Property="Padding" Value="10" />
</Style>
<Style x:Key="ChatIconButtonBaseStyle" TargetType="Label" BasedOn="{ StaticResource FontIcon }">
<Setter Property="HorizontalTextAlignment" Value="Center" />
<Setter Property="VerticalTextAlignment" Value="Center" />
<Setter Property="FontSize" Value="20" />
</Style>
<Style x:Key="ChatIconButtonPictureStyle" TargetType="Label" BasedOn="{ StaticResource ChatIconButtonBaseStyle }">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.PhotoCamera }" />
</Style>
<Style x:Key="ChatIconButtonSendStyle" TargetType="Label" BasedOn="{ StaticResource ChatIconButtonBaseStyle }">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.Send }" />
<Setter Property="TextColor" Value="{ DynamicResource AccentColor }" />
</Style>
<Style x:Key="ChatMessageEntryStyle" TargetType="Entry">
<Setter Property="FontSize" Value="12" />
<Setter Property="BackgroundColor">
<Setter.Value>
<OnPlatform x:TypeArguments="Color"
iOS="#FFFFFF"
Android="#00FFFFFF" />
</Setter.Value>
</Setter>
</Style>
<!-- WALKTHROUGH -->
<Style x:Key="WalkthroughStepBaseStyle" TargetType="ContentPage">
<Setter Property="BackgroundColor" Value="{DynamicResource BrandColor}" />
</Style>
<Style x:Key="WalkthroughStepStyle" TargetType="ContentPage" BasedOn="{StaticResource WalkthroughStepBaseStyle}">
<Setter Property="Opacity" Value="1" />
</Style>
<Style x:Key="WalkthroughStepIconStyle" TargetType="Label" BasedOn="{StaticResource FontIcon}">
<Setter Property="HorizontalTextAlignment" Value="Center" />
<Setter Property="VerticalOptions" Value="CenterAndExpand" />
<Setter Property="FontSize" Value="72" />
<Setter Property="TextColor" Value="{DynamicResource OverImageTextColor}" />
</Style>
<Style x:Key="WalktrhoughItemTemplateShape" TargetType="Label" BasedOn="{ StaticResource FontIconBase }">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.Circle }" />
<Setter Property="HorizontalTextAlignment" Value="Center" />
<Setter Property="VerticalTextAlignment" Value="Center" />
<Setter Property="TextColor" Value="White" />
<Setter Property="Opacity" Value="0.1" />
</Style>
<!-- SETTINGS -->
<Style x:Key="SaveButtonStyle" TargetType="Button" BasedOn="{StaticResource RoundedButtonStyle}">
<Setter Property="BackgroundColor" Value="{DynamicResource SaveButtonColor}" />
<Setter Property="TextColor" Value="#FFF" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
</Style>
<Style x:Key="DeleteButtonStyle" TargetType="Button" BasedOn="{StaticResource RoundedButtonStyle}">
<Setter Property="BackgroundColor" Value="{DynamicResource DeleteButtonColor}" />
<Setter Property="TextColor" Value="#FFF" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
</Style>
<!-- DOCUMENT TIMELINE -->
<Style x:Key="DocumentTimelineBubbleStyle" TargetType="VisualElement">
<Setter Property="effects:Effects.CornerRadius" Value="4" />
</Style>
<Style x:Key="DocumentTimelineBulletStyle" TargetType="Label" BasedOn="{StaticResource RoundShape}">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.Circle }" />
</Style>
<!-- SOCIAL -->
<Style x:Key="SocialHeaderStyle" TargetType="Label">
<Setter Property="TranslationX" Value="20" />
<Setter Property="VerticalOptions" Value="CenterAndExpand" />
<Setter Property="FontSize" Value="14" />
<Setter Property="HeightRequest" Value="46" />
<Setter Property="VerticalTextAlignment" Value="Center" />
<Setter Property="TextColor" Value="{ DynamicResource BaseTextColor }" />
</Style>
<Style x:Key="SocialHeaderStyleBorderBottomStyle" TargetType="Label">
<Setter Property="HeightRequest" Value="1" />
<Setter Property="BackgroundColor" Value="{ DynamicResource ListViewSeparatorColor }" />
</Style>
<Style x:Key="ToolbarStyle" TargetType="Grid">
<Setter Property="HeightRequest" Value="60" />
<Setter Property="ColumnSpacing" Value="0" />
</Style>
<!-- BRAND BLOCK -->
<Style x:Key="BrandContainerStyle" TargetType="StackLayout">
<Setter Property="HorizontalOptions" Value="Start" />
<Setter Property="VerticalOptions" Value="Start" />
</Style>
<Style x:Key="BrandNameStyle" TargetType="Label">
<Setter Property="FontSize" Value="24" />
<Setter Property="TextColor" Value="{DynamicResource BaseTextColor}" />
</Style>
<Style x:Key="BrandNameOrnamentStyle" TargetType="BoxView">
<Setter Property="HeightRequest" Value="4" />
<Setter Property="VerticalOptions" Value="End" />
<Setter Property="HorizontalOptions" Value="Start" />
<Setter Property="WidthRequest" Value="40" />
<Setter Property="BackgroundColor" Value="{ DynamicResource AccentColor }" />
</Style>
<!-- LAYOUT HELPERS -->
<Style x:Key="Spacer" TargetType="BoxView">
<Setter Property="BackgroundColor" Value="Transparent" />
</Style>
<Style x:Key="SpacerThemeShowCaseStyle" TargetType="BoxView" BasedOn="{ StaticResource Spacer }">
<Setter Property="HeightRequest" Value="20" />
</Style>
<Style x:Key="HorizontalRuleStyle" TargetType="BoxView">
<Setter Property="BackgroundColor" Value="{DynamicResource AccentColor}" />
<Setter Property="HeightRequest" Value="1" />
</Style>
<Style x:Key="ThemeShowCaseHorizontalRuleStyle" TargetType="BoxView" BasedOn="{ StaticResource HorizontalRuleStyle }">
<Setter Property="BackgroundColor" Value="{ DynamicResource BaseSeparatorColor }" />
<Setter Property="Margin" Value="0,28" />
</Style>
<Style x:Key="LoginPadding" TargetType="StackLayout">
<Setter Property="Padding" Value="40,0,40,0" />
</Style>
<!-- THEME -->
<Style TargetType="artina:CircleImage">
<Setter Property="WidthRequest" Value="50" />
<Setter Property="HeightRequest" Value="50" />
<Setter Property="BorderThickness" Value="3" />
<Setter Property="BorderColor" Value="{DynamicResource AccentColor}" />
</Style>
<Style x:Key="Avatar" TargetType="artina:CircleImage">
<Setter Property="WidthRequest" Value="50" />
<Setter Property="HeightRequest" Value="50" />
<Setter Property="BorderThickness" Value="3" />
<Setter Property="BorderColor" Value="{DynamicResource AccentColor}" />
</Style>
<Style x:Key="AvatarXSmall" TargetType="artina:CircleImage" BasedOn="{ StaticResource Avatar }">
<Setter Property="WidthRequest" Value="36" />
<Setter Property="HeightRequest" Value="36" />
<Setter Property="BorderThickness" Value="2" />
</Style>
<Style x:Key="AvatarSmall" TargetType="artina:CircleImage" BasedOn="{ StaticResource Avatar }">
<Setter Property="WidthRequest" Value="44" />
<Setter Property="HeightRequest" Value="44" />
</Style>
<Style x:Key="AvatarLarge" TargetType="artina:CircleImage" BasedOn="{ StaticResource Avatar }">
<Setter Property="WidthRequest" Value="110" />
<Setter Property="HeightRequest" Value="110" />
</Style>
<Style x:Key="GrialBaseIconShapeDemo" TargetType="Label" BasedOn="{ StaticResource FontIconBase }">
<Setter Property="TextColor" Value="{ DynamicResource AccentColor }" />
<Setter Property="FontSize" Value="24" />
</Style>
<Style x:Key="FontIconItemDemo" TargetType="Label" BasedOn="{ StaticResource FontIcon }">
<Setter Property="TextColor" Value="{ DynamicResource AccentColor }" />
<Setter Property="FontSize" Value="24" />
</Style>
<!-- ECOMMERCE -->
<Style x:Key="EcommerceProductGridBannerStyle" TargetType="StackLayout">
<Setter Property="HeightRequest" Value="120" />
<Setter Property="BackgroundColor" Value="{DynamicResource BrandColor}" />
</Style>
<!-- CUSTOM NAVBAR -->
<Style x:Key="CustomNavBarStyle" TargetType="Grid">
<Setter Property="BackgroundColor" Value="{ DynamicResource AccentColor }" />
<Setter Property="HeightRequest">
<Setter.Value>
<OnPlatform x:TypeArguments="x:Double" Android="56" iOS="64" />
</Setter.Value>
</Setter>
</Style>
<!--Dashboard Item Template-->
<Style x:Key="DashboardItemTemplateShape" TargetType="Label" BasedOn="{ StaticResource FontIconBase }">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.Circle }" />
<Setter Property="FontSize">
<Setter.Value>
<OnIdiom x:TypeArguments="x:Double" Phone="60" Tablet="65" />
</Setter.Value>
</Setter>
<Setter Property="Opacity" Value="1" />
</Style>
<Style x:Key="DashboardItemTemplateIcon" TargetType="Label" BasedOn="{ StaticResource FontIcon }">
<Setter Property="FontSize">
<Setter.Value>
<OnIdiom x:TypeArguments="x:Double" Phone="25" Tablet="35" />
</Setter.Value>
</Setter>
<Setter Property="Opacity" Value="1" />
</Style>
<Style x:Key="DashboardVariantItemTemplateIcon" TargetType="Label" BasedOn="{ StaticResource FontIcon }">
<Setter Property="FontSize">
<Setter.Value>
<OnIdiom x:TypeArguments="x:Double" Phone="70" Tablet="85" />
</Setter.Value>
</Setter>
<Setter Property="Opacity" Value="1" />
</Style>
<x:Double x:Key="DashboardFlatSpacing">0</x:Double>
<Thickness x:Key="DashboardFlatPadding">0</Thickness>
<!--Dashboard Multiple Scroll-->
<OnIdiom x:TypeArguments="GridLength" Phone="250" Tablet="500" x:Key="DashboardMultipleScrollMainItemHeight" />
<OnIdiom x:TypeArguments="GridLength" Phone="134" Tablet="268" x:Key="DashboardMultipleScrollSecondaryItemRowHeight" />
<OnIdiom x:TypeArguments="GridLength" Phone="81" Tablet="162" x:Key="DashboardMultipleScrollSecondaryItemColumnWidth" />
<OnIdiom x:TypeArguments="LayoutOptions" Phone="FillAndExpand" Tablet="CenterAndExpand" x:Key="DashboardMultipleScrollMainItemVerticalAlignment" />
<OnIdiom x:TypeArguments="Thickness" Phone="20,30,20,20" Tablet="60" x:Key="DashboardMultipleScrollMainItemMargin" />
<OnIdiom x:TypeArguments="x:Double" Phone="20" Tablet="30" x:Key="DashboardMultipleScrollMainItemTitleFontSize" />
<OnIdiom x:TypeArguments="x:Double" Phone="14" Tablet="18" x:Key="DashboardMultipleScrollMainItemDescriptionFontSize" />
<OnIdiom x:TypeArguments="x:Double" Phone="10" Tablet="40" x:Key="DashboardMultipleScrollMainItemRowSpacing" />
<Style x:Key="DashboardMultipleScrollItemTitleStyle" TargetType="Label">
<Setter Property="Margin" Value="10,20,10,10" />
<Setter Property="FontSize" Value="16" />
<Setter Property="FontAttributes" Value="Bold" />
<Setter Property="TextColor" Value="{ DynamicResource BaseTextColor }" />
<Setter Property="VerticalTextAlignment" Value="End" />
</Style>
<Style x:Key="DashboardMultipleScrollResponsiveImageStyle" TargetType="Image">
<Setter Property="Aspect" Value="AspectFill" />
</Style>
<Style x:Key="DashboardMultipleScrollShimStyle" TargetType="Image">
<Setter Property="Source" Value="grialflix_main_item_gradient.png" />
<Setter Property="VerticalOptions" Value="FillAndExpand" />
<Setter Property="Aspect" Value="Fill" />
<Setter Property="Opacity" Value=".7" />
</Style>
<Style x:Key="DashboardMultipleScrollMainItemTitleStyle" TargetType="Label">
<Setter Property="TextColor" Value="{ DynamicResource OverImageTextColor }" />
<Setter Property="FontSize" Value="{ DynamicResource DashboardMultipleScrollMainItemTitleFontSize }" />
<Setter Property="FontAttributes" Value="Bold" />
</Style>
<Style x:Key="DashboardMultipleScrollMainItemDescriptionStyle" TargetType="Label">
<Setter Property="TextColor" Value="{ DynamicResource OverImageTextColor }" />
<Setter Property="FontSize" Value="{ DynamicResource DashboardMultipleScrollMainItemDescriptionFontSize }" />
<Setter Property="VerticalOptions" Value="FillAndExpand" />
</Style>
<Style x:Key="DashboardBadgeStyle" TargetType="VisualElement">
<Setter Property="effects:Effects.Shadow" Value="True" />
<Setter Property="effects:Effects.ShadowSize" Value="2" />
<Setter Property="effects:Effects.ShadowIOSColor" Value="#33000000" />
</Style>
<!-- MAIN MENU -->
<Style x:Key="IsNewRoundedLabelStyle" TargetType="local:RoundedLabel">
<Setter Property="Margin" Value="0,0,20,0" />
<Setter Property="RoundedLabelFontSize" Value="8" />
<Setter Property="RoundedLabelFontAttributes" Value="Bold" />
<Setter Property="RoundedLabelPadding" Value="6,4" />
<Setter Property="RoundedLabelTextColor" Value="{ DynamicResource InverseTextColor }" />
<Setter Property="RoundedLabelCornerRadius" Value="2" />
<Setter Property="HorizontalOptions" Value="End" />
<Setter Property="RoundedLabelBackgroundColor" Value="{ DynamicResource RoundedLabelBackgroundColor }" />
</Style>
<!-- CARDS -->
<OnPlatform x:TypeArguments="x:Double" x:Key="CardViewCornerRadius" Android="4" iOS="4" />
<!-- TAG LABEL -->
<OnPlatform x:TypeArguments="x:Double" x:Key="TagLabelCornerRadius" Android="6" iOS="6" />
<Style x:Key="CardViewStyle" TargetType="VisualElement">
<Setter Property="effects:Effects.CornerRadius" Value="{ DynamicResource CardViewCornerRadius }" />
<Setter Property="effects:Effects.Shadow" Value="True" />
<Setter Property="effects:Effects.ShadowSize" Value="5" />
<Setter Property="effects:Effects.ShadowIOSColor" Value="#77000000" />
</Style>
<Style x:Key="TagLabelStyle" TargetType="local:RoundedLabel">
<Setter Property="RoundedLabelCornerRadius" Value="{ DynamicResource TagLabelCornerRadius }" />
<Setter Property="RoundedLabelText" Value="{ Binding Section }" />
<Setter Property="RoundedLabelTextColor" Value="{ DynamicResource OverImageTextColor }" />
<Setter Property="RoundedLabelFontSize" Value="12" />
<Setter Property="RoundedLabelBackgroundColor" Value="{ DynamicResource TranslucidBlack }" />
</Style>
<!-- STATUS BAR GRADIENT -->
<Style x:Key="StatusBarShimStyle" TargetType="Image">
<Setter Property="Source" Value="status_bar_gradient.png" />
<Setter Property="VerticalOptions" Value="FillAndExpand" />
<Setter Property="HorizontalOptions" Value="FillAndExpand" />
<Setter Property="Aspect" Value="Fill" />
<Setter Property="Opacity" Value=".7" />
</Style>
</Setter.Value>
</Setter>
</Style>
<!-- WALKTHROUGH -->
<Style x:Key="WalkthroughStepBaseStyle" TargetType="ContentPage">
<Setter Property="BackgroundColor" Value="{DynamicResource BrandColor}" />
</Style>
<Style x:Key="WalkthroughStepStyle" TargetType="ContentPage" BasedOn="{StaticResource WalkthroughStepBaseStyle}">
<Setter Property="Opacity" Value="1" />
</Style>
<Style x:Key="WalkthroughStepIconStyle" TargetType="Label" BasedOn="{StaticResource FontIcon}">
<Setter Property="HorizontalTextAlignment" Value="Center" />
<Setter Property="VerticalOptions" Value="CenterAndExpand" />
<Setter Property="FontSize" Value="72" />
<Setter Property="TextColor" Value="{DynamicResource OverImageTextColor}" />
</Style>
<Style x:Key="WalktrhoughItemTemplateShape" TargetType="Label" BasedOn="{ StaticResource FontIconBase }">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.Circle }" />
<Setter Property="HorizontalTextAlignment" Value="Center" />
<Setter Property="VerticalTextAlignment" Value="Center" />
<Setter Property="TextColor" Value="White" />
<Setter Property="Opacity" Value="0.1" />
</Style>
<!-- SETTINGS -->
<Style x:Key="SaveButtonStyle" TargetType="Button" BasedOn="{StaticResource RoundedButtonStyle}">
<Setter Property="BackgroundColor" Value="{DynamicResource SaveButtonColor}" />
<Setter Property="TextColor" Value="#FFF" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
</Style>
<Style x:Key="DeleteButtonStyle" TargetType="Button" BasedOn="{StaticResource RoundedButtonStyle}">
<Setter Property="BackgroundColor" Value="{DynamicResource DeleteButtonColor}" />
<Setter Property="TextColor" Value="#FFF" />
<Setter Property="HeightRequest" Value="{DynamicResource BaseButtonHeight}" />
</Style>
<!-- DOCUMENT TIMELINE -->
<Style x:Key="DocumentTimelineBubbleStyle" TargetType="VisualElement">
<Setter Property="effects:Effects.CornerRadius" Value="4" />
</Style>
<Style x:Key="DocumentTimelineBulletStyle" TargetType="Label" BasedOn="{StaticResource RoundShape}">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.Circle }" />
</Style>
<!-- SOCIAL -->
<Style x:Key="SocialHeaderStyle" TargetType="Label">
<Setter Property="TranslationX" Value="20" />
<Setter Property="VerticalOptions" Value="CenterAndExpand" />
<Setter Property="FontSize" Value="14" />
<Setter Property="HeightRequest" Value="46" />
<Setter Property="VerticalTextAlignment" Value="Center" />
<Setter Property="TextColor" Value="{ DynamicResource BaseTextColor }" />
</Style>
<Style x:Key="SocialHeaderStyleBorderBottomStyle" TargetType="Label">
<Setter Property="HeightRequest" Value="1" />
<Setter Property="BackgroundColor" Value="{ DynamicResource ListViewSeparatorColor }" />
</Style>
<Style x:Key="ToolbarStyle" TargetType="Grid">
<Setter Property="HeightRequest" Value="60" />
<Setter Property="ColumnSpacing" Value="0" />
</Style>
<!-- BRAND BLOCK -->
<Style x:Key="BrandContainerStyle" TargetType="StackLayout">
<Setter Property="HorizontalOptions" Value="Start" />
<Setter Property="VerticalOptions" Value="Start" />
</Style>
<Style x:Key="BrandNameStyle" TargetType="Label">
<Setter Property="FontSize" Value="24" />
<Setter Property="TextColor" Value="{DynamicResource BaseTextColor}" />
</Style>
<Style x:Key="BrandNameOrnamentStyle" TargetType="BoxView">
<Setter Property="HeightRequest" Value="4" />
<Setter Property="VerticalOptions" Value="End" />
<Setter Property="HorizontalOptions" Value="Start" />
<Setter Property="WidthRequest" Value="40" />
<Setter Property="BackgroundColor" Value="{ DynamicResource AccentColor }" />
</Style>
<!-- LAYOUT HELPERS -->
<Style x:Key="Spacer" TargetType="BoxView">
<Setter Property="BackgroundColor" Value="Transparent" />
</Style>
<Style x:Key="SpacerThemeShowCaseStyle" TargetType="BoxView" BasedOn="{ StaticResource Spacer }">
<Setter Property="HeightRequest" Value="20" />
</Style>
<Style x:Key="HorizontalRuleStyle" TargetType="BoxView">
<Setter Property="BackgroundColor" Value="{DynamicResource AccentColor}" />
<Setter Property="HeightRequest" Value="1" />
</Style>
<Style x:Key="ThemeShowCaseHorizontalRuleStyle" TargetType="BoxView" BasedOn="{ StaticResource HorizontalRuleStyle }">
<Setter Property="BackgroundColor" Value="{ DynamicResource BaseSeparatorColor }" />
<Setter Property="Margin" Value="0,28" />
</Style>
<Style x:Key="LoginPadding" TargetType="StackLayout">
<Setter Property="Padding" Value="40,0,40,0" />
</Style>
<!-- THEME -->
<Style TargetType="artina:CircleImage">
<Setter Property="WidthRequest" Value="50" />
<Setter Property="HeightRequest" Value="50" />
<Setter Property="BorderThickness" Value="3" />
<Setter Property="BorderColor" Value="{DynamicResource AccentColor}" />
</Style>
<Style x:Key="Avatar" TargetType="artina:CircleImage">
<Setter Property="WidthRequest" Value="50" />
<Setter Property="HeightRequest" Value="50" />
<Setter Property="BorderThickness" Value="3" />
<Setter Property="BorderColor" Value="{DynamicResource AccentColor}" />
</Style>
<Style x:Key="AvatarXSmall" TargetType="artina:CircleImage" BasedOn="{ StaticResource Avatar }">
<Setter Property="WidthRequest" Value="36" />
<Setter Property="HeightRequest" Value="36" />
<Setter Property="BorderThickness" Value="2" />
</Style>
<Style x:Key="AvatarSmall" TargetType="artina:CircleImage" BasedOn="{ StaticResource Avatar }">
<Setter Property="WidthRequest" Value="44" />
<Setter Property="HeightRequest" Value="44" />
</Style>
<Style x:Key="AvatarLarge" TargetType="artina:CircleImage" BasedOn="{ StaticResource Avatar }">
<Setter Property="WidthRequest" Value="110" />
<Setter Property="HeightRequest" Value="110" />
</Style>
<Style x:Key="GrialBaseIconShapeDemo" TargetType="Label" BasedOn="{ StaticResource FontIconBase }">
<Setter Property="TextColor" Value="{ DynamicResource AccentColor }" />
<Setter Property="FontSize" Value="24" />
</Style>
<Style x:Key="FontIconItemDemo" TargetType="Label" BasedOn="{ StaticResource FontIcon }">
<Setter Property="TextColor" Value="{ DynamicResource AccentColor }" />
<Setter Property="FontSize" Value="24" />
</Style>
<!-- ECOMMERCE -->
<Style x:Key="EcommerceProductGridBannerStyle" TargetType="StackLayout">
<Setter Property="HeightRequest" Value="120" />
<Setter Property="BackgroundColor" Value="{DynamicResource BrandColor}" />
</Style>
<!-- CUSTOM NAVBAR -->
<Style x:Key="CustomNavBarStyle" TargetType="Grid">
<Setter Property="BackgroundColor" Value="{ DynamicResource AccentColor }" />
<Setter Property="HeightRequest">
<Setter.Value>
<OnPlatform x:TypeArguments="x:Double" Android="56" iOS="64" />
</Setter.Value>
</Setter>
</Style>
<!--Dashboard Item Template-->
<Style x:Key="DashboardItemTemplateShape" TargetType="Label" BasedOn="{ StaticResource FontIconBase }">
<Setter Property="Text" Value="{ x:Static local:GrialShapesFont.Circle }" />
<Setter Property="FontSize">
<Setter.Value>
<OnIdiom x:TypeArguments="x:Double" Phone="60" Tablet="65" />
</Setter.Value>
</Setter>
<Setter Property="Opacity" Value="1" />
</Style>
<Style x:Key="DashboardItemTemplateIcon" TargetType="Label" BasedOn="{ StaticResource FontIcon }">
<Setter Property="FontSize">
<Setter.Value>
<OnIdiom x:TypeArguments="x:Double" Phone="25" Tablet="35" />
</Setter.Value>
</Setter>
<Setter Property="Opacity" Value="1" />
</Style>
<Style x:Key="DashboardVariantItemTemplateIcon" TargetType="Label" BasedOn="{ StaticResource FontIcon }">
<Setter Property="FontSize">
<Setter.Value>
<OnIdiom x:TypeArguments="x:Double" Phone="70" Tablet="85" />
</Setter.Value>
</Setter>
<Setter Property="Opacity" Value="1" />
</Style>
<x:Double x:Key="DashboardFlatSpacing">0</x:Double>
<Thickness x:Key="DashboardFlatPadding">0</Thickness>
<!--Dashboard Multiple Scroll-->
<OnIdiom x:TypeArguments="GridLength" Phone="250" Tablet="500" x:Key="DashboardMultipleScrollMainItemHeight" />
<OnIdiom x:TypeArguments="GridLength" Phone="134" Tablet="268" x:Key="DashboardMultipleScrollSecondaryItemRowHeight" />
<OnIdiom x:TypeArguments="GridLength" Phone="81" Tablet="162" x:Key="DashboardMultipleScrollSecondaryItemColumnWidth" />
<OnIdiom x:TypeArguments="LayoutOptions" Phone="FillAndExpand" Tablet="CenterAndExpand" x:Key="DashboardMultipleScrollMainItemVerticalAlignment" />
<OnIdiom x:TypeArguments="Thickness" Phone="20,30,20,20" Tablet="60" x:Key="DashboardMultipleScrollMainItemMargin" />
<OnIdiom x:TypeArguments="x:Double" Phone="20" Tablet="30" x:Key="DashboardMultipleScrollMainItemTitleFontSize" />
<OnIdiom x:TypeArguments="x:Double" Phone="14" Tablet="18" x:Key="DashboardMultipleScrollMainItemDescriptionFontSize" />
<OnIdiom x:TypeArguments="x:Double" Phone="10" Tablet="40" x:Key="DashboardMultipleScrollMainItemRowSpacing" />
<Style x:Key="DashboardMultipleScrollItemTitleStyle" TargetType="Label">
<Setter Property="Margin" Value="10,20,10,10" />
<Setter Property="FontSize" Value="16" />
<Setter Property="FontAttributes" Value="Bold" />
<Setter Property="TextColor" Value="{ DynamicResource BaseTextColor }" />
<Setter Property="VerticalTextAlignment" Value="End" />
</Style>
<Style x:Key="DashboardMultipleScrollResponsiveImageStyle" TargetType="Image">
<Setter Property="Aspect" Value="AspectFill" />
</Style>
<Style x:Key="DashboardMultipleScrollShimStyle" TargetType="Image">
<Setter Property="Source" Value="grialflix_main_item_gradient.png" />
<Setter Property="VerticalOptions" Value="FillAndExpand" />
<Setter Property="Aspect" Value="Fill" />
<Setter Property="Opacity" Value=".7" />
</Style>
<Style x:Key="DashboardMultipleScrollMainItemTitleStyle" TargetType="Label">
<Setter Property="TextColor" Value="{ DynamicResource OverImageTextColor }" />
<Setter Property="FontSize" Value="{ DynamicResource DashboardMultipleScrollMainItemTitleFontSize }" />
<Setter Property="FontAttributes" Value="Bold" />
</Style>
<Style x:Key="DashboardMultipleScrollMainItemDescriptionStyle" TargetType="Label">
<Setter Property="TextColor" Value="{ DynamicResource OverImageTextColor }" />
<Setter Property="FontSize" Value="{ DynamicResource DashboardMultipleScrollMainItemDescriptionFontSize }" />
<Setter Property="VerticalOptions" Value="FillAndExpand" />
</Style>
<Style x:Key="DashboardBadgeStyle" TargetType="VisualElement">
<Setter Property="effects:Effects.Shadow" Value="True" />
<Setter Property="effects:Effects.ShadowSize" Value="2" />
<Setter Property="effects:Effects.ShadowIOSColor" Value="#33000000" />
</Style>
<!-- MAIN MENU -->
<Style x:Key="IsNewRoundedLabelStyle" TargetType="local:RoundedLabel">
<Setter Property="Margin" Value="0,0,20,0" />
<Setter Property="RoundedLabelFontSize" Value="8" />
<Setter Property="RoundedLabelFontAttributes" Value="Bold" />
<Setter Property="RoundedLabelPadding" Value="6,4" />
<Setter Property="RoundedLabelTextColor" Value="{ DynamicResource InverseTextColor }" />
<Setter Property="RoundedLabelCornerRadius" Value="2" />
<Setter Property="HorizontalOptions" Value="End" />
<Setter Property="RoundedLabelBackgroundColor" Value="{ DynamicResource RoundedLabelBackgroundColor }" />
</Style>
<!-- CARDS -->
<OnPlatform x:TypeArguments="x:Double" x:Key="CardViewCornerRadius" Android="4" iOS="4" />
<!-- TAG LABEL -->
<OnPlatform x:TypeArguments="x:Double" x:Key="TagLabelCornerRadius" Android="6" iOS="6" />
<Style x:Key="CardViewStyle" TargetType="VisualElement">
<Setter Property="effects:Effects.CornerRadius" Value="{ DynamicResource CardViewCornerRadius }" />
<Setter Property="effects:Effects.Shadow" Value="True" />
<Setter Property="effects:Effects.ShadowSize" Value="5" />
<Setter Property="effects:Effects.ShadowIOSColor" Value="#77000000" />
</Style>
<Style x:Key="TagLabelStyle" TargetType="local:RoundedLabel">
<Setter Property="RoundedLabelCornerRadius" Value="{ DynamicResource TagLabelCornerRadius }" />
<Setter Property="RoundedLabelText" Value="{ Binding Section }" />
<Setter Property="RoundedLabelTextColor" Value="{ DynamicResource OverImageTextColor }" />
<Setter Property="RoundedLabelFontSize" Value="12" />
<Setter Property="RoundedLabelBackgroundColor" Value="{ DynamicResource TranslucidBlack }" />
</Style>
<!-- STATUS BAR GRADIENT -->
<Style x:Key="StatusBarShimStyle" TargetType="Image">
<Setter Property="Source" Value="status_bar_gradient.png" />
<Setter Property="VerticalOptions" Value="FillAndExpand" />
<Setter Property="HorizontalOptions" Value="FillAndExpand" />
<Setter Property="Aspect" Value="Fill" />
<Setter Property="Opacity" Value=".7" />
</Style>
<!-- CUSTOM CONVERTER -->
<local:AlternatingBackgroundColorConverter x:Key="ListBgConverter">
<x:Arguments>
<x:String>#FFd480d6,#FFd4a4d6,#FF62b9ae,#FF81b9ae,#ffa2c300,#FF9999b2,#FF999999</x:String>
</x:Arguments>
</local:AlternatingBackgroundColorConverter>
</ResourceDictionary>
</Application.Resources>
</ResourceDictionary>
</Application.Resources>
</Application>
......@@ -2,8 +2,6 @@
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace inutralia
......@@ -12,42 +10,42 @@ namespace inutralia
{
private List<Color> _Colors;
public AlternatingBackgroundColorConverter (string commaSeparatedColors)
public AlternatingBackgroundColorConverter(string commaSeparatedColors)
{
var conv = new ColorTypeConverter ();
var conv = new ColorTypeConverter();
string [] colors = commaSeparatedColors.Split (',');
string[] colors = commaSeparatedColors.Split(',');
_Colors = new List<Color> ();
_Colors = new List<Color>();
foreach (string s in colors)
{
try
{
if (s.Length > 0)
_Colors.Add ((Color) conv.ConvertFromInvariantString (s));
_Colors.Add((Color)conv.ConvertFromInvariantString(s));
}
catch (Exception)
{ }
} //endforeach
}
public object Convert (object value, Type targetType, object parameter, CultureInfo culture)
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
// Si no hay lista de colores o los parámetros no son correctos => transparente
if( (value == null) || (parameter == null) || (_Colors.Count < 1) )
if ((value == null) || (parameter == null) || (_Colors.Count < 1))
return Color.Transparent;
// Obtener índice del elemento en la lista
var index = ((ListView) parameter).ItemsSource.Cast<object> ().ToList ().IndexOf (value);
var index = ((ListView)parameter).ItemsSource.Cast<object>().ToList().IndexOf(value);
// Retornar el color que corresponda
return _Colors [index % _Colors.Count];
return _Colors[index % _Colors.Count];
}
public object ConvertBack (object value, Type targetType, object parameter, CultureInfo culture)
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException ();
throw new NotImplementedException();
}
}
}
......@@ -7,7 +7,6 @@ namespace inutralia
{
public class DateTransformator : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return DateUtilities.formatedDateFromTimeStamp((int)value, parameter != null ? parameter as string : culture.DateTimeFormat.ShortDatePattern);
......
......@@ -5,12 +5,11 @@ using Xamarin.Forms;
namespace inutralia.Converters
{
class ImageTransformator: IValueConverter
class ImageTransformator : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return ImageSource.FromStream (() => new MemoryStream(System.Convert.FromBase64String ((string)value)));
return ImageSource.FromStream(() => new MemoryStream(System.Convert.FromBase64String((string)value)));
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
......
namespace inutralia
{
public class FontAwesomeFont
{
public const string AccountCircle = "\ue853";
public const string ArrowDown = "\ue313";
public const string ArrowLeft = "\ue314";
public const string ArrowRight = "\ue315";
public const string ArrowUp = "\ue316";
public const string AttachFile = "\ue226";
public const string Build = "\ue869";
public const string BoldArrowDown = "\ue904";
public const string BoldArrowLeft = "\ue90c";
public const string BoldArrowRight = "\ue90d";
public const string BoldArrowUp = "\ue90e";
public const string CardAmericaExpress = "\ue90f";
public const string CardGiftcard = "\ue8f6";
public const string CardMastercard = "\ue911";
public const string CardPaypal = "\ue912";
public const string CardVisa = "\ue913";
public const string Carousel = "\ue8eb";
public const string Certificate = "\ue901";
public const string ChatBubble = "\ue0ca";
public const string Check = "\ue5ca";
public const string CheckBox = "\ue834";
public const string CheckCircle = "\ue86c";
public const string Circle = "\ue902";
public const string Close = "\ue5cd";
public const string Code = "\ue86f";
public const string ColorPalette = "\ue3b7";
public const string Copy = "\ue14d";
public const string Create = "\ue150";
public const string CreditCard = "\ue870";
public const string CurrentLandscape = "\ue0d3";
public const string CurrentPortrait = "\ue0d4";
public const string Cut = "\ue14e";
public const string Dashboard = "\ue871";
public const string DesktopMac = "\ue30b";
public const string DesktopWindows = "\ue30c";
public const string Email = "\ue0be";
public const string Error = "\ue910";
public const string Event = "\ue878";
public const string Eye = "\ue417";
public const string Favorite = "\ue87d";
public const string FavoriteBorder = "\ue87e";
public const string FlashOn = "\ue3e7";
public const string Folder = "\ue2c7";
public const string FolderOpen = "\ue2c8";
public const string Forum = "\ue926";
public const string Group = "\ue7ef";
public const string Help = "\ue887";
public const string Hexagon = "\ue903";
public const string Hourglass = "\ue88c";
public const string InsertFile = "\ue24d";
public const string InsertPhoto = "\ue251";
public const string Label = "\ue892";
public const string List = "\ue896";
public const string LocalMovies = "\ue54d";
public const string Lock = "\ue897";
public const string LogoAndroid = "\ue859";
public const string LogoApple = "\ue954";
public const string LogoGrial = "\ue933";
public const string LogoWindows = "\ue934";
public const string Loop = "\ue028";
public const string Menu = "\ue5d2";
public const string Module = "\ue8f0";
public const string Music = "\ue405";
public const string Notifications = "\ue914";
public const string OutlineCircle = "\ue905";
public const string OutlineCircles = "\ue906";
public const string OutlineThinCircle = "\ue907";
public const string Paste = "\ue14f";
public const string Person = "\ue7fd";
public const string PhoneAndroid = "\ue324";
public const string PhoneIphone = "\ue325";
public const string PhotoCamera = "\ue412";
public const string Place = "\ue55f";
public const string Power = "\ue8ac";
public const string Public = "\ue80b";
public const string QueryBuilder = "\ue8ae";
public const string RoundOutlineRectangle = "\ue908";
public const string RoundRectangle = "\ue909";
public const string RoundedRectangle = "\ue90a";
public const string School = "\ue80c";
public const string Search = "\ue8b6";
public const string Send = "\ue163";
public const string Settings = "\ue8b8";
public const string SettingsApplications = "\ue8b9";
public const string SettingsRestore = "\ue8ba";
public const string Share = "\ue80d";
public const string ShoppingCart = "\ue8cc";
public const string SocialFacebook = "\ue93f";
public const string SocialFacebookVariant = "\ue940";
public const string SocialGooglePlus = "\ue941";
public const string SocialInstagram = "\ue942";
public const string SocialLinkedin = "\ue943";
public const string SocialTwitter = "\ue944";
public const string SocialVimeo = "\ue945";
public const string SocialWhatsapp = "\ue946";
public const string SocialYoutube = "\ue948";
public const string SocialYoutubeVariant = "\ue947";
public const string Star = "\ue838";
public const string StarBorder = "\ue83a";
public const string StarHalf = "\ue839";
public const string Storage = "\ue1db";
public const string Tab = "\ue8d8";
public const string TabletAndroid = "\ue330";
public const string TabletMac = "\ue331";
public const string Tasks = "\ue1db";
public const string Triangle = "\ue90b";
public const string Tune = "\ue429";
public const string Warning = "\ue915";
public const string WebAsset = "\ue069";
public const string ZoomIn = "\ue8ff";
public const string ZoomOut = "\ue900";
}
public class FontAwesomeFont
{
public const string AccountCircle = "\ue853";
public const string ArrowDown = "\ue313";
public const string ArrowLeft = "\ue314";
public const string ArrowRight = "\ue315";
public const string ArrowUp = "\ue316";
public const string AttachFile = "\ue226";
public const string Build = "\ue869";
public const string BoldArrowDown = "\ue904";
public const string BoldArrowLeft = "\ue90c";
public const string BoldArrowRight = "\ue90d";
public const string BoldArrowUp = "\ue90e";
public const string CardAmericaExpress = "\ue90f";
public const string CardGiftcard = "\ue8f6";
public const string CardMastercard = "\ue911";
public const string CardPaypal = "\ue912";
public const string CardVisa = "\ue913";
public const string Carousel = "\ue8eb";
public const string Certificate = "\ue901";
public const string ChatBubble = "\ue0ca";
public const string Check = "\ue5ca";
public const string CheckBox = "\ue834";
public const string CheckCircle = "\ue86c";
public const string Circle = "\ue902";
public const string Close = "\ue5cd";
public const string Code = "\ue86f";
public const string ColorPalette = "\ue3b7";
public const string Copy = "\ue14d";
public const string Create = "\ue150";
public const string CreditCard = "\ue870";
public const string CurrentLandscape = "\ue0d3";
public const string CurrentPortrait = "\ue0d4";
public const string Cut = "\ue14e";
public const string Dashboard = "\ue871";
public const string DesktopMac = "\ue30b";
public const string DesktopWindows = "\ue30c";
public const string Email = "\ue0be";
public const string Error = "\ue910";
public const string Event = "\ue878";
public const string Eye = "\ue417";
public const string Favorite = "\ue87d";
public const string FavoriteBorder = "\ue87e";
public const string FlashOn = "\ue3e7";
public const string Folder = "\ue2c7";
public const string FolderOpen = "\ue2c8";
public const string Forum = "\ue926";
public const string Group = "\ue7ef";
public const string Help = "\ue887";
public const string Hexagon = "\ue903";
public const string Hourglass = "\ue88c";
public const string InsertFile = "\ue24d";
public const string InsertPhoto = "\ue251";
public const string Label = "\ue892";
public const string List = "\ue896";
public const string LocalMovies = "\ue54d";
public const string Lock = "\ue897";
public const string LogoAndroid = "\ue859";
public const string LogoApple = "\ue954";
public const string LogoGrial = "\ue933";
public const string LogoWindows = "\ue934";
public const string Loop = "\ue028";
public const string Menu = "\ue5d2";
public const string Module = "\ue8f0";
public const string Music = "\ue405";
public const string Notifications = "\ue914";
public const string OutlineCircle = "\ue905";
public const string OutlineCircles = "\ue906";
public const string OutlineThinCircle = "\ue907";
public const string Paste = "\ue14f";
public const string Person = "\ue7fd";
public const string PhoneAndroid = "\ue324";
public const string PhoneIphone = "\ue325";
public const string PhotoCamera = "\ue412";
public const string Place = "\ue55f";
public const string Power = "\ue8ac";
public const string Public = "\ue80b";
public const string QueryBuilder = "\ue8ae";
public const string RoundOutlineRectangle = "\ue908";
public const string RoundRectangle = "\ue909";
public const string RoundedRectangle = "\ue90a";
public const string School = "\ue80c";
public const string Search = "\ue8b6";
public const string Send = "\ue163";
public const string Settings = "\ue8b8";
public const string SettingsApplications = "\ue8b9";
public const string SettingsRestore = "\ue8ba";
public const string Share = "\ue80d";
public const string ShoppingCart = "\ue8cc";
public const string SocialFacebook = "\ue93f";
public const string SocialFacebookVariant = "\ue940";
public const string SocialGooglePlus = "\ue941";
public const string SocialInstagram = "\ue942";
public const string SocialLinkedin = "\ue943";
public const string SocialTwitter = "\ue944";
public const string SocialVimeo = "\ue945";
public const string SocialWhatsapp = "\ue946";
public const string SocialYoutube = "\ue948";
public const string SocialYoutubeVariant = "\ue947";
public const string Star = "\ue838";
public const string StarBorder = "\ue83a";
public const string StarHalf = "\ue839";
public const string Storage = "\ue1db";
public const string Tab = "\ue8d8";
public const string TabletAndroid = "\ue330";
public const string TabletMac = "\ue331";
public const string Tasks = "\ue1db";
public const string Triangle = "\ue90b";
public const string Tune = "\ue429";
public const string Warning = "\ue915";
public const string WebAsset = "\ue069";
public const string ZoomIn = "\ue8ff";
public const string ZoomOut = "\ue900";
}
}
namespace inutralia
{
public class GrialShapesFont
{
public const string AccountCircle = "\ue853";
public const string ArrowDown = "\ue313";
public const string ArrowLeft = "\ue314";
public const string ArrowRight = "\ue315";
public const string ArrowUp = "\ue316";
public const string AttachFile = "\ue226";
public const string Build = "\ue869";
public const string BoldArrowDown = "\ue904";
public const string BoldArrowLeft = "\ue90c";
public const string BoldArrowRight = "\ue90d";
public const string BoldArrowUp = "\ue90e";
public const string CardAmericaExpress = "\ue90f";
public const string CardGiftcard = "\ue8f6";
public const string CardMastercard = "\ue911";
public const string CardPaypal = "\ue912";
public const string CardVisa = "\ue913";
public const string Carousel = "\ue8eb";
public const string Certificate = "\ue901";
public const string ChatBubble = "\ue0ca";
public const string Check = "\ue5ca";
public const string CheckBox = "\ue834";
public const string CheckCircle = "\ue86c";
public const string Circle = "\ue902";
public const string Close = "\ue5cd";
public const string Code = "\ue86f";
public const string ColorPalette = "\ue3b7";
public const string Copy = "\ue14d";
public const string Create = "\ue150";
public const string CreditCard = "\ue870";
public const string CurrentLandscape = "\ue0d3";
public const string CurrentPortrait = "\ue0d4";
public const string Cut = "\ue14e";
public const string Dashboard = "\ue871";
public const string DesktopMac = "\ue30b";
public const string DesktopWindows = "\ue30c";
public const string Email = "\ue0be";
public const string Error = "\ue910";
public const string Event = "\ue878";
public const string Eye = "\ue417";
public const string Favorite = "\ue87d";
public const string FavoriteBorder = "\ue87e";
public const string FlashOn = "\ue3e7";
public const string Folder = "\ue2c7";
public const string FolderOpen = "\ue2c8";
public const string Forum = "\ue926";
public const string Group = "\ue7ef";
public const string Help = "\ue887";
public const string Hexagon = "\ue903";
public const string Hourglass = "\ue88c";
public const string InsertFile = "\ue24d";
public const string InsertPhoto = "\ue251";
public const string Label = "\ue892";
public const string List = "\ue896";
public const string LocalMovies = "\ue54d";
public const string Lock = "\ue897";
public const string LogoAndroid = "\ue859";
public const string LogoApple = "\ue954";
public const string LogoGrial = "\ue933";
public const string LogoWindows = "\ue934";
public const string Loop = "\ue028";
public const string Menu = "\ue5d2";
public const string Module = "\ue8f0";
public const string Music = "\ue405";
public const string Notifications = "\ue914";
public const string OutlineCircle = "\ue905";
public const string OutlineCircles = "\ue906";
public const string OutlineThinCircle = "\ue907";
public const string Paste = "\ue14f";
public const string Person = "\ue7fd";
public const string PhoneAndroid = "\ue324";
public const string PhoneIphone = "\ue325";
public const string PhotoCamera = "\ue412";
public const string Place = "\ue55f";
public const string Power = "\ue8ac";
public const string Public = "\ue80b";
public const string QueryBuilder = "\ue8ae";
public const string RoundOutlineRectangle = "\ue908";
public const string RoundRectangle = "\ue909";
public const string RoundedRectangle = "\ue90a";
public const string School = "\ue80c";
public const string Search = "\ue8b6";
public const string Send = "\ue163";
public const string Settings = "\ue8b8";
public const string SettingsApplications = "\ue8b9";
public const string SettingsRestore = "\ue8ba";
public const string Share = "\ue80d";
public const string ShoppingCart = "\ue8cc";
public const string SocialFacebook = "\ue93f";
public const string SocialFacebookVariant = "\ue940";
public const string SocialGooglePlus = "\ue941";
public const string SocialInstagram = "\ue942";
public const string SocialLinkedin = "\ue943";
public const string SocialTwitter = "\ue944";
public const string SocialVimeo = "\ue945";
public const string SocialWhatsapp = "\ue946";
public const string SocialYoutube = "\ue948";
public const string SocialYoutubeVariant = "\ue947";
public const string Star = "\ue838";
public const string StarBorder = "\ue83a";
public const string StarHalf = "\ue839";
public const string Storage = "\ue1db";
public const string Tab = "\ue8d8";
public const string TabletAndroid = "\ue330";
public const string TabletMac = "\ue331";
public const string Tasks = "\ue1db";
public const string Triangle = "\ue90b";
public const string Tune = "\ue429";
public const string Warning = "\ue915";
public const string WebAsset = "\ue069";
public const string Whatshot = "\ue029";
public const string ZoomIn = "\ue8ff";
public const string ZoomOut = "\ue900";
public const string IpadStrokeDevice = "\ue916";
public const string IphoneStrokeDevice = "\ue917";
public const string AndroidPhoneStrokeDevice = "\ue918";
public const string AndroidTabletStrokeDevice = "\ue919";
public const string LogoLottie = "\ue91a";
public const string LogoVisualStudio = "\ue91b";
public const string LogoXamarinStudio = "\ue91c";
public const string LogoUxdivers = "\ue91d";
}
public class GrialShapesFont
{
public const string AccountCircle = "\ue853";
public const string ArrowDown = "\ue313";
public const string ArrowLeft = "\ue314";
public const string ArrowRight = "\ue315";
public const string ArrowUp = "\ue316";
public const string AttachFile = "\ue226";
public const string Build = "\ue869";
public const string BoldArrowDown = "\ue904";
public const string BoldArrowLeft = "\ue90c";
public const string BoldArrowRight = "\ue90d";
public const string BoldArrowUp = "\ue90e";
public const string CardAmericaExpress = "\ue90f";
public const string CardGiftcard = "\ue8f6";
public const string CardMastercard = "\ue911";
public const string CardPaypal = "\ue912";
public const string CardVisa = "\ue913";
public const string Carousel = "\ue8eb";
public const string Certificate = "\ue901";
public const string ChatBubble = "\ue0ca";
public const string Check = "\ue5ca";
public const string CheckBox = "\ue834";
public const string CheckCircle = "\ue86c";
public const string Circle = "\ue902";
public const string Close = "\ue5cd";
public const string Code = "\ue86f";
public const string ColorPalette = "\ue3b7";
public const string Copy = "\ue14d";
public const string Create = "\ue150";
public const string CreditCard = "\ue870";
public const string CurrentLandscape = "\ue0d3";
public const string CurrentPortrait = "\ue0d4";
public const string Cut = "\ue14e";
public const string Dashboard = "\ue871";
public const string DesktopMac = "\ue30b";
public const string DesktopWindows = "\ue30c";
public const string Email = "\ue0be";
public const string Error = "\ue910";
public const string Event = "\ue878";
public const string Eye = "\ue417";
public const string Favorite = "\ue87d";
public const string FavoriteBorder = "\ue87e";
public const string FlashOn = "\ue3e7";
public const string Folder = "\ue2c7";
public const string FolderOpen = "\ue2c8";
public const string Forum = "\ue926";
public const string Group = "\ue7ef";
public const string Help = "\ue887";
public const string Hexagon = "\ue903";
public const string Hourglass = "\ue88c";
public const string InsertFile = "\ue24d";
public const string InsertPhoto = "\ue251";
public const string Label = "\ue892";
public const string List = "\ue896";
public const string LocalMovies = "\ue54d";
public const string Lock = "\ue897";
public const string LogoAndroid = "\ue859";
public const string LogoApple = "\ue954";
public const string LogoGrial = "\ue933";
public const string LogoWindows = "\ue934";
public const string Loop = "\ue028";
public const string Menu = "\ue5d2";
public const string Module = "\ue8f0";
public const string Music = "\ue405";
public const string Notifications = "\ue914";
public const string OutlineCircle = "\ue905";
public const string OutlineCircles = "\ue906";
public const string OutlineThinCircle = "\ue907";
public const string Paste = "\ue14f";
public const string Person = "\ue7fd";
public const string PhoneAndroid = "\ue324";
public const string PhoneIphone = "\ue325";
public const string PhotoCamera = "\ue412";
public const string Place = "\ue55f";
public const string Power = "\ue8ac";
public const string Public = "\ue80b";
public const string QueryBuilder = "\ue8ae";
public const string RoundOutlineRectangle = "\ue908";
public const string RoundRectangle = "\ue909";
public const string RoundedRectangle = "\ue90a";
public const string School = "\ue80c";
public const string Search = "\ue8b6";
public const string Send = "\ue163";
public const string Settings = "\ue8b8";
public const string SettingsApplications = "\ue8b9";
public const string SettingsRestore = "\ue8ba";
public const string Share = "\ue80d";
public const string ShoppingCart = "\ue8cc";
public const string SocialFacebook = "\ue93f";
public const string SocialFacebookVariant = "\ue940";
public const string SocialGooglePlus = "\ue941";
public const string SocialInstagram = "\ue942";
public const string SocialLinkedin = "\ue943";
public const string SocialTwitter = "\ue944";
public const string SocialVimeo = "\ue945";
public const string SocialWhatsapp = "\ue946";
public const string SocialYoutube = "\ue948";
public const string SocialYoutubeVariant = "\ue947";
public const string Star = "\ue838";
public const string StarBorder = "\ue83a";
public const string StarHalf = "\ue839";
public const string Storage = "\ue1db";
public const string Tab = "\ue8d8";
public const string TabletAndroid = "\ue330";
public const string TabletMac = "\ue331";
public const string Tasks = "\ue1db";
public const string Triangle = "\ue90b";
public const string Tune = "\ue429";
public const string Warning = "\ue915";
public const string WebAsset = "\ue069";
public const string Whatshot = "\ue029";
public const string ZoomIn = "\ue8ff";
public const string ZoomOut = "\ue900";
public const string IpadStrokeDevice = "\ue916";
public const string IphoneStrokeDevice = "\ue917";
public const string AndroidPhoneStrokeDevice = "\ue918";
public const string AndroidTabletStrokeDevice = "\ue919";
public const string LogoLottie = "\ue91a";
public const string LogoVisualStudio = "\ue91b";
public const string LogoXamarinStudio = "\ue91c";
public const string LogoUxdivers = "\ue91d";
}
}
using System;
namespace inutralia
{
// Ionicons v2.0.0 Cheatsheet, 733 icons:
// Reference: http://ionicons.com/cheatsheet.html
// Ionicons v2.0.0 Cheatsheet, 733 icons:
// Reference: http://ionicons.com/cheatsheet.html
public class IoniciconsFont
{
public const string Alert = "\uf101";
public const string AlertCircled = "\uf100";
public const string AndroidAdd = "\uf2c7";
public const string AndroidAddCircle = "\uf359";
public const string AndroidAlarmClock = "\uf35a";
public const string AndroidAlert = "\uf35b";
public const string AndroidApps = "\uf35c";
public const string AndroidArchive = "\uf2c9";
public const string AndroidArrowBack = "\uf2ca";
public const string AndroidArrowDown = "\uf35d";
public const string AndroidArrowDropdown = "\uf35f";
public const string AndroidArrowDropdownCircle = "\uf35e";
public const string AndroidArrowDropleft = "\uf361";
public const string AndroidArrowDropleftCircle = "\uf360";
public const string AndroidArrowDropright = "\uf363";
public const string AndroidArrowDroprightCircle = "\uf362";
public const string AndroidArrowDropup = "\uf365";
public const string AndroidArrowDropupCircle = "\uf364";
public const string AndroidArrowForward = "\uf30f";
public const string AndroidArrowUp = "\uf366";
public const string AndroidAttach = "\uf367";
public const string AndroidBar = "\uf368";
public const string AndroidBicycle = "\uf369";
public const string AndroidBoat = "\uf36a";
public const string AndroidBookmark = "\uf36b";
public const string AndroidBulb = "\uf36c";
public const string AndroidBus = "\uf36d";
public const string AndroidCalendar = "\uf2d1";
public const string AndroidCall = "\uf2d2";
public const string AndroidCamera = "\uf2d3";
public const string AndroidCancel = "\uf36e";
public const string AndroidCar = "\uf36f";
public const string AndroidCart = "\uf370";
public const string AndroidChat = "\uf2d4";
public const string AndroidCheckbox = "\uf374";
public const string AndroidCheckboxBlank = "\uf371";
public const string AndroidCheckboxOutline = "\uf373";
public const string AndroidCheckboxOutlineBlank = "\uf372";
public const string AndroidCheckmarkCircle = "\uf375";
public const string AndroidClipboard = "\uf376";
public const string AndroidClose = "\uf2d7";
public const string AndroidCloud = "\uf37a";
public const string AndroidCloudCircle = "\uf377";
public const string AndroidCloudDone = "\uf378";
public const string AndroidCloudOutline = "\uf379";
public const string AndroidColorPalette = "\uf37b";
public const string AndroidCompass = "\uf37c";
public const string AndroidContact = "\uf2d8";
public const string AndroidContacts = "\uf2d9";
public const string AndroidContract = "\uf37d";
public const string AndroidCreate = "\uf37e";
public const string AndroidDelete = "\uf37f";
public const string AndroidDesktop = "\uf380";
public const string AndroidDocument = "\uf381";
public const string AndroidDone = "\uf383";
public const string AndroidDoneAll = "\uf382";
public const string AndroidDownload = "\uf2dd";
public const string AndroidDrafts = "\uf384";
public const string AndroidExit = "\uf385";
public const string AndroidExpand = "\uf386";
public const string AndroidFavorite = "\uf388";
public const string AndroidFavoriteOutline = "\uf387";
public const string AndroidFilm = "\uf389";
public const string AndroidFolder = "\uf2e0";
public const string AndroidFolderOpen = "\uf38a";
public const string AndroidFunnel = "\uf38b";
public const string AndroidGlobe = "\uf38c";
public const string AndroidHand = "\uf2e3";
public const string AndroidHangout = "\uf38d";
public const string AndroidHappy = "\uf38e";
public const string AndroidHome = "\uf38f";
public const string AndroidImage = "\uf2e4";
public const string AndroidLaptop = "\uf390";
public const string AndroidList = "\uf391";
public const string AndroidLocate = "\uf2e9";
public const string AndroidLock = "\uf392";
public const string AndroidMail = "\uf2eb";
public const string AndroidMap = "\uf393";
public const string AndroidMenu = "\uf394";
public const string AndroidMicrophone = "\uf2ec";
public const string AndroidMicrophoneOff = "\uf395";
public const string AndroidMoreHorizontal = "\uf396";
public const string AndroidMoreVertical = "\uf397";
public const string AndroidNavigate = "\uf398";
public const string AndroidNotifications = "\uf39b";
public const string AndroidNotificationsNone = "\uf399";
public const string AndroidNotificationsOff = "\uf39a";
public const string AndroidOpen = "\uf39c";
public const string AndroidOptions = "\uf39d";
public const string AndroidPeople = "\uf39e";
public const string AndroidPerson = "\uf3a0";
public const string AndroidPersonAdd = "\uf39f";
public const string AndroidPhoneLandscape = "\uf3a1";
public const string AndroidPhonePortrait = "\uf3a2";
public const string AndroidPin = "\uf3a3";
public const string AndroidPlane = "\uf3a4";
public const string AndroidPlaystore = "\uf2f0";
public const string AndroidPrint = "\uf3a5";
public const string AndroidRadioButtonOff = "\uf3a6";
public const string AndroidRadioButtonOn = "\uf3a7";
public const string AndroidRefresh = "\uf3a8";
public const string AndroidRemove = "\uf2f4";
public const string AndroidRemoveCircle = "\uf3a9";
public const string AndroidRestaurant = "\uf3aa";
public const string AndroidSad = "\uf3ab";
public const string AndroidSearch = "\uf2f5";
public const string AndroidSend = "\uf2f6";
public const string AndroidSettings = "\uf2f7";
public const string AndroidShare = "\uf2f8";
public const string AndroidShareAlt = "\uf3ac";
public const string AndroidStar = "\uf2fc";
public const string AndroidStarHalf = "\uf3ad";
public const string AndroidStarOutline = "\uf3ae";
public const string AndroidStopwatch = "\uf2fd";
public const string AndroidSubway = "\uf3af";
public const string AndroidSunny = "\uf3b0";
public const string AndroidSync = "\uf3b1";
public const string AndroidTextsms = "\uf3b2";
public const string AndroidTime = "\uf3b3";
public const string AndroidTrain = "\uf3b4";
public const string AndroidUnlock = "\uf3b5";
public const string AndroidUpload = "\uf3b6";
public const string AndroidVolumeDown = "\uf3b7";
public const string AndroidVolumeMute = "\uf3b8";
public const string AndroidVolumeOff = "\uf3b9";
public const string AndroidVolumeUp = "\uf3ba";
public const string AndroidWalk = "\uf3bb";
public const string AndroidWarning = "\uf3bc";
public const string AndroidWatch = "\uf3bd";
public const string AndroidWifi = "\uf305";
public const string Aperture = "\uf313";
public const string Archive = "\uf102";
public const string ArrowDownA = "\uf103";
public const string ArrowDownB = "\uf104";
public const string ArrowDownC = "\uf105";
public const string ArrowExpand = "\uf25e";
public const string ArrowGraphDownLeft = "\uf25f";
public const string ArrowGraphDownRight = "\uf260";
public const string ArrowGraphUpLeft = "\uf261";
public const string ArrowGraphUpRight = "\uf262";
public const string ArrowLeftA = "\uf106";
public const string ArrowLeftB = "\uf107";
public const string ArrowLeftC = "\uf108";
public const string ArrowMove = "\uf263";
public const string ArrowResize = "\uf264";
public const string ArrowReturnLeft = "\uf265";
public const string ArrowReturnRight = "\uf266";
public const string ArrowRightA = "\uf109";
public const string ArrowRightB = "\uf10a";
public const string ArrowRightC = "\uf10b";
public const string ArrowShrink = "\uf267";
public const string ArrowSwap = "\uf268";
public const string ArrowUpA = "\uf10c";
public const string ArrowUpB = "\uf10d";
public const string ArrowUpC = "\uf10e";
public const string Asterisk = "\uf314";
public const string At = "\uf10f";
public const string Backspace = "\uf3bf";
public const string BackspaceOutline = "\uf3be";
public const string Bag = "\uf110";
public const string BatteryCharging = "\uf111";
public const string BatteryEmpty = "\uf112";
public const string BatteryFull = "\uf113";
public const string BatteryHalf = "\uf114";
public const string BatteryLow = "\uf115";
public const string Beaker = "\uf269";
public const string Beer = "\uf26a";
public const string Bluetooth = "\uf116";
public const string Bonfire = "\uf315";
public const string Bookmark = "\uf26b";
public const string Bowtie = "\uf3c0";
public const string Briefcase = "\uf26c";
public const string Bug = "\uf2be";
public const string Calculator = "\uf26d";
public const string Calendar = "\uf117";
public const string Camera = "\uf118";
public const string Card = "\uf119";
public const string Cash = "\uf316";
public const string Chatbox = "\uf11b";
public const string ChatboxWorking = "\uf11a";
public const string Chatboxes = "\uf11c";
public const string Chatbubble = "\uf11e";
public const string ChatbubbleWorking = "\uf11d";
public const string Chatbubbles = "\uf11f";
public const string Checkmark = "\uf122";
public const string CheckmarkCircled = "\uf120";
public const string CheckmarkRound = "\uf121";
public const string ChevronDown = "\uf123";
public const string ChevronLeft = "\uf124";
public const string ChevronRight = "\uf125";
public const string ChevronUp = "\uf126";
public const string Clipboard = "\uf127";
public const string Clock = "\uf26e";
public const string Close = "\uf12a";
public const string CloseCircled = "\uf128";
public const string CloseRound = "\uf129";
public const string ClosedCaptioning = "\uf317";
public const string Cloud = "\uf12b";
public const string Code = "\uf271";
public const string CodeDownload = "\uf26f";
public const string CodeWorking = "\uf270";
public const string Coffee = "\uf272";
public const string Compass = "\uf273";
public const string Compose = "\uf12c";
public const string ConnectionBars = "\uf274";
public const string Contrast = "\uf275";
public const string Crop = "\uf3c1";
public const string Cube = "\uf318";
public const string Disc = "\uf12d";
public const string Document = "\uf12f";
public const string DocumentText = "\uf12e";
public const string Drag = "\uf130";
public const string Earth = "\uf276";
public const string Easel = "\uf3c2";
public const string Edit = "\uf2bf";
public const string Egg = "\uf277";
public const string Eject = "\uf131";
public const string Email = "\uf132";
public const string EmailUnread = "\uf3c3";
public const string ErlenmeyerFlask = "\uf3c5";
public const string ErlenmeyerFlaskBubbles = "\uf3c4";
public const string Eye = "\uf133";
public const string EyeDisabled = "\uf306";
public const string Eemale = "\uf278";
public const string Filing = "\uf134";
public const string FilmMarker = "\uf135";
public const string Fireball = "\uf319";
public const string Flag = "\uf279";
public const string Flame = "\uf31a";
public const string Flash = "\uf137";
public const string FlashOff = "\uf136";
public const string Folder = "\uf139";
public const string Fork = "\uf27a";
public const string ForkRepo = "\uf2c0";
public const string Forward = "\uf13a";
public const string Funnel = "\uf31b";
public const string GearA = "\uf13d";
public const string GearB = "\uf13e";
public const string Grid = "\uf13f";
public const string Hammer = "\uf27b";
public const string Happy = "\uf31c";
public const string HappyOutline = "\uf3c6";
public const string Headphone = "\uf140";
public const string Heart = "\uf141";
public const string HeartBroken = "\uf31d";
public const string Help = "\uf143";
public const string HelpBuoy = "\uf27c";
public const string HelpCircled = "\uf142";
public const string Home = "\uf144";
public const string Icecream = "\uf27d";
public const string Image = "\uf147";
public const string Images = "\uf148";
public const string Information = "\uf14a";
public const string InformationCircled = "\uf149";
public const string Ionic = "\uf14b";
public const string IosAlarm = "\uf3c8";
public const string IosAlarmOutline = "\uf3c7";
public const string IosAlbums = "\uf3ca";
public const string IosAlbumsOutline = "\uf3c9";
public const string IosAmericanfootball = "\uf3cc";
public const string IosAmericanfootballOutline = "\uf3cb";
public const string IosAnalytics = "\uf3ce";
public const string IosAnalyticsOutline = "\uf3cd";
public const string IosArrowBack = "\uf3cf";
public const string IosArrowDown = "\uf3d0";
public const string IosArrowForward = "\uf3d1";
public const string IosArrowLeft = "\uf3d2";
public const string IosArrowRight = "\uf3d3";
public const string IosArrowThinDown = "\uf3d4";
public const string IosArrowThinLeft = "\uf3d5";
public const string IosArrowThinRight = "\uf3d6";
public const string IosArrowThinUp = "\uf3d7";
public const string IosArrowUp = "\uf3d8";
public const string IosAt = "\uf3da";
public const string IosAtOutline = "\uf3d9";
public const string IosBarcode = "\uf3dc";
public const string IosBarcodeOutline = "\uf3db";
public const string IosBaseball = "\uf3de";
public const string IosBaseballOutline = "\uf3dd";
public const string IosBasketball = "\uf3e0";
public const string IosBasketballOutline = "\uf3df";
public const string IosBell = "\uf3e2";
public const string IosBellOutline = "\uf3e1";
public const string IosBody = "\uf3e4";
public const string IosBodyOutline = "\uf3e3";
public const string IosBolt = "\uf3e6";
public const string IosBoltOutline = "\uf3e5";
public const string IosBook = "\uf3e8";
public const string IosBookOutline = "\uf3e7";
public const string IosBookmarks = "\uf3ea";
public const string IosBookmarksOutline = "\uf3e9";
public const string IosBox = "\uf3ec";
public const string IosBoxOutline = "\uf3eb";
public const string IosBriefcase = "\uf3ee";
public const string IosBriefcaseOutline = "\uf3ed";
public const string IosBrowsers = "\uf3f0";
public const string IosBrowsersOutline = "\uf3ef";
public const string IosCalculator = "\uf3f2";
public const string IosCalculatorOutline = "\uf3f1";
public const string IosCalendar = "\uf3f4";
public const string IosCalendarOutline = "\uf3f3";
public const string IosCamera = "\uf3f6";
public const string IosCameraOutline = "\uf3f5";
public const string IosCart = "\uf3f8";
public const string IosCartOutline = "\uf3f7";
public const string IosChatboxes = "\uf3fa";
public const string IosChatboxesOutline = "\uf3f9";
public const string IosChatbubble = "\uf3fc";
public const string IosChatbubbleOutline = "\uf3fb";
public const string IosCheckmark = "\uf3ff";
public const string IosCheckmarkEmpty = "\uf3fd";
public const string IosCheckmarkOutline = "\uf3fe";
public const string IosCircleFilled = "\uf400";
public const string IosCircleOutline = "\uf401";
public const string IosClock = "\uf403";
public const string IosClockOutline = "\uf402";
public const string IosClose = "\uf406";
public const string IosCloseEmpty = "\uf404";
public const string IosCloseOutline = "\uf405";
public const string IosCloud = "\uf40c";
public const string IosCloudDownload = "\uf408";
public const string IosCloudDownloadOutline = "\uf407";
public const string IosCloudOutline = "\uf409";
public const string IosCloudUpload = "\uf40b";
public const string IosCloudUploadOutline = "\uf40a";
public const string IosCloudy = "\uf410";
public const string IosCloudyNight = "\uf40e";
public const string IosCloudyNightOutline = "\uf40d";
public const string IosCloudyOutline = "\uf40f";
public const string IosCog = "\uf412";
public const string IosCogOutline = "\uf411";
public const string IosColorFilter = "\uf414";
public const string IosColorFilterOutline = "\uf413";
public const string IosColorWand = "\uf416";
public const string IosColorWandOutline = "\uf415";
public const string IosCompose = "\uf418";
public const string IosComposeOutline = "\uf417";
public const string IosContact = "\uf41a";
public const string IosContactOutline = "\uf419";
public const string IosCopy = "\uf41c";
public const string IosCopyOutline = "\uf41b";
public const string IosCrop = "\uf41e";
public const string IosCropStrong = "\uf41d";
public const string IosDownload = "\uf420";
public const string IosDownloadOutline = "\uf41f";
public const string IosDrag = "\uf421";
public const string IosEmail = "\uf423";
public const string IosEmailOutline = "\uf422";
public const string IosEye = "\uf425";
public const string IosEyeOutline = "\uf424";
public const string IosFastforward = "\uf427";
public const string IosFastforwardOutline = "\uf426";
public const string IosFiling = "\uf429";
public const string IosFilingOutline = "\uf428";
public const string IosFilm = "\uf42b";
public const string IosFilmOutline = "\uf42a";
public const string IosFlag = "\uf42d";
public const string IosFlagOutline = "\uf42c";
public const string IosFlame = "\uf42f";
public const string IosFlameOutline = "\uf42e";
public const string IosFlask = "\uf431";
public const string IosFlaskOutline = "\uf430";
public const string IosFlower = "\uf433";
public const string IosFlowerOutline = "\uf432";
public const string IosFolder = "\uf435";
public const string IosFolderOutline = "\uf434";
public const string IosFootball = "\uf437";
public const string IosFootballOutline = "\uf436";
public const string IosGameControllerA = "\uf439";
public const string IosGameControllerAOutline = "\uf438";
public const string IosGameControllerB = "\uf43b";
public const string IosGameControllerBOutline = "\uf43a";
public const string IosGear = "\uf43d";
public const string IosGearOutline = "\uf43c";
public const string IosGlasses = "\uf43f";
public const string IosGlassesOutline = "\uf43e";
public const string IosGridView = "\uf441";
public const string IosGridViewOutline = "\uf440";
public const string IosHeart = "\uf443";
public const string IosHeartOutline = "\uf442";
public const string IosHelp = "\uf446";
public const string IosHelpEmpty = "\uf444";
public const string IosHelpOutline = "\uf445";
public const string IosHome = "\uf448";
public const string IosHomeOutline = "\uf447";
public const string IosInfinite = "\uf44a";
public const string IosInfiniteOutline = "\uf449";
public const string IosInformation = "\uf44d";
public const string IosInformationEmpty = "\uf44b";
public const string IosInformationOutline = "\uf44c";
public const string IosIonicOutline = "\uf44e";
public const string IosKeypad = "\uf450";
public const string IosKeypadOutline = "\uf44f";
public const string IosLightbulb = "\uf452";
public const string IosLightbulbOutline = "\uf451";
public const string IosList = "\uf454";
public const string IosListOutline = "\uf453";
public const string IosLocation = "\uf456";
public const string IosLocationOutline = "\uf455";
public const string IosLocked = "\uf458";
public const string IosLockedOutline = "\uf457";
public const string IosLoop = "\uf45a";
public const string IosLoopStrong = "\uf459";
public const string IosMedical = "\uf45c";
public const string IosMedicalOutline = "\uf45b";
public const string IosMedkit = "\uf45e";
public const string IosMedkitOutline = "\uf45d";
public const string IosMic = "\uf461";
public const string IosMicOff = "\uf45f";
public const string IosMicOutline = "\uf460";
public const string IosMinus = "\uf464";
public const string IosMinusEmpty = "\uf462";
public const string IosMinusOutline = "\uf463";
public const string IosMonitor = "\uf466";
public const string IosMonitorOutline = "\uf465";
public const string IosMoon = "\uf468";
public const string IosMoonOutline = "\uf467";
public const string IosMore = "\uf46a";
public const string IosMoreOutline = "\uf469";
public const string IosMusicalNote = "\uf46b";
public const string IosMusicalNotes = "\uf46c";
public const string IosNavigate = "\uf46e";
public const string IosNavigateOutline = "\uf46d";
public const string IosNutrition = "\uf470";
public const string IosNutritionOutline = "\uf46f";
public const string IosPaper = "\uf472";
public const string IosPaperOutline = "\uf471";
public const string IosPaperplane = "\uf474";
public const string IosPaperplaneOutline = "\uf473";
public const string IosPartlysunny = "\uf476";
public const string IosPartlysunnyOutline = "\uf475";
public const string IosPause = "\uf478";
public const string IosPauseOutline = "\uf477";
public const string IosPaw = "\uf47a";
public const string IosPawOutline = "\uf479";
public const string IosPeople = "\uf47c";
public const string IosPeopleOutline = "\uf47b";
public const string IosPerson = "\uf47e";
public const string IosPersonOutline = "\uf47d";
public const string IosPersonadd = "\uf480";
public const string IosPersonaddOutline = "\uf47f";
public const string IosPhotos = "\uf482";
public const string IosPhotosOutline = "\uf481";
public const string IosPie = "\uf484";
public const string IosPieOutline = "\uf483";
public const string IosPint = "\uf486";
public const string IosPintOutline = "\uf485";
public const string IosPlay = "\uf488";
public const string IosPlayOutline = "\uf487";
public const string IosPlus = "\uf48b";
public const string IosPlusEmpty = "\uf489";
public const string IosPlusOutline = "\uf48a";
public const string IosPricetag = "\uf48d";
public const string IosPricetagOutline = "\uf48c";
public const string IosPricetags = "\uf48f";
public const string IosPricetagsOutline = "\uf48e";
public const string IosPrinter = "\uf491";
public const string IosPrinterOutline = "\uf490";
public const string IosPulse = "\uf493";
public const string IosPulseStrong = "\uf492";
public const string IosRainy = "\uf495";
public const string IosRainyOutline = "\uf494";
public const string IosRecording = "\uf497";
public const string IosRecordingOutline = "\uf496";
public const string IosRedo = "\uf499";
public const string IosRedoOutline = "\uf498";
public const string IosRefresh = "\uf49c";
public const string IosRefreshEmpty = "\uf49a";
public const string IosRefreshOutline = "\uf49b";
public const string IosReload = "\uf49d";
public const string IosReverseCamera = "\uf49f";
public const string IosReverseCameraOutline = "\uf49e";
public const string IosRewind = "\uf4a1";
public const string IosRewindOutline = "\uf4a0";
public const string IosRose = "\uf4a3";
public const string IosRoseOutline = "\uf4a2";
public const string IosSearch = "\uf4a5";
public const string IosSearchStrong = "\uf4a4";
public const string IosSettings = "\uf4a7";
public const string IosSettingsStrong = "\uf4a6";
public const string IosShuffle = "\uf4a9";
public const string IosShuffleStrong = "\uf4a8";
public const string IosSkipbackward = "\uf4ab";
public const string IosSkipbackwardOutline = "\uf4aa";
public const string IosSkipforward = "\uf4ad";
public const string IosSkipforwardOutline = "\uf4ac";
public const string IosSnowy = "\uf4ae";
public const string IosSpeedometer = "\uf4b0";
public const string IosSpeedometerOutline = "\uf4af";
public const string IosStar = "\uf4b3";
public const string IosStarHalf = "\uf4b1";
public const string IosStarOutline = "\uf4b2";
public const string IosStopwatch = "\uf4b5";
public const string IosStopwatchOutline = "\uf4b4";
public const string IosSunny = "\uf4b7";
public const string IosSunnyOutline = "\uf4b6";
public const string IosTelephone = "\uf4b9";
public const string IosTelephoneOutline = "\uf4b8";
public const string IosTennisball = "\uf4bb";
public const string IosTennisballOutline = "\uf4ba";
public const string IosThunderstorm = "\uf4bd";
public const string IosThunderstormOutline = "\uf4bc";
public const string IosTime = "\uf4bf";
public const string IosTimeOutline = "\uf4be";
public const string IosTimer = "\uf4c1";
public const string IosTimerOutline = "\uf4c0";
public const string IosToggle = "\uf4c3";
public const string IosToggleOutline = "\uf4c2";
public const string IosTrash = "\uf4c5";
public const string IosTrashOutline = "\uf4c4";
public const string IosUndo = "\uf4c7";
public const string IosUndoOutline = "\uf4c6";
public const string IosUnlocked = "\uf4c9";
public const string IosUnlockedOutline = "\uf4c8";
public const string IosUpload = "\uf4cb";
public const string IosUploadOutline = "\uf4ca";
public const string IosVideocam = "\uf4cd";
public const string IosVideocamOutline = "\uf4cc";
public const string IosVolumeHigh = "\uf4ce";
public const string IosVolumeLow = "\uf4cf";
public const string IosWineglass = "\uf4d1";
public const string IosWineglassOutline = "\uf4d0";
public const string IosWorld = "\uf4d3";
public const string IosWorldOutline = "\uf4d2";
public const string Ipad = "\uf1f9";
public const string Iphone = "\uf1fa";
public const string Ipod = "\uf1fb";
public const string Jet = "\uf295";
public const string Key = "\uf296";
public const string Knife = "\uf297";
public const string Laptop = "\uf1fc";
public const string Leaf = "\uf1fd";
public const string Levels = "\uf298";
public const string Lightbulb = "\uf299";
public const string Link = "\uf1fe";
public const string LoadA = "\uf29a";
public const string LoadB = "\uf29b";
public const string LoadC = "\uf29c";
public const string LoadD = "\uf29d";
public const string Location = "\uf1ff";
public const string LockCombination = "\uf4d4";
public const string Locked = "\uf200";
public const string LogIn = "\uf29e";
public const string LogOut = "\uf29f";
public const string Loop = "\uf201";
public const string Magnet = "\uf2a0";
public const string Male = "\uf2a1";
public const string Man = "\uf202";
public const string Map = "\uf203";
public const string Medkit = "\uf2a2";
public const string Merge = "\uf33f";
public const string MicA = "\uf204";
public const string MicB = "\uf205";
public const string MicC = "\uf206";
public const string Minus = "\uf209";
public const string MinusCircled = "\uf207";
public const string MinusRound = "\uf208";
public const string ModelS = "\uf2c1";
public const string Monitor = "\uf20a";
public const string More = "\uf20b";
public const string Mouse = "\uf340";
public const string MusicNote = "\uf20c";
public const string Navicon = "\uf20e";
public const string NaviconRound = "\uf20d";
public const string Navigate = "\uf2a3";
public const string Network = "\uf341";
public const string NoSmoking = "\uf2c2";
public const string Nuclear = "\uf2a4";
public const string Outlet = "\uf342";
public const string Paintbrush = "\uf4d5";
public const string Paintbucket = "\uf4d6";
public const string PaperAirplane = "\uf2c3";
public const string Paperclip = "\uf20f";
public const string Pause = "\uf210";
public const string Person = "\uf213";
public const string PersonAdd = "\uf211";
public const string PersonStalker = "\uf212";
public const string PieGraph = "\uf2a5";
public const string Pin = "\uf2a6";
public const string Pinpoint = "\uf2a7";
public const string Pizza = "\uf2a8";
public const string Plane = "\uf214";
public const string Planet = "\uf343";
public const string Play = "\uf215";
public const string Playstation = "\uf30a";
public const string Plus = "\uf218";
public const string PlusCircled = "\uf216";
public const string PlusRound = "\uf217";
public const string Podium = "\uf344";
public const string Pound = "\uf219";
public const string Power = "\uf2a9";
public const string Pricetag = "\uf2aa";
public const string Pricetags = "\uf2ab";
public const string Printer = "\uf21a";
public const string PullRequest = "\uf345";
public const string QrScanner = "\uf346";
public const string Quote = "\uf347";
public const string RadioWaves = "\uf2ac";
public const string Record = "\uf21b";
public const string Refresh = "\uf21c";
public const string Reply = "\uf21e";
public const string ReplyAll = "\uf21d";
public const string RibbonA = "\uf348";
public const string RibbonB = "\uf349";
public const string Sad = "\uf34a";
public const string SadOutline = "\uf4d7";
public const string Scissors = "\uf34b";
public const string Search = "\uf21f";
public const string Settings = "\uf2ad";
public const string Share = "\uf220";
public const string Shuffle = "\uf221";
public const string SkipBackward = "\uf222";
public const string SkipForward = "\uf223";
public const string SocialAndroid = "\uf225";
public const string SocialAndroidOutline = "\uf224";
public const string SocialAngular = "\uf4d9";
public const string SocialAngularOutline = "\uf4d8";
public const string SocialApple = "\uf227";
public const string SocialAppleOutline = "\uf226";
public const string SocialBitcoin = "\uf2af";
public const string SocialBitcoinOutline = "\uf2ae";
public const string SocialBuffer = "\uf229";
public const string SocialBufferOutline = "\uf228";
public const string SocialChrome = "\uf4db";
public const string SocialChromeOutline = "\uf4da";
public const string SocialCodepen = "\uf4dd";
public const string SocialCodepenOutline = "\uf4dc";
public const string SocialCss3 = "\uf4df";
public const string SocialCss3Outline = "\uf4de";
public const string SocialDesignernews = "\uf22b";
public const string SocialDesignernewsOutline = "\uf22a";
public const string SocialDribbble = "\uf22d";
public const string SocialDribbbleOutline = "\uf22c";
public const string SocialDropbox = "\uf22f";
public const string SocialDropboxOutline = "\uf22e";
public const string SocialEuro = "\uf4e1";
public const string SocialEuroOutline = "\uf4e0";
public const string SocialFacebook = "\uf231";
public const string SocialFacebookOutline = "\uf230";
public const string SocialFoursquare = "\uf34d";
public const string SocialFoursquareOutline = "\uf34c";
public const string SocialFreebsdDevil = "\uf2c4";
public const string SocialGithub = "\uf233";
public const string SocialGithubOutline = "\uf232";
public const string SocialGoogle = "\uf34f";
public const string SocialGoogleOutline = "\uf34e";
public const string SocialGoogleplus = "\uf235";
public const string SocialGoogleplusOutline = "\uf234";
public const string SocialHackernews = "\uf237";
public const string SocialHackernewsOutline = "\uf236";
public const string SocialHtml5 = "\uf4e3";
public const string SocialHtml5Outline = "\uf4e2";
public const string SocialInstagram = "\uf351";
public const string SocialInstagramOutline = "\uf350";
public const string SocialJavascript = "\uf4e5";
public const string SocialJavascriptOutline = "\uf4e4";
public const string SocialLinkedin = "\uf239";
public const string SocialLinkedinOutline = "\uf238";
public const string SocialMarkdown = "\uf4e6";
public const string SocialNodejs = "\uf4e7";
public const string SocialOctocat = "\uf4e8";
public const string SocialPinterest = "\uf2b1";
public const string SocialPinterestOutline = "\uf2b0";
public const string SocialPython = "\uf4e9";
public const string SocialReddit = "\uf23b";
public const string SocialRedditOutline = "\uf23a";
public const string SocialRss = "\uf23d";
public const string SocialRssOutline = "\uf23c";
public const string SocialSass = "\uf4ea";
public const string SocialSkype = "\uf23f";
public const string SocialSkypeOutline = "\uf23e";
public const string SocialSnapchat = "\uf4ec";
public const string SocialSnapchatOutline = "\uf4eb";
public const string SocialTumblr = "\uf241";
public const string SocialTumblrOutline = "\uf240";
public const string SocialTux = "\uf2c5";
public const string SocialTwitch = "\uf4ee";
public const string SocialTwitchOutline = "\uf4ed";
public const string SocialTwitter = "\uf243";
public const string SocialTwitterOutline = "\uf242";
public const string SocialUsd = "\uf353";
public const string SocialUsdOutline = "\uf352";
public const string SocialVimeo = "\uf245";
public const string SocialVimeoOutline = "\uf244";
public const string SocialWhatsapp = "\uf4f0";
public const string SocialWhatsappOutline = "\uf4ef";
public const string SocialWindows = "\uf247";
public const string SocialWindowsOutline = "\uf246";
public const string SocialWordpress = "\uf249";
public const string SocialWordpressOutline = "\uf248";
public const string SocialYahoo = "\uf24b";
public const string SocialYahooOutline = "\uf24a";
public const string SocialYen = "\uf4f2";
public const string SocialYenOutline = "\uf4f1";
public const string SocialYoutube = "\uf24d";
public const string SocialYoutubeOutline = "\uf24c";
public const string SoupCan = "\uf4f4";
public const string SoupCanOutline = "\uf4f3";
public const string Speakerphone = "\uf2b2";
public const string Speedometer = "\uf2b3";
public const string Spoon = "\uf2b4";
public const string Star = "\uf24e";
public const string StatsBars = "\uf2b5";
public const string Steam = "\uf30b";
public const string Stop = "\uf24f";
public const string Thermometer = "\uf2b6";
public const string Thumbsdown = "\uf250";
public const string Thumbsup = "\uf251";
public const string Toggle = "\uf355";
public const string ToggleFilled = "\uf354";
public const string Transgender = "\uf4f5";
public const string TrashA = "\uf252";
public const string TrashB = "\uf253";
public const string Trophy = "\uf356";
public const string Tshirt = "\uf4f7";
public const string TshirtOutline = "\uf4f6";
public const string Umbrella = "\uf2b7";
public const string University = "\uf357";
public const string Unlocked = "\uf254";
public const string Upload = "\uf255";
public const string Usb = "\uf2b8";
public const string Videocamera = "\uf256";
public const string VolumeHigh = "\uf257";
public const string VolumeLow = "\uf258";
public const string VolumeMedium = "\uf259";
public const string VolumeMute = "\uf25a";
public const string Wand = "\uf358";
public const string Waterdrop = "\uf25b";
public const string Wifi = "\uf25c";
public const string Wineglass = "\uf2b9";
public const string Woman = "\uf25d";
public const string Wrench = "\uf2ba";
public const string Xbox = "\uf30c";
}
public class IoniciconsFont
{
public const string Alert = "\uf101";
public const string AlertCircled = "\uf100";
public const string AndroidAdd = "\uf2c7";
public const string AndroidAddCircle = "\uf359";
public const string AndroidAlarmClock = "\uf35a";
public const string AndroidAlert = "\uf35b";
public const string AndroidApps = "\uf35c";
public const string AndroidArchive = "\uf2c9";
public const string AndroidArrowBack = "\uf2ca";
public const string AndroidArrowDown = "\uf35d";
public const string AndroidArrowDropdown = "\uf35f";
public const string AndroidArrowDropdownCircle = "\uf35e";
public const string AndroidArrowDropleft = "\uf361";
public const string AndroidArrowDropleftCircle = "\uf360";
public const string AndroidArrowDropright = "\uf363";
public const string AndroidArrowDroprightCircle = "\uf362";
public const string AndroidArrowDropup = "\uf365";
public const string AndroidArrowDropupCircle = "\uf364";
public const string AndroidArrowForward = "\uf30f";
public const string AndroidArrowUp = "\uf366";
public const string AndroidAttach = "\uf367";
public const string AndroidBar = "\uf368";
public const string AndroidBicycle = "\uf369";
public const string AndroidBoat = "\uf36a";
public const string AndroidBookmark = "\uf36b";
public const string AndroidBulb = "\uf36c";
public const string AndroidBus = "\uf36d";
public const string AndroidCalendar = "\uf2d1";
public const string AndroidCall = "\uf2d2";
public const string AndroidCamera = "\uf2d3";
public const string AndroidCancel = "\uf36e";
public const string AndroidCar = "\uf36f";
public const string AndroidCart = "\uf370";
public const string AndroidChat = "\uf2d4";
public const string AndroidCheckbox = "\uf374";
public const string AndroidCheckboxBlank = "\uf371";
public const string AndroidCheckboxOutline = "\uf373";
public const string AndroidCheckboxOutlineBlank = "\uf372";
public const string AndroidCheckmarkCircle = "\uf375";
public const string AndroidClipboard = "\uf376";
public const string AndroidClose = "\uf2d7";
public const string AndroidCloud = "\uf37a";
public const string AndroidCloudCircle = "\uf377";
public const string AndroidCloudDone = "\uf378";
public const string AndroidCloudOutline = "\uf379";
public const string AndroidColorPalette = "\uf37b";
public const string AndroidCompass = "\uf37c";
public const string AndroidContact = "\uf2d8";
public const string AndroidContacts = "\uf2d9";
public const string AndroidContract = "\uf37d";
public const string AndroidCreate = "\uf37e";
public const string AndroidDelete = "\uf37f";
public const string AndroidDesktop = "\uf380";
public const string AndroidDocument = "\uf381";
public const string AndroidDone = "\uf383";
public const string AndroidDoneAll = "\uf382";
public const string AndroidDownload = "\uf2dd";
public const string AndroidDrafts = "\uf384";
public const string AndroidExit = "\uf385";
public const string AndroidExpand = "\uf386";
public const string AndroidFavorite = "\uf388";
public const string AndroidFavoriteOutline = "\uf387";
public const string AndroidFilm = "\uf389";
public const string AndroidFolder = "\uf2e0";
public const string AndroidFolderOpen = "\uf38a";
public const string AndroidFunnel = "\uf38b";
public const string AndroidGlobe = "\uf38c";
public const string AndroidHand = "\uf2e3";
public const string AndroidHangout = "\uf38d";
public const string AndroidHappy = "\uf38e";
public const string AndroidHome = "\uf38f";
public const string AndroidImage = "\uf2e4";
public const string AndroidLaptop = "\uf390";
public const string AndroidList = "\uf391";
public const string AndroidLocate = "\uf2e9";
public const string AndroidLock = "\uf392";
public const string AndroidMail = "\uf2eb";
public const string AndroidMap = "\uf393";
public const string AndroidMenu = "\uf394";
public const string AndroidMicrophone = "\uf2ec";
public const string AndroidMicrophoneOff = "\uf395";
public const string AndroidMoreHorizontal = "\uf396";
public const string AndroidMoreVertical = "\uf397";
public const string AndroidNavigate = "\uf398";
public const string AndroidNotifications = "\uf39b";
public const string AndroidNotificationsNone = "\uf399";
public const string AndroidNotificationsOff = "\uf39a";
public const string AndroidOpen = "\uf39c";
public const string AndroidOptions = "\uf39d";
public const string AndroidPeople = "\uf39e";
public const string AndroidPerson = "\uf3a0";
public const string AndroidPersonAdd = "\uf39f";
public const string AndroidPhoneLandscape = "\uf3a1";
public const string AndroidPhonePortrait = "\uf3a2";
public const string AndroidPin = "\uf3a3";
public const string AndroidPlane = "\uf3a4";
public const string AndroidPlaystore = "\uf2f0";
public const string AndroidPrint = "\uf3a5";
public const string AndroidRadioButtonOff = "\uf3a6";
public const string AndroidRadioButtonOn = "\uf3a7";
public const string AndroidRefresh = "\uf3a8";
public const string AndroidRemove = "\uf2f4";
public const string AndroidRemoveCircle = "\uf3a9";
public const string AndroidRestaurant = "\uf3aa";
public const string AndroidSad = "\uf3ab";
public const string AndroidSearch = "\uf2f5";
public const string AndroidSend = "\uf2f6";
public const string AndroidSettings = "\uf2f7";
public const string AndroidShare = "\uf2f8";
public const string AndroidShareAlt = "\uf3ac";
public const string AndroidStar = "\uf2fc";
public const string AndroidStarHalf = "\uf3ad";
public const string AndroidStarOutline = "\uf3ae";
public const string AndroidStopwatch = "\uf2fd";
public const string AndroidSubway = "\uf3af";
public const string AndroidSunny = "\uf3b0";
public const string AndroidSync = "\uf3b1";
public const string AndroidTextsms = "\uf3b2";
public const string AndroidTime = "\uf3b3";
public const string AndroidTrain = "\uf3b4";
public const string AndroidUnlock = "\uf3b5";
public const string AndroidUpload = "\uf3b6";
public const string AndroidVolumeDown = "\uf3b7";
public const string AndroidVolumeMute = "\uf3b8";
public const string AndroidVolumeOff = "\uf3b9";
public const string AndroidVolumeUp = "\uf3ba";
public const string AndroidWalk = "\uf3bb";
public const string AndroidWarning = "\uf3bc";
public const string AndroidWatch = "\uf3bd";
public const string AndroidWifi = "\uf305";
public const string Aperture = "\uf313";
public const string Archive = "\uf102";
public const string ArrowDownA = "\uf103";
public const string ArrowDownB = "\uf104";
public const string ArrowDownC = "\uf105";
public const string ArrowExpand = "\uf25e";
public const string ArrowGraphDownLeft = "\uf25f";
public const string ArrowGraphDownRight = "\uf260";
public const string ArrowGraphUpLeft = "\uf261";
public const string ArrowGraphUpRight = "\uf262";
public const string ArrowLeftA = "\uf106";
public const string ArrowLeftB = "\uf107";
public const string ArrowLeftC = "\uf108";
public const string ArrowMove = "\uf263";
public const string ArrowResize = "\uf264";
public const string ArrowReturnLeft = "\uf265";
public const string ArrowReturnRight = "\uf266";
public const string ArrowRightA = "\uf109";
public const string ArrowRightB = "\uf10a";
public const string ArrowRightC = "\uf10b";
public const string ArrowShrink = "\uf267";
public const string ArrowSwap = "\uf268";
public const string ArrowUpA = "\uf10c";
public const string ArrowUpB = "\uf10d";
public const string ArrowUpC = "\uf10e";
public const string Asterisk = "\uf314";
public const string At = "\uf10f";
public const string Backspace = "\uf3bf";
public const string BackspaceOutline = "\uf3be";
public const string Bag = "\uf110";
public const string BatteryCharging = "\uf111";
public const string BatteryEmpty = "\uf112";
public const string BatteryFull = "\uf113";
public const string BatteryHalf = "\uf114";
public const string BatteryLow = "\uf115";
public const string Beaker = "\uf269";
public const string Beer = "\uf26a";
public const string Bluetooth = "\uf116";
public const string Bonfire = "\uf315";
public const string Bookmark = "\uf26b";
public const string Bowtie = "\uf3c0";
public const string Briefcase = "\uf26c";
public const string Bug = "\uf2be";
public const string Calculator = "\uf26d";
public const string Calendar = "\uf117";
public const string Camera = "\uf118";
public const string Card = "\uf119";
public const string Cash = "\uf316";
public const string Chatbox = "\uf11b";
public const string ChatboxWorking = "\uf11a";
public const string Chatboxes = "\uf11c";
public const string Chatbubble = "\uf11e";
public const string ChatbubbleWorking = "\uf11d";
public const string Chatbubbles = "\uf11f";
public const string Checkmark = "\uf122";
public const string CheckmarkCircled = "\uf120";
public const string CheckmarkRound = "\uf121";
public const string ChevronDown = "\uf123";
public const string ChevronLeft = "\uf124";
public const string ChevronRight = "\uf125";
public const string ChevronUp = "\uf126";
public const string Clipboard = "\uf127";
public const string Clock = "\uf26e";
public const string Close = "\uf12a";
public const string CloseCircled = "\uf128";
public const string CloseRound = "\uf129";
public const string ClosedCaptioning = "\uf317";
public const string Cloud = "\uf12b";
public const string Code = "\uf271";
public const string CodeDownload = "\uf26f";
public const string CodeWorking = "\uf270";
public const string Coffee = "\uf272";
public const string Compass = "\uf273";
public const string Compose = "\uf12c";
public const string ConnectionBars = "\uf274";
public const string Contrast = "\uf275";
public const string Crop = "\uf3c1";
public const string Cube = "\uf318";
public const string Disc = "\uf12d";
public const string Document = "\uf12f";
public const string DocumentText = "\uf12e";
public const string Drag = "\uf130";
public const string Earth = "\uf276";
public const string Easel = "\uf3c2";
public const string Edit = "\uf2bf";
public const string Egg = "\uf277";
public const string Eject = "\uf131";
public const string Email = "\uf132";
public const string EmailUnread = "\uf3c3";
public const string ErlenmeyerFlask = "\uf3c5";
public const string ErlenmeyerFlaskBubbles = "\uf3c4";
public const string Eye = "\uf133";
public const string EyeDisabled = "\uf306";
public const string Eemale = "\uf278";
public const string Filing = "\uf134";
public const string FilmMarker = "\uf135";
public const string Fireball = "\uf319";
public const string Flag = "\uf279";
public const string Flame = "\uf31a";
public const string Flash = "\uf137";
public const string FlashOff = "\uf136";
public const string Folder = "\uf139";
public const string Fork = "\uf27a";
public const string ForkRepo = "\uf2c0";
public const string Forward = "\uf13a";
public const string Funnel = "\uf31b";
public const string GearA = "\uf13d";
public const string GearB = "\uf13e";
public const string Grid = "\uf13f";
public const string Hammer = "\uf27b";
public const string Happy = "\uf31c";
public const string HappyOutline = "\uf3c6";
public const string Headphone = "\uf140";
public const string Heart = "\uf141";
public const string HeartBroken = "\uf31d";
public const string Help = "\uf143";
public const string HelpBuoy = "\uf27c";
public const string HelpCircled = "\uf142";
public const string Home = "\uf144";
public const string Icecream = "\uf27d";
public const string Image = "\uf147";
public const string Images = "\uf148";
public const string Information = "\uf14a";
public const string InformationCircled = "\uf149";
public const string Ionic = "\uf14b";
public const string IosAlarm = "\uf3c8";
public const string IosAlarmOutline = "\uf3c7";
public const string IosAlbums = "\uf3ca";
public const string IosAlbumsOutline = "\uf3c9";
public const string IosAmericanfootball = "\uf3cc";
public const string IosAmericanfootballOutline = "\uf3cb";
public const string IosAnalytics = "\uf3ce";
public const string IosAnalyticsOutline = "\uf3cd";
public const string IosArrowBack = "\uf3cf";
public const string IosArrowDown = "\uf3d0";
public const string IosArrowForward = "\uf3d1";
public const string IosArrowLeft = "\uf3d2";
public const string IosArrowRight = "\uf3d3";
public const string IosArrowThinDown = "\uf3d4";
public const string IosArrowThinLeft = "\uf3d5";
public const string IosArrowThinRight = "\uf3d6";
public const string IosArrowThinUp = "\uf3d7";
public const string IosArrowUp = "\uf3d8";
public const string IosAt = "\uf3da";
public const string IosAtOutline = "\uf3d9";
public const string IosBarcode = "\uf3dc";
public const string IosBarcodeOutline = "\uf3db";
public const string IosBaseball = "\uf3de";
public const string IosBaseballOutline = "\uf3dd";
public const string IosBasketball = "\uf3e0";
public const string IosBasketballOutline = "\uf3df";
public const string IosBell = "\uf3e2";
public const string IosBellOutline = "\uf3e1";
public const string IosBody = "\uf3e4";
public const string IosBodyOutline = "\uf3e3";
public const string IosBolt = "\uf3e6";
public const string IosBoltOutline = "\uf3e5";
public const string IosBook = "\uf3e8";
public const string IosBookOutline = "\uf3e7";
public const string IosBookmarks = "\uf3ea";
public const string IosBookmarksOutline = "\uf3e9";
public const string IosBox = "\uf3ec";
public const string IosBoxOutline = "\uf3eb";
public const string IosBriefcase = "\uf3ee";
public const string IosBriefcaseOutline = "\uf3ed";
public const string IosBrowsers = "\uf3f0";
public const string IosBrowsersOutline = "\uf3ef";
public const string IosCalculator = "\uf3f2";
public const string IosCalculatorOutline = "\uf3f1";
public const string IosCalendar = "\uf3f4";
public const string IosCalendarOutline = "\uf3f3";
public const string IosCamera = "\uf3f6";
public const string IosCameraOutline = "\uf3f5";
public const string IosCart = "\uf3f8";
public const string IosCartOutline = "\uf3f7";
public const string IosChatboxes = "\uf3fa";
public const string IosChatboxesOutline = "\uf3f9";
public const string IosChatbubble = "\uf3fc";
public const string IosChatbubbleOutline = "\uf3fb";
public const string IosCheckmark = "\uf3ff";
public const string IosCheckmarkEmpty = "\uf3fd";
public const string IosCheckmarkOutline = "\uf3fe";
public const string IosCircleFilled = "\uf400";
public const string IosCircleOutline = "\uf401";
public const string IosClock = "\uf403";
public const string IosClockOutline = "\uf402";
public const string IosClose = "\uf406";
public const string IosCloseEmpty = "\uf404";
public const string IosCloseOutline = "\uf405";
public const string IosCloud = "\uf40c";
public const string IosCloudDownload = "\uf408";
public const string IosCloudDownloadOutline = "\uf407";
public const string IosCloudOutline = "\uf409";
public const string IosCloudUpload = "\uf40b";
public const string IosCloudUploadOutline = "\uf40a";
public const string IosCloudy = "\uf410";
public const string IosCloudyNight = "\uf40e";
public const string IosCloudyNightOutline = "\uf40d";
public const string IosCloudyOutline = "\uf40f";
public const string IosCog = "\uf412";
public const string IosCogOutline = "\uf411";
public const string IosColorFilter = "\uf414";
public const string IosColorFilterOutline = "\uf413";
public const string IosColorWand = "\uf416";
public const string IosColorWandOutline = "\uf415";
public const string IosCompose = "\uf418";
public const string IosComposeOutline = "\uf417";
public const string IosContact = "\uf41a";
public const string IosContactOutline = "\uf419";
public const string IosCopy = "\uf41c";
public const string IosCopyOutline = "\uf41b";
public const string IosCrop = "\uf41e";
public const string IosCropStrong = "\uf41d";
public const string IosDownload = "\uf420";
public const string IosDownloadOutline = "\uf41f";
public const string IosDrag = "\uf421";
public const string IosEmail = "\uf423";
public const string IosEmailOutline = "\uf422";
public const string IosEye = "\uf425";
public const string IosEyeOutline = "\uf424";
public const string IosFastforward = "\uf427";
public const string IosFastforwardOutline = "\uf426";
public const string IosFiling = "\uf429";
public const string IosFilingOutline = "\uf428";
public const string IosFilm = "\uf42b";
public const string IosFilmOutline = "\uf42a";
public const string IosFlag = "\uf42d";
public const string IosFlagOutline = "\uf42c";
public const string IosFlame = "\uf42f";
public const string IosFlameOutline = "\uf42e";
public const string IosFlask = "\uf431";
public const string IosFlaskOutline = "\uf430";
public const string IosFlower = "\uf433";
public const string IosFlowerOutline = "\uf432";
public const string IosFolder = "\uf435";
public const string IosFolderOutline = "\uf434";
public const string IosFootball = "\uf437";
public const string IosFootballOutline = "\uf436";
public const string IosGameControllerA = "\uf439";
public const string IosGameControllerAOutline = "\uf438";
public const string IosGameControllerB = "\uf43b";
public const string IosGameControllerBOutline = "\uf43a";
public const string IosGear = "\uf43d";
public const string IosGearOutline = "\uf43c";
public const string IosGlasses = "\uf43f";
public const string IosGlassesOutline = "\uf43e";
public const string IosGridView = "\uf441";
public const string IosGridViewOutline = "\uf440";
public const string IosHeart = "\uf443";
public const string IosHeartOutline = "\uf442";
public const string IosHelp = "\uf446";
public const string IosHelpEmpty = "\uf444";
public const string IosHelpOutline = "\uf445";
public const string IosHome = "\uf448";
public const string IosHomeOutline = "\uf447";
public const string IosInfinite = "\uf44a";
public const string IosInfiniteOutline = "\uf449";
public const string IosInformation = "\uf44d";
public const string IosInformationEmpty = "\uf44b";
public const string IosInformationOutline = "\uf44c";
public const string IosIonicOutline = "\uf44e";
public const string IosKeypad = "\uf450";
public const string IosKeypadOutline = "\uf44f";
public const string IosLightbulb = "\uf452";
public const string IosLightbulbOutline = "\uf451";
public const string IosList = "\uf454";
public const string IosListOutline = "\uf453";
public const string IosLocation = "\uf456";
public const string IosLocationOutline = "\uf455";
public const string IosLocked = "\uf458";
public const string IosLockedOutline = "\uf457";
public const string IosLoop = "\uf45a";
public const string IosLoopStrong = "\uf459";
public const string IosMedical = "\uf45c";
public const string IosMedicalOutline = "\uf45b";
public const string IosMedkit = "\uf45e";
public const string IosMedkitOutline = "\uf45d";
public const string IosMic = "\uf461";
public const string IosMicOff = "\uf45f";
public const string IosMicOutline = "\uf460";
public const string IosMinus = "\uf464";
public const string IosMinusEmpty = "\uf462";
public const string IosMinusOutline = "\uf463";
public const string IosMonitor = "\uf466";
public const string IosMonitorOutline = "\uf465";
public const string IosMoon = "\uf468";
public const string IosMoonOutline = "\uf467";
public const string IosMore = "\uf46a";
public const string IosMoreOutline = "\uf469";
public const string IosMusicalNote = "\uf46b";
public const string IosMusicalNotes = "\uf46c";
public const string IosNavigate = "\uf46e";
public const string IosNavigateOutline = "\uf46d";
public const string IosNutrition = "\uf470";
public const string IosNutritionOutline = "\uf46f";
public const string IosPaper = "\uf472";
public const string IosPaperOutline = "\uf471";
public const string IosPaperplane = "\uf474";
public const string IosPaperplaneOutline = "\uf473";
public const string IosPartlysunny = "\uf476";
public const string IosPartlysunnyOutline = "\uf475";
public const string IosPause = "\uf478";
public const string IosPauseOutline = "\uf477";
public const string IosPaw = "\uf47a";
public const string IosPawOutline = "\uf479";
public const string IosPeople = "\uf47c";
public const string IosPeopleOutline = "\uf47b";
public const string IosPerson = "\uf47e";
public const string IosPersonOutline = "\uf47d";
public const string IosPersonadd = "\uf480";
public const string IosPersonaddOutline = "\uf47f";
public const string IosPhotos = "\uf482";
public const string IosPhotosOutline = "\uf481";
public const string IosPie = "\uf484";
public const string IosPieOutline = "\uf483";
public const string IosPint = "\uf486";
public const string IosPintOutline = "\uf485";
public const string IosPlay = "\uf488";
public const string IosPlayOutline = "\uf487";
public const string IosPlus = "\uf48b";
public const string IosPlusEmpty = "\uf489";
public const string IosPlusOutline = "\uf48a";
public const string IosPricetag = "\uf48d";
public const string IosPricetagOutline = "\uf48c";
public const string IosPricetags = "\uf48f";
public const string IosPricetagsOutline = "\uf48e";
public const string IosPrinter = "\uf491";
public const string IosPrinterOutline = "\uf490";
public const string IosPulse = "\uf493";
public const string IosPulseStrong = "\uf492";
public const string IosRainy = "\uf495";
public const string IosRainyOutline = "\uf494";
public const string IosRecording = "\uf497";
public const string IosRecordingOutline = "\uf496";
public const string IosRedo = "\uf499";
public const string IosRedoOutline = "\uf498";
public const string IosRefresh = "\uf49c";
public const string IosRefreshEmpty = "\uf49a";
public const string IosRefreshOutline = "\uf49b";
public const string IosReload = "\uf49d";
public const string IosReverseCamera = "\uf49f";
public const string IosReverseCameraOutline = "\uf49e";
public const string IosRewind = "\uf4a1";
public const string IosRewindOutline = "\uf4a0";
public const string IosRose = "\uf4a3";
public const string IosRoseOutline = "\uf4a2";
public const string IosSearch = "\uf4a5";
public const string IosSearchStrong = "\uf4a4";
public const string IosSettings = "\uf4a7";
public const string IosSettingsStrong = "\uf4a6";
public const string IosShuffle = "\uf4a9";
public const string IosShuffleStrong = "\uf4a8";
public const string IosSkipbackward = "\uf4ab";
public const string IosSkipbackwardOutline = "\uf4aa";
public const string IosSkipforward = "\uf4ad";
public const string IosSkipforwardOutline = "\uf4ac";
public const string IosSnowy = "\uf4ae";
public const string IosSpeedometer = "\uf4b0";
public const string IosSpeedometerOutline = "\uf4af";
public const string IosStar = "\uf4b3";
public const string IosStarHalf = "\uf4b1";
public const string IosStarOutline = "\uf4b2";
public const string IosStopwatch = "\uf4b5";
public const string IosStopwatchOutline = "\uf4b4";
public const string IosSunny = "\uf4b7";
public const string IosSunnyOutline = "\uf4b6";
public const string IosTelephone = "\uf4b9";
public const string IosTelephoneOutline = "\uf4b8";
public const string IosTennisball = "\uf4bb";
public const string IosTennisballOutline = "\uf4ba";
public const string IosThunderstorm = "\uf4bd";
public const string IosThunderstormOutline = "\uf4bc";
public const string IosTime = "\uf4bf";
public const string IosTimeOutline = "\uf4be";
public const string IosTimer = "\uf4c1";
public const string IosTimerOutline = "\uf4c0";
public const string IosToggle = "\uf4c3";
public const string IosToggleOutline = "\uf4c2";
public const string IosTrash = "\uf4c5";
public const string IosTrashOutline = "\uf4c4";
public const string IosUndo = "\uf4c7";
public const string IosUndoOutline = "\uf4c6";
public const string IosUnlocked = "\uf4c9";
public const string IosUnlockedOutline = "\uf4c8";
public const string IosUpload = "\uf4cb";
public const string IosUploadOutline = "\uf4ca";
public const string IosVideocam = "\uf4cd";
public const string IosVideocamOutline = "\uf4cc";
public const string IosVolumeHigh = "\uf4ce";
public const string IosVolumeLow = "\uf4cf";
public const string IosWineglass = "\uf4d1";
public const string IosWineglassOutline = "\uf4d0";
public const string IosWorld = "\uf4d3";
public const string IosWorldOutline = "\uf4d2";
public const string Ipad = "\uf1f9";
public const string Iphone = "\uf1fa";
public const string Ipod = "\uf1fb";
public const string Jet = "\uf295";
public const string Key = "\uf296";
public const string Knife = "\uf297";
public const string Laptop = "\uf1fc";
public const string Leaf = "\uf1fd";
public const string Levels = "\uf298";
public const string Lightbulb = "\uf299";
public const string Link = "\uf1fe";
public const string LoadA = "\uf29a";
public const string LoadB = "\uf29b";
public const string LoadC = "\uf29c";
public const string LoadD = "\uf29d";
public const string Location = "\uf1ff";
public const string LockCombination = "\uf4d4";
public const string Locked = "\uf200";
public const string LogIn = "\uf29e";
public const string LogOut = "\uf29f";
public const string Loop = "\uf201";
public const string Magnet = "\uf2a0";
public const string Male = "\uf2a1";
public const string Man = "\uf202";
public const string Map = "\uf203";
public const string Medkit = "\uf2a2";
public const string Merge = "\uf33f";
public const string MicA = "\uf204";
public const string MicB = "\uf205";
public const string MicC = "\uf206";
public const string Minus = "\uf209";
public const string MinusCircled = "\uf207";
public const string MinusRound = "\uf208";
public const string ModelS = "\uf2c1";
public const string Monitor = "\uf20a";
public const string More = "\uf20b";
public const string Mouse = "\uf340";
public const string MusicNote = "\uf20c";
public const string Navicon = "\uf20e";
public const string NaviconRound = "\uf20d";
public const string Navigate = "\uf2a3";
public const string Network = "\uf341";
public const string NoSmoking = "\uf2c2";
public const string Nuclear = "\uf2a4";
public const string Outlet = "\uf342";
public const string Paintbrush = "\uf4d5";
public const string Paintbucket = "\uf4d6";
public const string PaperAirplane = "\uf2c3";
public const string Paperclip = "\uf20f";
public const string Pause = "\uf210";
public const string Person = "\uf213";
public const string PersonAdd = "\uf211";
public const string PersonStalker = "\uf212";
public const string PieGraph = "\uf2a5";
public const string Pin = "\uf2a6";
public const string Pinpoint = "\uf2a7";
public const string Pizza = "\uf2a8";
public const string Plane = "\uf214";
public const string Planet = "\uf343";
public const string Play = "\uf215";
public const string Playstation = "\uf30a";
public const string Plus = "\uf218";
public const string PlusCircled = "\uf216";
public const string PlusRound = "\uf217";
public const string Podium = "\uf344";
public const string Pound = "\uf219";
public const string Power = "\uf2a9";
public const string Pricetag = "\uf2aa";
public const string Pricetags = "\uf2ab";
public const string Printer = "\uf21a";
public const string PullRequest = "\uf345";
public const string QrScanner = "\uf346";
public const string Quote = "\uf347";
public const string RadioWaves = "\uf2ac";
public const string Record = "\uf21b";
public const string Refresh = "\uf21c";
public const string Reply = "\uf21e";
public const string ReplyAll = "\uf21d";
public const string RibbonA = "\uf348";
public const string RibbonB = "\uf349";
public const string Sad = "\uf34a";
public const string SadOutline = "\uf4d7";
public const string Scissors = "\uf34b";
public const string Search = "\uf21f";
public const string Settings = "\uf2ad";
public const string Share = "\uf220";
public const string Shuffle = "\uf221";
public const string SkipBackward = "\uf222";
public const string SkipForward = "\uf223";
public const string SocialAndroid = "\uf225";
public const string SocialAndroidOutline = "\uf224";
public const string SocialAngular = "\uf4d9";
public const string SocialAngularOutline = "\uf4d8";
public const string SocialApple = "\uf227";
public const string SocialAppleOutline = "\uf226";
public const string SocialBitcoin = "\uf2af";
public const string SocialBitcoinOutline = "\uf2ae";
public const string SocialBuffer = "\uf229";
public const string SocialBufferOutline = "\uf228";
public const string SocialChrome = "\uf4db";
public const string SocialChromeOutline = "\uf4da";
public const string SocialCodepen = "\uf4dd";
public const string SocialCodepenOutline = "\uf4dc";
public const string SocialCss3 = "\uf4df";
public const string SocialCss3Outline = "\uf4de";
public const string SocialDesignernews = "\uf22b";
public const string SocialDesignernewsOutline = "\uf22a";
public const string SocialDribbble = "\uf22d";
public const string SocialDribbbleOutline = "\uf22c";
public const string SocialDropbox = "\uf22f";
public const string SocialDropboxOutline = "\uf22e";
public const string SocialEuro = "\uf4e1";
public const string SocialEuroOutline = "\uf4e0";
public const string SocialFacebook = "\uf231";
public const string SocialFacebookOutline = "\uf230";
public const string SocialFoursquare = "\uf34d";
public const string SocialFoursquareOutline = "\uf34c";
public const string SocialFreebsdDevil = "\uf2c4";
public const string SocialGithub = "\uf233";
public const string SocialGithubOutline = "\uf232";
public const string SocialGoogle = "\uf34f";
public const string SocialGoogleOutline = "\uf34e";
public const string SocialGoogleplus = "\uf235";
public const string SocialGoogleplusOutline = "\uf234";
public const string SocialHackernews = "\uf237";
public const string SocialHackernewsOutline = "\uf236";
public const string SocialHtml5 = "\uf4e3";
public const string SocialHtml5Outline = "\uf4e2";
public const string SocialInstagram = "\uf351";
public const string SocialInstagramOutline = "\uf350";
public const string SocialJavascript = "\uf4e5";
public const string SocialJavascriptOutline = "\uf4e4";
public const string SocialLinkedin = "\uf239";
public const string SocialLinkedinOutline = "\uf238";
public const string SocialMarkdown = "\uf4e6";
public const string SocialNodejs = "\uf4e7";
public const string SocialOctocat = "\uf4e8";
public const string SocialPinterest = "\uf2b1";
public const string SocialPinterestOutline = "\uf2b0";
public const string SocialPython = "\uf4e9";
public const string SocialReddit = "\uf23b";
public const string SocialRedditOutline = "\uf23a";
public const string SocialRss = "\uf23d";
public const string SocialRssOutline = "\uf23c";
public const string SocialSass = "\uf4ea";
public const string SocialSkype = "\uf23f";
public const string SocialSkypeOutline = "\uf23e";
public const string SocialSnapchat = "\uf4ec";
public const string SocialSnapchatOutline = "\uf4eb";
public const string SocialTumblr = "\uf241";
public const string SocialTumblrOutline = "\uf240";
public const string SocialTux = "\uf2c5";
public const string SocialTwitch = "\uf4ee";
public const string SocialTwitchOutline = "\uf4ed";
public const string SocialTwitter = "\uf243";
public const string SocialTwitterOutline = "\uf242";
public const string SocialUsd = "\uf353";
public const string SocialUsdOutline = "\uf352";
public const string SocialVimeo = "\uf245";
public const string SocialVimeoOutline = "\uf244";
public const string SocialWhatsapp = "\uf4f0";
public const string SocialWhatsappOutline = "\uf4ef";
public const string SocialWindows = "\uf247";
public const string SocialWindowsOutline = "\uf246";
public const string SocialWordpress = "\uf249";
public const string SocialWordpressOutline = "\uf248";
public const string SocialYahoo = "\uf24b";
public const string SocialYahooOutline = "\uf24a";
public const string SocialYen = "\uf4f2";
public const string SocialYenOutline = "\uf4f1";
public const string SocialYoutube = "\uf24d";
public const string SocialYoutubeOutline = "\uf24c";
public const string SoupCan = "\uf4f4";
public const string SoupCanOutline = "\uf4f3";
public const string Speakerphone = "\uf2b2";
public const string Speedometer = "\uf2b3";
public const string Spoon = "\uf2b4";
public const string Star = "\uf24e";
public const string StatsBars = "\uf2b5";
public const string Steam = "\uf30b";
public const string Stop = "\uf24f";
public const string Thermometer = "\uf2b6";
public const string Thumbsdown = "\uf250";
public const string Thumbsup = "\uf251";
public const string Toggle = "\uf355";
public const string ToggleFilled = "\uf354";
public const string Transgender = "\uf4f5";
public const string TrashA = "\uf252";
public const string TrashB = "\uf253";
public const string Trophy = "\uf356";
public const string Tshirt = "\uf4f7";
public const string TshirtOutline = "\uf4f6";
public const string Umbrella = "\uf2b7";
public const string University = "\uf357";
public const string Unlocked = "\uf254";
public const string Upload = "\uf255";
public const string Usb = "\uf2b8";
public const string Videocamera = "\uf256";
public const string VolumeHigh = "\uf257";
public const string VolumeLow = "\uf258";
public const string VolumeMedium = "\uf259";
public const string VolumeMute = "\uf25a";
public const string Wand = "\uf358";
public const string Waterdrop = "\uf25b";
public const string Wifi = "\uf25c";
public const string Wineglass = "\uf2b9";
public const string Woman = "\uf25d";
public const string Wrench = "\uf2ba";
public const string Xbox = "\uf30c";
}
}
// Helpers/Settings.cs
using Plugin.Settings;
using Plugin.Settings.Abstractions;
namespace inutralia.Helpers
{
/// <summary>
/// This is the Settings static class that can be used in your Core solution or in any
/// of your client applications. All settings are laid out the same exact way with getters
/// and setters.
/// </summary>
public static class Settings
{
private static ISettings AppSettings
/// <summary>
/// This is the Settings static class that can be used in your Core solution or in any
/// of your client applications. All settings are laid out the same exact way with getters
/// and setters.
/// </summary>
public static class Settings
{
get
{
return CrossSettings.Current;
}
}
#region Setting Constants
private static ISettings AppSettings
{
get
{
return CrossSettings.Current;
}
}
private const string SettingsKey = "settings_key";
private static readonly string SettingsDefault = string.Empty;
#region Setting Constants
#endregion
private const string SettingsKey = "settings_key";
private static readonly string SettingsDefault = string.Empty;
#endregion
public static string GeneralSettings
{
get
{
return AppSettings.GetValueOrDefault<string>(SettingsKey, SettingsDefault);
}
set
{
AppSettings.AddOrUpdateValue<string>(SettingsKey, value);
}
public static string GeneralSettings
{
get
{
return AppSettings.GetValueOrDefault<string>(SettingsKey, SettingsDefault);
}
set
{
AppSettings.AddOrUpdateValue<string>(SettingsKey, value);
}
}
}
}
}
\ No newline at end of file
using System;
namespace inutralia
{
public static class AssemblyGlobal
{
public const string Company = "UXDivers";
public static class AssemblyGlobal
{
public const string Company = "UXDivers";
public const string ProductLine = "Grial UIKit";
public const string ProductLine = "Grial UIKit";
public const string Year = "2017";
public const string Year = "2017";
public const string Copyright = Company + " - " + Year;
public const string Copyright = Company + " - " + Year;
#if DEBUG
public const string Configuration = "Debug";
public const string Configuration = "Debug";
#elif RELEASE
public const string Configuration = "Release";
#else
public const string Configuration = "Unkown";
#endif
}
}
}
......@@ -2,11 +2,9 @@ using System.Reflection;
using Xamarin.Forms.Xaml;
using inutralia;
[assembly: AssemblyTitle (AssemblyGlobal.ProductLine + " - " + "Grial Xamarin.Forms UIKit")]
[assembly: AssemblyConfiguration (AssemblyGlobal.Configuration)]
[assembly: AssemblyCompany (AssemblyGlobal.Company)]
[assembly: AssemblyProduct (AssemblyGlobal.ProductLine + " - " + "Grial Xamarin.Forms UIKit")]
[assembly: AssemblyCopyright (AssemblyGlobal.Copyright)]
[assembly: XamlCompilation (XamlCompilationOptions.Compile)]
\ No newline at end of file
[assembly: AssemblyTitle(AssemblyGlobal.ProductLine + " - " + "Grial Xamarin.Forms UIKit")]
[assembly: AssemblyConfiguration(AssemblyGlobal.Configuration)]
[assembly: AssemblyCompany(AssemblyGlobal.Company)]
[assembly: AssemblyProduct(AssemblyGlobal.ProductLine + " - " + "Grial Xamarin.Forms UIKit")]
[assembly: AssemblyCopyright(AssemblyGlobal.Copyright)]
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
\ No newline at end of file
......@@ -4,7 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.GrialDarkTheme">
<!--
<!--
THEME COLORS
The colors below will be automatically updated on each platform project by the build task.
......@@ -19,69 +19,62 @@
...but this is:
#FF169CEE
-->
<!-- Grial Theme Exported Colors -->
<Color x:Key="AccentColor">#FFDA125F</Color>
<Color x:Key="BaseTextColor">#D6E1F1</Color>
<!-- GENERAL COLORS -->
<Color x:Key="InverseTextColor">White</Color>
<Color x:Key="BrandColor">#ad1457</Color>
<Color x:Key="BrandNameColor">#FFFFFF</Color>
<Color x:Key="BaseLightTextColor">#7b7b7b</Color>
<Color x:Key="OverImageTextColor">#FFFFFF</Color>
<Color x:Key="EcommercePromoTextColor">#FFFFFF</Color>
<Color x:Key="SocialHeaderTextColor">#62527A</Color>
<Color x:Key="ArticleHeaderBackgroundColor">#1B1D22</Color>
<Color x:Key="CustomNavBarTextColor">#FFFFFF</Color>
<Color x:Key="ListViewItemTextColor">#FFFFFF</Color>
<Color x:Key="AboutHeaderBackgroundColor">#FFFFFF</Color>
<Color x:Key="BasePageColor">#282C37</Color>
<Color x:Key="BaseTabbedPageColor">#213D55</Color>
<Color x:Key="MainWrapperBackgroundColor">#1B1D22</Color>
<Color x:Key="CategoriesListIconColor">#55000000</Color>
<Color x:Key="DashboardIconColor">#FFFFFF</Color>
<!-- COMPLEMENT COLORS -->
<Color x:Key="ComplementColor">#525ABB</Color>
<Color x:Key="TranslucidBlack">#44000000</Color>
<Color x:Key="TranslucidWhite">#22ffffff</Color>
<!-- INDICATOR COLORS -->
<Color x:Key="OkColor">#22c064</Color>
<Color x:Key="ErrorColor">Red</Color>
<Color x:Key="WarningColor">#ffc107</Color>
<Color x:Key="NotificationColor">#1274d1</Color>
<!-- BUTTONS & ENTRY COLORS -->
<Color x:Key="SaveButtonColor">#22c064</Color>
<Color x:Key="DeleteButtonColor">#D50000</Color>
<Color x:Key="LabelButtonColor">#ffffff</Color>
<Color x:Key="PlaceholderColor">#FFFFFF</Color>
<Color x:Key="PlaceholderColorEntry">#505971</Color>
<Color x:Key="RoundedLabelBackgroundColor">#525ABB</Color>
<!-- MAIN MENU COLORS -->
<Color x:Key="MainMenuHeaderBackgroundColor">Transparent</Color>
<Color x:Key="MainMenuBackgroundColor">#1B1F2A</Color>
<Color x:Key="MainMenuSeparatorColor">Transparent</Color>
<Color x:Key="MainMenuTextColor">#D6E1F1</Color>
<Color x:Key="MainMenuIconColor">#D6E1F1</Color>
<!-- SEPARATORS COLORS -->
<Color x:Key="ListViewSeparatorColor">#151C22</Color>
<Color x:Key="BaseSeparatorColor">#7b7b7b</Color>
<!-- CHAT COLORS -->
<Color x:Key="ChatRightBalloonBackgroundColor">#525ABB</Color>
<Color x:Key="ChatBalloonFooterTextColor">#FFFFFF</Color>
<Color x:Key="ChatRightTextColor">#FFFFFF</Color>
<Color x:Key="ChatLeftTextColor">#FFFFFF</Color>
<!-- Grial Theme Exported Colors -->
<Color x:Key="AccentColor">#FFDA125F</Color>
<Color x:Key="BaseTextColor">#D6E1F1</Color>
<!-- GENERAL COLORS -->
<Color x:Key="InverseTextColor">White</Color>
<Color x:Key="BrandColor">#ad1457</Color>
<Color x:Key="BrandNameColor">#FFFFFF</Color>
<Color x:Key="BaseLightTextColor">#7b7b7b</Color>
<Color x:Key="OverImageTextColor">#FFFFFF</Color>
<Color x:Key="EcommercePromoTextColor">#FFFFFF</Color>
<Color x:Key="SocialHeaderTextColor">#62527A</Color>
<Color x:Key="ArticleHeaderBackgroundColor">#1B1D22</Color>
<Color x:Key="CustomNavBarTextColor">#FFFFFF</Color>
<Color x:Key="ListViewItemTextColor">#FFFFFF</Color>
<Color x:Key="AboutHeaderBackgroundColor">#FFFFFF</Color>
<Color x:Key="BasePageColor">#282C37</Color>
<Color x:Key="BaseTabbedPageColor">#213D55</Color>
<Color x:Key="MainWrapperBackgroundColor">#1B1D22</Color>
<Color x:Key="CategoriesListIconColor">#55000000</Color>
<Color x:Key="DashboardIconColor">#FFFFFF</Color>
<!-- COMPLEMENT COLORS -->
<Color x:Key="ComplementColor">#525ABB</Color>
<Color x:Key="TranslucidBlack">#44000000</Color>
<Color x:Key="TranslucidWhite">#22ffffff</Color>
<!-- INDICATOR COLORS -->
<Color x:Key="OkColor">#22c064</Color>
<Color x:Key="ErrorColor">Red</Color>
<Color x:Key="WarningColor">#ffc107</Color>
<Color x:Key="NotificationColor">#1274d1</Color>
<!-- BUTTONS & ENTRY COLORS -->
<Color x:Key="SaveButtonColor">#22c064</Color>
<Color x:Key="DeleteButtonColor">#D50000</Color>
<Color x:Key="LabelButtonColor">#ffffff</Color>
<Color x:Key="PlaceholderColor">#FFFFFF</Color>
<Color x:Key="PlaceholderColorEntry">#505971</Color>
<Color x:Key="RoundedLabelBackgroundColor">#525ABB</Color>
<!-- MAIN MENU COLORS -->
<Color x:Key="MainMenuHeaderBackgroundColor">Transparent</Color>
<Color x:Key="MainMenuBackgroundColor">#1B1F2A</Color>
<Color x:Key="MainMenuSeparatorColor">Transparent</Color>
<Color x:Key="MainMenuTextColor">#D6E1F1</Color>
<Color x:Key="MainMenuIconColor">#D6E1F1</Color>
<!-- SEPARATORS COLORS -->
<Color x:Key="ListViewSeparatorColor">#151C22</Color>
<Color x:Key="BaseSeparatorColor">#7b7b7b</Color>
<!-- CHAT COLORS -->
<Color x:Key="ChatRightBalloonBackgroundColor">#525ABB</Color>
<Color x:Key="ChatBalloonFooterTextColor">#FFFFFF</Color>
<Color x:Key="ChatRightTextColor">#FFFFFF</Color>
<Color x:Key="ChatLeftTextColor">#FFFFFF</Color>
</ResourceDictionary>
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace inutralia
{
public partial class GrialDarkTheme
{
public GrialDarkTheme()
{
InitializeComponent();
}
}
public partial class GrialDarkTheme
{
public GrialDarkTheme()
{
InitializeComponent();
}
}
}
......@@ -4,7 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.GrialEnterpriseTheme">
<!--
<!--
THEME COLORS
The colors below will be automatically updated on each platform project by the build task.
......@@ -19,69 +19,63 @@
...but this is:
#FF169CEE
-->
<!-- Grial Theme Exported Colors -->
<Color x:Key="AccentColor">#FF25BC99</Color>
<Color x:Key="BaseTextColor">#FFFFFF</Color>
<!-- GENERAL COLORS -->
<Color x:Key="InverseTextColor">White</Color>
<Color x:Key="BrandColor">#1F8269</Color>
<Color x:Key="BrandNameColor">#FFFFFF</Color>
<Color x:Key="BaseLightTextColor">#7b7b7b</Color>
<Color x:Key="OverImageTextColor">#FFFFFF</Color>
<Color x:Key="EcommercePromoTextColor">#FFFFFF</Color>
<Color x:Key="SocialHeaderTextColor">#666666</Color>
<Color x:Key="ArticleHeaderBackgroundColor">#344860</Color>
<Color x:Key="CustomNavBarTextColor">#FFFFFF</Color>
<Color x:Key="ListViewItemTextColor">#666666</Color>
<Color x:Key="AboutHeaderBackgroundColor">#FFFFFF</Color>
<Color x:Key="BasePageColor">#1A2634</Color>
<Color x:Key="BaseTabbedPageColor">#fafafa</Color>
<Color x:Key="MainWrapperBackgroundColor">#1B1D22</Color>
<Color x:Key="CategoriesListIconColor">#55000000</Color>
<Color x:Key="DashboardIconColor">#FFFFFF</Color>
<!-- COMPLEMENT COLORS -->
<Color x:Key="ComplementColor">#525ABB</Color>
<Color x:Key="TranslucidBlack">#44000000</Color>
<Color x:Key="TranslucidWhite">#22ffffff</Color>
<!-- INDICATOR COLORS -->
<Color x:Key="OkColor">#22c064</Color>
<Color x:Key="ErrorColor">Red</Color>
<Color x:Key="WarningColor">#ffc107</Color>
<Color x:Key="NotificationColor">#1274d1</Color>
<!-- BUTTONS & ENTRY COLORS -->
<Color x:Key="SaveButtonColor">#22c064</Color>
<Color x:Key="DeleteButtonColor">#D50000</Color>
<Color x:Key="LabelButtonColor">#ffffff</Color>
<Color x:Key="PlaceholderColor">#ffffff</Color>
<Color x:Key="PlaceholderColorEntry">#344860</Color>
<Color x:Key="RoundedLabelBackgroundColor">#122336</Color>
<!-- MAIN MENU COLORS -->
<Color x:Key="MainMenuHeaderBackgroundColor">#384F63</Color>
<Color x:Key="MainMenuBackgroundColor">#344860</Color>
<Color x:Key="MainMenuSeparatorColor">Transparent</Color>
<Color x:Key="MainMenuTextColor">#FFFFFF</Color>
<Color x:Key="MainMenuIconColor">#FFFFFF</Color>
<!-- SEPARATORS COLORS -->
<Color x:Key="ListViewSeparatorColor">#1B1D22</Color>
<Color x:Key="BaseSeparatorColor">#7b7b7b</Color>
<!-- CHAT COLORS -->
<Color x:Key="ChatRightBalloonBackgroundColor">#525ABB</Color>
<Color x:Key="ChatBalloonFooterTextColor">#FFFFFF</Color>
<Color x:Key="ChatRightTextColor">#FFFFFF</Color>
<Color x:Key="ChatLeftTextColor">#FFFFFF</Color>
<!-- Grial Theme Exported Colors -->
<Color x:Key="AccentColor">#FF25BC99</Color>
<Color x:Key="BaseTextColor">#FFFFFF</Color>
<!-- GENERAL COLORS -->
<Color x:Key="InverseTextColor">White</Color>
<Color x:Key="BrandColor">#1F8269</Color>
<Color x:Key="BrandNameColor">#FFFFFF</Color>
<Color x:Key="BaseLightTextColor">#7b7b7b</Color>
<Color x:Key="OverImageTextColor">#FFFFFF</Color>
<Color x:Key="EcommercePromoTextColor">#FFFFFF</Color>
<Color x:Key="SocialHeaderTextColor">#666666</Color>
<Color x:Key="ArticleHeaderBackgroundColor">#344860</Color>
<Color x:Key="CustomNavBarTextColor">#FFFFFF</Color>
<Color x:Key="ListViewItemTextColor">#666666</Color>
<Color x:Key="AboutHeaderBackgroundColor">#FFFFFF</Color>
<Color x:Key="BasePageColor">#1A2634</Color>
<Color x:Key="BaseTabbedPageColor">#fafafa</Color>
<Color x:Key="MainWrapperBackgroundColor">#1B1D22</Color>
<Color x:Key="CategoriesListIconColor">#55000000</Color>
<Color x:Key="DashboardIconColor">#FFFFFF</Color>
<!-- COMPLEMENT COLORS -->
<Color x:Key="ComplementColor">#525ABB</Color>
<Color x:Key="TranslucidBlack">#44000000</Color>
<Color x:Key="TranslucidWhite">#22ffffff</Color>
<!-- INDICATOR COLORS -->
<Color x:Key="OkColor">#22c064</Color>
<Color x:Key="ErrorColor">Red</Color>
<Color x:Key="WarningColor">#ffc107</Color>
<Color x:Key="NotificationColor">#1274d1</Color>
<!-- BUTTONS & ENTRY COLORS -->
<Color x:Key="SaveButtonColor">#22c064</Color>
<Color x:Key="DeleteButtonColor">#D50000</Color>
<Color x:Key="LabelButtonColor">#ffffff</Color>
<Color x:Key="PlaceholderColor">#ffffff</Color>
<Color x:Key="PlaceholderColorEntry">#344860</Color>
<Color x:Key="RoundedLabelBackgroundColor">#122336</Color>
<!-- MAIN MENU COLORS -->
<Color x:Key="MainMenuHeaderBackgroundColor">#384F63</Color>
<Color x:Key="MainMenuBackgroundColor">#344860</Color>
<Color x:Key="MainMenuSeparatorColor">Transparent</Color>
<Color x:Key="MainMenuTextColor">#FFFFFF</Color>
<Color x:Key="MainMenuIconColor">#FFFFFF</Color>
<!-- SEPARATORS COLORS -->
<Color x:Key="ListViewSeparatorColor">#1B1D22</Color>
<Color x:Key="BaseSeparatorColor">#7b7b7b</Color>
<!-- CHAT COLORS -->
<Color x:Key="ChatRightBalloonBackgroundColor">#525ABB</Color>
<Color x:Key="ChatBalloonFooterTextColor">#FFFFFF</Color>
<Color x:Key="ChatRightTextColor">#FFFFFF</Color>
<Color x:Key="ChatLeftTextColor">#FFFFFF</Color>
</ResourceDictionary>
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace inutralia
{
public partial class GrialEnterpriseTheme
{
public GrialEnterpriseTheme()
{
InitializeComponent();
}
}
public partial class GrialEnterpriseTheme
{
public GrialEnterpriseTheme()
{
InitializeComponent();
}
}
}
......@@ -4,7 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.GrialLightTheme">
<!--
<!--
THEME COLORS
The colors below will be automatically updated on each platform project by the build task.
......@@ -19,69 +19,65 @@
...but this is:
#FF169CEE
-->
<!-- Grial Theme Exported Colors -->
<Color x:Key="AccentColor">#FFDA125F</Color>
<Color x:Key="BaseTextColor">#666666</Color>
<!-- GENERAL COLORS -->
<Color x:Key="InverseTextColor">White</Color>
<Color x:Key="BrandColor">#ad1457</Color>
<Color x:Key="BrandNameColor">#FFFFFF</Color>
<Color x:Key="BaseLightTextColor">#7b7b7b</Color>
<Color x:Key="OverImageTextColor">#FFFFFF</Color>
<Color x:Key="EcommercePromoTextColor">#FFFFFF</Color>
<Color x:Key="SocialHeaderTextColor">#666666</Color>
<Color x:Key="ArticleHeaderBackgroundColor">#F1F3F5</Color>
<Color x:Key="CustomNavBarTextColor">#FFFFFF</Color>
<Color x:Key="ListViewItemTextColor">#666666</Color>
<Color x:Key="AboutHeaderBackgroundColor">#FFFFFF</Color>
<Color x:Key="BasePageColor">#FFFFFF</Color>
<Color x:Key="BaseTabbedPageColor">#fafafa</Color>
<Color x:Key="MainWrapperBackgroundColor">#EFEFEF</Color>
<Color x:Key="CategoriesListIconColor">#55000000</Color>
<Color x:Key="DashboardIconColor">#FFFFFF</Color>
<!-- COMPLEMENT COLORS -->
<Color x:Key="ComplementColor">#525ABB</Color>
<Color x:Key="TranslucidBlack">#44000000</Color>
<Color x:Key="TranslucidWhite">#22ffffff</Color>
<!-- INDICATOR COLORS -->
<Color x:Key="OkColor">#22c064</Color>
<Color x:Key="ErrorColor">Red</Color>
<Color x:Key="WarningColor">#ffc107</Color>
<Color x:Key="NotificationColor">#1274d1</Color>
<!-- BUTTONS & ENTRY COLORS -->
<Color x:Key="SaveButtonColor">#22c064</Color>
<Color x:Key="DeleteButtonColor">#D50000</Color>
<Color x:Key="LabelButtonColor">#ffffff</Color>
<Color x:Key="PlaceholderColor">#22ffffff</Color>
<Color x:Key="PlaceholderColorEntry">#FFFFFF</Color>
<Color x:Key="RoundedLabelBackgroundColor">#525ABB</Color>
<!-- MAIN MENU COLORS -->
<Color x:Key="MainMenuHeaderBackgroundColor">#384F63</Color>
<Color x:Key="MainMenuBackgroundColor">#F1F3F5</Color>
<Color x:Key="MainMenuSeparatorColor">Transparent</Color>
<Color x:Key="MainMenuTextColor">#666666</Color>
<Color x:Key="MainMenuIconColor">#666666</Color>
<!-- SEPARATORS COLORS -->
<Color x:Key="ListViewSeparatorColor">#D3D3D3</Color>
<Color x:Key="BaseSeparatorColor">#7b7b7b</Color>
<!-- CHAT COLORS -->
<Color x:Key="ChatRightBalloonBackgroundColor">#525ABB</Color>
<Color x:Key="ChatBalloonFooterTextColor">#FFFFFF</Color>
<Color x:Key="ChatRightTextColor">#FFFFFF</Color>
<Color x:Key="ChatLeftTextColor">#FFFFFF</Color>
<!-- Grial Theme Exported Colors -->
<Color x:Key="AccentColor">#FFDA125F</Color>
<Color x:Key="BaseTextColor">#666666</Color>
<!-- GENERAL COLORS -->
<Color x:Key="InverseTextColor">White</Color>
<Color x:Key="BrandColor">#ad1457</Color>
<Color x:Key="BrandNameColor">#FFFFFF</Color>
<Color x:Key="BaseLightTextColor">#7b7b7b</Color>
<Color x:Key="OverImageTextColor">#FFFFFF</Color>
<Color x:Key="EcommercePromoTextColor">#FFFFFF</Color>
<Color x:Key="SocialHeaderTextColor">#666666</Color>
<Color x:Key="ArticleHeaderBackgroundColor">#F1F3F5</Color>
<Color x:Key="CustomNavBarTextColor">#FFFFFF</Color>
<Color x:Key="ListViewItemTextColor">#666666</Color>
<Color x:Key="AboutHeaderBackgroundColor">#FFFFFF</Color>
<Color x:Key="BasePageColor">#FFFFFF</Color>
<Color x:Key="BaseTabbedPageColor">#fafafa</Color>
<Color x:Key="MainWrapperBackgroundColor">#EFEFEF</Color>
<Color x:Key="CategoriesListIconColor">#55000000</Color>
<Color x:Key="DashboardIconColor">#FFFFFF</Color>
<!-- COMPLEMENT COLORS -->
<Color x:Key="ComplementColor">#525ABB</Color>
<Color x:Key="TranslucidBlack">#44000000</Color>
<Color x:Key="TranslucidWhite">#22ffffff</Color>
<!-- INDICATOR COLORS -->
<Color x:Key="OkColor">#22c064</Color>
<Color x:Key="ErrorColor">Red</Color>
<Color x:Key="WarningColor">#ffc107</Color>
<Color x:Key="NotificationColor">#1274d1</Color>
<!-- BUTTONS & ENTRY COLORS -->
<Color x:Key="SaveButtonColor">#22c064</Color>
<Color x:Key="DeleteButtonColor">#D50000</Color>
<Color x:Key="LabelButtonColor">#ffffff</Color>
<Color x:Key="PlaceholderColor">#22ffffff</Color>
<Color x:Key="PlaceholderColorEntry">#FFFFFF</Color>
<Color x:Key="RoundedLabelBackgroundColor">#525ABB</Color>
<!-- MAIN MENU COLORS -->
<Color x:Key="MainMenuHeaderBackgroundColor">#384F63</Color>
<Color x:Key="MainMenuBackgroundColor">#F1F3F5</Color>
<Color x:Key="MainMenuSeparatorColor">Transparent</Color>
<Color x:Key="MainMenuTextColor">#666666</Color>
<Color x:Key="MainMenuIconColor">#666666</Color>
<!-- SEPARATORS COLORS -->
<Color x:Key="ListViewSeparatorColor">#D3D3D3</Color>
<Color x:Key="BaseSeparatorColor">#7b7b7b</Color>
<!-- CHAT COLORS -->
<Color x:Key="ChatRightBalloonBackgroundColor">#525ABB</Color>
<Color x:Key="ChatBalloonFooterTextColor">#FFFFFF</Color>
<Color x:Key="ChatRightTextColor">#FFFFFF</Color>
<Color x:Key="ChatLeftTextColor">#FFFFFF</Color>
</ResourceDictionary>
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace inutralia
{
public partial class GrialLightTheme
{
public GrialLightTheme()
{
InitializeComponent();
}
}
public partial class GrialLightTheme
{
public GrialLightTheme()
{
InitializeComponent();
}
}
}
......@@ -4,7 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.MyAppTheme">
<!--
<!--
THEME COLORS
The colors below will be automatically updated on each platform project by the build task.
......@@ -19,69 +19,63 @@
...but this is:
#FF169CEE
-->
<!-- Grial Theme Exported Colors -->
<Color x:Key="AccentColor">#FFa2c300</Color>
<Color x:Key="BaseTextColor">#666666</Color>
<!-- GENERAL COLORS -->
<Color x:Key="InverseTextColor">White</Color>
<Color x:Key="BrandColor">#ad1457</Color>
<Color x:Key="BrandNameColor">#FFFFFF</Color>
<Color x:Key="BaseLightTextColor">#7b7b7b</Color>
<Color x:Key="OverImageTextColor">#000000</Color>
<Color x:Key="EcommercePromoTextColor">#FFFFFF</Color>
<Color x:Key="SocialHeaderTextColor">#666666</Color>
<Color x:Key="ArticleHeaderBackgroundColor">#F1F3F5</Color>
<Color x:Key="CustomNavBarTextColor">#FFFFFF</Color>
<Color x:Key="ListViewItemTextColor">#666666</Color>
<Color x:Key="AboutHeaderBackgroundColor">#FFFFFF</Color>
<Color x:Key="BasePageColor">#FFFFFF</Color>
<Color x:Key="BaseTabbedPageColor">#fafafa</Color>
<Color x:Key="MainWrapperBackgroundColor">#EFEFEF</Color>
<Color x:Key="CategoriesListIconColor">#55000000</Color>
<Color x:Key="DashboardIconColor">#FFFFFF</Color>
<!-- COMPLEMENT COLORS -->
<Color x:Key="ComplementColor">#d480d6</Color>
<Color x:Key="TranslucidBlack">#44000000</Color>
<Color x:Key="TranslucidWhite">#22ffffff</Color>
<!-- INDICATOR COLORS -->
<Color x:Key="OkColor">#22c064</Color>
<Color x:Key="ErrorColor">Red</Color>
<Color x:Key="WarningColor">#ffc107</Color>
<Color x:Key="NotificationColor">#1274d1</Color>
<!-- BUTTONS & ENTRY COLORS -->
<Color x:Key="SaveButtonColor">#22c064</Color>
<Color x:Key="DeleteButtonColor">#D50000</Color>
<Color x:Key="LabelButtonColor">#ffffff</Color>
<Color x:Key="PlaceholderColor">#22ffffff</Color>
<Color x:Key="PlaceholderColorEntry">#FFFFFF</Color>
<Color x:Key="RoundedLabelBackgroundColor">#525ABB</Color>
<!-- MAIN MENU COLORS -->
<Color x:Key="MainMenuHeaderBackgroundColor">#384F63</Color>
<Color x:Key="MainMenuBackgroundColor">#F1F3F5</Color>
<Color x:Key="MainMenuSeparatorColor">Transparent</Color>
<Color x:Key="MainMenuTextColor">#666666</Color>
<Color x:Key="MainMenuIconColor">#666666</Color>
<!-- SEPARATORS COLORS -->
<Color x:Key="ListViewSeparatorColor">#D3D3D3</Color>
<Color x:Key="BaseSeparatorColor">#7b7b7b</Color>
<!-- CHAT COLORS -->
<Color x:Key="ChatRightBalloonBackgroundColor">#525ABB</Color>
<Color x:Key="ChatBalloonFooterTextColor">#FFFFFF</Color>
<Color x:Key="ChatRightTextColor">#FFFFFF</Color>
<Color x:Key="ChatLeftTextColor">#FFFFFF</Color>
<!-- Grial Theme Exported Colors -->
<Color x:Key="AccentColor">#FFa2c300</Color>
<Color x:Key="BaseTextColor">#666666</Color>
<!-- GENERAL COLORS -->
<Color x:Key="InverseTextColor">White</Color>
<Color x:Key="BrandColor">#ad1457</Color>
<Color x:Key="BrandNameColor">#FFFFFF</Color>
<Color x:Key="BaseLightTextColor">#7b7b7b</Color>
<Color x:Key="OverImageTextColor">#000000</Color>
<Color x:Key="EcommercePromoTextColor">#FFFFFF</Color>
<Color x:Key="SocialHeaderTextColor">#666666</Color>
<Color x:Key="ArticleHeaderBackgroundColor">#F1F3F5</Color>
<Color x:Key="CustomNavBarTextColor">#FFFFFF</Color>
<Color x:Key="ListViewItemTextColor">#666666</Color>
<Color x:Key="AboutHeaderBackgroundColor">#FFFFFF</Color>
<Color x:Key="BasePageColor">#FFFFFF</Color>
<Color x:Key="BaseTabbedPageColor">#fafafa</Color>
<Color x:Key="MainWrapperBackgroundColor">#EFEFEF</Color>
<Color x:Key="CategoriesListIconColor">#55000000</Color>
<Color x:Key="DashboardIconColor">#FFFFFF</Color>
<!-- COMPLEMENT COLORS -->
<Color x:Key="ComplementColor">#d480d6</Color>
<Color x:Key="TranslucidBlack">#44000000</Color>
<Color x:Key="TranslucidWhite">#22ffffff</Color>
<!-- INDICATOR COLORS -->
<Color x:Key="OkColor">#22c064</Color>
<Color x:Key="ErrorColor">Red</Color>
<Color x:Key="WarningColor">#ffc107</Color>
<Color x:Key="NotificationColor">#1274d1</Color>
<!-- BUTTONS & ENTRY COLORS -->
<Color x:Key="SaveButtonColor">#22c064</Color>
<Color x:Key="DeleteButtonColor">#D50000</Color>
<Color x:Key="LabelButtonColor">#ffffff</Color>
<Color x:Key="PlaceholderColor">#22ffffff</Color>
<Color x:Key="PlaceholderColorEntry">#FFFFFF</Color>
<Color x:Key="RoundedLabelBackgroundColor">#525ABB</Color>
<!-- MAIN MENU COLORS -->
<Color x:Key="MainMenuHeaderBackgroundColor">#384F63</Color>
<Color x:Key="MainMenuBackgroundColor">#F1F3F5</Color>
<Color x:Key="MainMenuSeparatorColor">Transparent</Color>
<Color x:Key="MainMenuTextColor">#666666</Color>
<Color x:Key="MainMenuIconColor">#666666</Color>
<!-- SEPARATORS COLORS -->
<Color x:Key="ListViewSeparatorColor">#D3D3D3</Color>
<Color x:Key="BaseSeparatorColor">#7b7b7b</Color>
<!-- CHAT COLORS -->
<Color x:Key="ChatRightBalloonBackgroundColor">#525ABB</Color>
<Color x:Key="ChatBalloonFooterTextColor">#FFFFFF</Color>
<Color x:Key="ChatRightTextColor">#FFFFFF</Color>
<Color x:Key="ChatLeftTextColor">#FFFFFF</Color>
</ResourceDictionary>
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace inutralia
{
public partial class MyAppTheme
{
public MyAppTheme()
{
InitializeComponent();
}
}
public partial class MyAppTheme
{
public MyAppTheme()
{
InitializeComponent();
}
}
}
using inutralia.Models;
using System.Threading.Tasks;
using MvvmHelpers; // Este namespace está en el paquete Refractored.MvvmHelpers
using Xamarin.Forms;
namespace inutralia.ViewModels
{
public class ArticleDetailViewModel : ModelBasedViewModel
{
public ArticleDetailViewModel( Article artic) : base (artic)
{
//Title = Generic?.Title;
//Subtitle = Generic?.Body;
}
public class ArticleDetailViewModel : ModelBasedViewModel
{
public ArticleDetailViewModel(Article artic) : base(artic)
{
//Title = Generic?.Title;
//Subtitle = Generic?.Body;
}
public Article Article => Model as Article;
}
}
}
......@@ -2,96 +2,93 @@
using System.Threading.Tasks;
using MvvmHelpers; // Este namespace está en el paquete Refractored.MvvmHelpers
using Xamarin.Forms;
using System.Collections.Generic;
using System.Diagnostics;
namespace inutralia.ViewModels
{
public class ArticleListViewModel : BaseViewModel
{
public ArticleListViewModel()
{
}
public class ArticleListViewModel : BaseViewModel
{
public ArticleListViewModel() { }
// Lista de articulos
ObservableRangeCollection<Article> _Articles;
// Lista de articulos
ObservableRangeCollection<Article> _Articles;
// Comando de update del listadd
Command _RefreshArticlesCommand;
// Comando de update del listadd
Command _RefreshArticlesCommand;
// Acceso a la lista de articulos
public ObservableRangeCollection<Article> Articles
{
// Getter (lazy load), crea la lista si no existe
get { return _Articles ?? (_Articles = new ObservableRangeCollection<Article>()); }
{
// Getter (lazy load), crea la lista si no existe
get { return _Articles ?? (_Articles = new ObservableRangeCollection<Article>()); }
// Setter. cambiar el valor y notifica a la vista de dicho cambio
set
{
_Articles = value;
OnPropertyChanged("Articles");
}
}
// Setter. cambiar el valor y notifica a la vista de dicho cambio
set
{
_Articles = value;
OnPropertyChanged("Articles");
}
}
/// <summary>
/// Método que realiza la carga inicial del listado
/// </summary>
public async Task ExecuteLoadArticlesCommand()
{
// Realiza el proceso de actualización si hay menos de un
// elemento en el listado
if (Articles.Count < 1)
await FetchArticles();
}
/// <summary>
/// Método que realiza la carga inicial del listado
/// </summary>
public async Task ExecuteLoadArticlesCommand()
{
// Realiza el proceso de actualización si hay menos de un
// elemento en el listado
if (Articles.Count < 1)
await FetchArticles();
}
/// <summary>
/// Acceso al comando de actualización del listado
/// </summary>
public Command RefreshArticlesCommand
{
// Getter (lazy load), crea el comando si no existe
get { return _RefreshArticlesCommand ?? (_RefreshArticlesCommand = new Command(async () => await ExecuteRefreshArticlesCommand())); }
}
/// <summary>
/// Acceso al comando de actualización del listado
/// </summary>
public Command RefreshArticlesCommand
{
// Getter (lazy load), crea el comando si no existe
get { return _RefreshArticlesCommand ?? (_RefreshArticlesCommand = new Command(async () => await ExecuteRefreshArticlesCommand())); }
}
/// <summary>
/// Proceso de ejecución del comando de actualización del listado
/// </summary>
async Task ExecuteRefreshArticlesCommand()
{
// Hace que el comando no se pueda ejecutar de nuevo
RefreshArticlesCommand.ChangeCanExecute();
/// <summary>
/// Proceso de ejecución del comando de actualización del listado
/// </summary>
async Task ExecuteRefreshArticlesCommand()
{
// Hace que el comando no se pueda ejecutar de nuevo
RefreshArticlesCommand.ChangeCanExecute();
// Realiza el proceso de actualización
await FetchArticles();
// Realiza el proceso de actualización
await FetchArticles();
// Hace que el comando pueda volver a ejecutarse
RefreshArticlesCommand.ChangeCanExecute();
}
// Hace que el comando pueda volver a ejecutarse
RefreshArticlesCommand.ChangeCanExecute();
}
/// <summary>
/// Proceso de actualización del listado
/// </summary>
async Task FetchArticles()
{
// Indicamos que estamos ocupados (provoca que aparezca el indicador de carga)
IsBusy = true;
/// <summary>
/// Proceso de actualización del listado
/// </summary>
async Task FetchArticles()
{
// Indicamos que estamos ocupados (provoca que aparezca el indicador de carga)
IsBusy = true;
// Llamada al API para coger el listado (provoca que se actualize la vista del listado)
// Nota: Al obtener el listado, el controlador Rest del servidor no retorna el cuerpo de
// la notificación (campo Body)
try
{
Articles = new ObservableRangeCollection<Article>(await App.API.RefreshListAsync<Article>());
}
catch (System.Exception e)
{
// Llamada al API para coger el listado (provoca que se actualize la vista del listado)
// Nota: Al obtener el listado, el controlador Rest del servidor no retorna el cuerpo de
// la notificación (campo Body)
try
{
Articles = new ObservableRangeCollection<Article>(await App.API.RefreshListAsync<Article>());
}
catch (System.Exception e)
{
Debug.WriteLine(e.Message);
Articles.Clear();
}
Articles.Clear();
}
// Indicamos que ya no estamos ocupados (provoca que desaparezca el indicador de carga)
IsBusy = false;
}
}
// Indicamos que ya no estamos ocupados (provoca que desaparezca el indicador de carga)
IsBusy = false;
}
}
}
\ No newline at end of file
......@@ -5,12 +5,12 @@ using System.Collections.Generic;
namespace inutralia
{
/// <summary>
/// Implements the INavigation interface on top of BaseViewModel.
/// </summary>
public abstract class BaseNavigationViewModel : BaseViewModel, INavigation
{
INavigation _Navigation
/// <summary>
/// Implements the INavigation interface on top of BaseViewModel.
/// </summary>
public abstract class BaseNavigationViewModel : BaseViewModel, INavigation
{
INavigation _Navigation
{
get
{
......@@ -21,91 +21,91 @@ namespace inutralia
return mainPage?.Navigation;
}
}
#region INavigation implementation
public void RemovePage(Page page)
{
_Navigation?.RemovePage(page);
}
public void InsertPageBefore(Page page, Page before)
{
_Navigation?.InsertPageBefore(page, before);
}
public async Task PushAsync(Page page)
{
var task = _Navigation?.PushAsync(page);
if (task != null)
await task;
}
public async Task<Page> PopAsync()
{
var task = _Navigation?.PopAsync();
return task != null ? await task : await Task.FromResult(null as Page);
}
public async Task PopToRootAsync()
{
var task = _Navigation?.PopToRootAsync();
if (task != null)
await task;
}
public async Task PushModalAsync(Page page)
{
var task = _Navigation?.PushModalAsync(page);
if (task != null)
await task;
}
public async Task<Page> PopModalAsync()
{
var task = _Navigation?.PopModalAsync();
return task != null ? await task : await Task.FromResult(null as Page);
}
public async Task PushAsync(Page page, bool animated)
{
var task = _Navigation?.PushAsync(page, animated);
if (task != null)
await task;
}
public async Task<Page> PopAsync(bool animated)
{
var task = _Navigation?.PopAsync(animated);
return task != null ? await task : await Task.FromResult(null as Page);
}
public async Task PopToRootAsync(bool animated)
{
var task = _Navigation?.PopToRootAsync(animated);
if (task != null)
await task;
}
public async Task PushModalAsync(Page page, bool animated)
{
var task = _Navigation?.PushModalAsync(page, animated);
if (task != null)
await task;
}
public async Task<Page> PopModalAsync(bool animated)
{
var task = _Navigation?.PopModalAsync(animated);
return task != null ? await task : await Task.FromResult(null as Page);
}
public IReadOnlyList<Page> NavigationStack => _Navigation?.NavigationStack;
public IReadOnlyList<Page> ModalStack => _Navigation?.ModalStack;
#endregion
}
#region INavigation implementation
public void RemovePage(Page page)
{
_Navigation?.RemovePage(page);
}
public void InsertPageBefore(Page page, Page before)
{
_Navigation?.InsertPageBefore(page, before);
}
public async Task PushAsync(Page page)
{
var task = _Navigation?.PushAsync(page);
if (task != null)
await task;
}
public async Task<Page> PopAsync()
{
var task = _Navigation?.PopAsync();
return task != null ? await task : await Task.FromResult(null as Page);
}
public async Task PopToRootAsync()
{
var task = _Navigation?.PopToRootAsync();
if (task != null)
await task;
}
public async Task PushModalAsync(Page page)
{
var task = _Navigation?.PushModalAsync(page);
if (task != null)
await task;
}
public async Task<Page> PopModalAsync()
{
var task = _Navigation?.PopModalAsync();
return task != null ? await task : await Task.FromResult(null as Page);
}
public async Task PushAsync(Page page, bool animated)
{
var task = _Navigation?.PushAsync(page, animated);
if (task != null)
await task;
}
public async Task<Page> PopAsync(bool animated)
{
var task = _Navigation?.PopAsync(animated);
return task != null ? await task : await Task.FromResult(null as Page);
}
public async Task PopToRootAsync(bool animated)
{
var task = _Navigation?.PopToRootAsync(animated);
if (task != null)
await task;
}
public async Task PushModalAsync(Page page, bool animated)
{
var task = _Navigation?.PushModalAsync(page, animated);
if (task != null)
await task;
}
public async Task<Page> PopModalAsync(bool animated)
{
var task = _Navigation?.PopModalAsync(animated);
return task != null ? await task : await Task.FromResult(null as Page);
}
public IReadOnlyList<Page> NavigationStack => _Navigation?.NavigationStack;
public IReadOnlyList<Page> ModalStack => _Navigation?.ModalStack;
#endregion
}
}
......@@ -8,13 +8,9 @@ namespace inutralia.ViewModels
{
public class CustomMenuViewModel : MenuBaseViewModel
{
public CustomMenuViewModel() : this(new Models.Menu())
{
}
public CustomMenuViewModel() : this(new Models.Menu()) { }
public CustomMenuViewModel(Models.Menu menu) : base(menu)
{
}
public CustomMenuViewModel(Models.Menu menu) : base(menu) { }
/// <summary>
/// El menú guardado en el almacenamiento local
......@@ -295,7 +291,6 @@ namespace inutralia.ViewModels
_SelectionHasBeenChanged = false;
IsBusy = false;
OnPropertyChanged("NoMenuPanel");
}
protected void SelectionChanged()
......@@ -361,7 +356,7 @@ namespace inutralia.ViewModels
}
//protected void AddRecipe ( HashSet<string> ingredients, IList<Recipe> recipes, int index)
protected void AddRecipe(HashSet<Ingredient> ingredients, IList<Recipe> recipes, int index)
protected async void AddRecipe(HashSet<Ingredient> ingredients, IList<Recipe> recipes, int index)
{
if ((index >= 0) && (index < recipes.Count))
{
......@@ -375,7 +370,8 @@ namespace inutralia.ViewModels
ingredients.Add(new Ingredient() { Name = ing.Name, Id = ing.Id });
} //endforeach
} //endif
} //endif
}//endif
await App.LocalData.RefreshListAsync<ShoppingList>();
}
protected override void OnDataRefreshed()
......
using inutralia.Models;
using System.Threading.Tasks;
using MvvmHelpers; // Este namespace está en el paquete Refractored.MvvmHelpers
using Xamarin.Forms;
using System;
namespace inutralia.ViewModels
{
public class GenericDetailViewModel : MenuBaseViewModel
{
public GenericDetailViewModel(Generic gener) : base (gener)
{
}
public class GenericDetailViewModel : MenuBaseViewModel
{
public GenericDetailViewModel(Generic gener) : base(gener) { }
}
}
......@@ -5,91 +5,89 @@ using Xamarin.Forms;
namespace inutralia.ViewModels
{
public class GenericListViewModel : BaseViewModel
{
public GenericListViewModel()
{
}
public class GenericListViewModel : BaseViewModel
{
public GenericListViewModel() { }
//Lista de menús genéricos
ObservableRangeCollection<Generic> _Generics;
//Lista de menús genéricos
ObservableRangeCollection<Generic> _Generics;
// Comando de update del listado
Command _RefreshGenericsCommand;
// Comando de update del listado
Command _RefreshGenericsCommand;
// Acceso a la lista de menús genéricos
public ObservableRangeCollection<Generic> Generics
{
// Getter (lazy load), crea la lista si no existe
get { return _Generics ?? (_Generics = new ObservableRangeCollection<Generic>()); }
// Acceso a la lista de menús genéricos
public ObservableRangeCollection<Generic> Generics
{
// Getter (lazy load), crea la lista si no existe
get { return _Generics ?? (_Generics = new ObservableRangeCollection<Generic>()); }
// Setter. Cambia el valor y notifica a la vista de dicho cambio
set
{
_Generics = value;
OnPropertyChanged("Generics");
}
}
// Setter. Cambia el valor y notifica a la vista de dicho cambio
set
{
_Generics = value;
OnPropertyChanged("Generics");
}
}
/// <summary>
/// Método que realiza la carga inicial del listado
/// </summary>
public async Task ExecuteLoadGenericsCommand()
{
// Realiza el proceso de actualización si hay menos de un
// elemento en el listado
if (Generics.Count < 1)
await FetchGenerics();
}
{
// Realiza el proceso de actualización si hay menos de un
// elemento en el listado
if (Generics.Count < 1)
await FetchGenerics();
}
/// <summary>
/// Acceso al comando de actualización del listado
/// </summary>
public Command RefreshGenericsCommand
{
// Getter (lazy load), crea el comando si no existe
get { return _RefreshGenericsCommand ?? (_RefreshGenericsCommand = new Command(async () => await ExecuteRefreshGenericsCommand())); }
}
/// <summary>
/// Acceso al comando de actualización del listado
/// </summary>
public Command RefreshGenericsCommand
{
// Getter (lazy load), crea el comando si no existe
get { return _RefreshGenericsCommand ?? (_RefreshGenericsCommand = new Command(async () => await ExecuteRefreshGenericsCommand())); }
}
/// <summary>
/// Proceso de ejecución del comando de actualización del listado
/// </summary>
async Task ExecuteRefreshGenericsCommand()
{
// Hace que el comando no se pueda ejecutar de nuevo
RefreshGenericsCommand.ChangeCanExecute();
/// <summary>
/// Proceso de ejecución del comando de actualización del listado
/// </summary>
async Task ExecuteRefreshGenericsCommand()
{
// Hace que el comando no se pueda ejecutar de nuevo
RefreshGenericsCommand.ChangeCanExecute();
// Realiza el proceso de actualización
await FetchGenerics();
// Realiza el proceso de actualización
await FetchGenerics();
// Hace que el comando pueda volver a ejecutarse
RefreshGenericsCommand.ChangeCanExecute();
}
// Hace que el comando pueda volver a ejecutarse
RefreshGenericsCommand.ChangeCanExecute();
}
/// <summary>
/// Proceso de actualización del listado
/// </summary>
async Task FetchGenerics()
{
// Indicamos que estamos ocupados (provoca que aparezca el indicador de carga)
IsBusy = true;
/// <summary>
/// Proceso de actualización del listado
/// </summary>
async Task FetchGenerics()
{
// Indicamos que estamos ocupados (provoca que aparezca el indicador de carga)
IsBusy = true;
// Llamada al API para coger el listado (provoca que se actualize la vista del listado)
// Nota: Al obtener el listado, el controlador Rest del servidor no retorna el cuerpo de
// la notificación (campo Body)
try
{
Generics = new ObservableRangeCollection<Generic>(await App.API.RefreshListAsync<Generic>());
}
catch (System.Exception)
{
// Llamada al API para coger el listado (provoca que se actualize la vista del listado)
// Nota: Al obtener el listado, el controlador Rest del servidor no retorna el cuerpo de
// la notificación (campo Body)
try
{
Generics = new ObservableRangeCollection<Generic>(await App.API.RefreshListAsync<Generic>());
}
catch (System.Exception)
{
Generics.Clear();
}
Generics.Clear();
}
// Indicamos que ya no estamos ocupados (provoca que desaparezca el indicador de carga)
IsBusy = false;
}
}
// Indicamos que ya no estamos ocupados (provoca que desaparezca el indicador de carga)
IsBusy = false;
}
}
}
\ No newline at end of file
using inutralia.Models;
using inutralia.Views;
using System.Threading.Tasks;
using MvvmHelpers; // Este namespace está en el paquete Refractored.MvvmHelpers
using Xamarin.Forms;
using System;
......@@ -10,12 +9,13 @@ namespace inutralia.ViewModels
/// <summary>
/// ViewModel de un menú semanal
/// </summary>
public abstract class MenuBaseViewModel : ModelBasedViewModel
{
public MenuBaseViewModel ( MenuBase menu) : base (menu)
{
public abstract class MenuBaseViewModel : ModelBasedViewModel
{
public MenuBaseViewModel(MenuBase menu) : base(menu)
{
Title = WeekMenu?.Title;
}
}
#region Properties
......@@ -37,13 +37,13 @@ namespace inutralia.ViewModels
get { return _Index; }
set
{
if( (_Index != value) && (value >= 0) && (value < WeekMenu?.Days?.Count) )
if ((_Index != value) && (value >= 0) && (value < WeekMenu?.Days?.Count))
{
_Index = value;
OnPropertyChanged ("Index");
OnPropertyChanged ("CurrentDay");
OnPropertyChanged("Index");
OnPropertyChanged("CurrentDay");
OnIndexChanged ();
OnIndexChanged();
} //endif
}
}
......@@ -55,7 +55,7 @@ namespace inutralia.ViewModels
{
get
{
return ( (Index >= 0) && (Index < WeekMenu?.Days?.Count) ) ? WeekMenu.Days [Index] : null;
return ((Index >= 0) && (Index < WeekMenu?.Days?.Count)) ? WeekMenu.Days[Index] : null;
}
}
......@@ -69,8 +69,8 @@ namespace inutralia.ViewModels
get { return _LoadingRecipes; }
set
{
SetProperty (ref _LoadingRecipes, value, "IsLoadingRecipes");
OnPropertyChanged ("IsNotLoadingRecipes");
SetProperty(ref _LoadingRecipes, value, "IsLoadingRecipes");
OnPropertyChanged("IsNotLoadingRecipes");
}
}
......@@ -82,8 +82,8 @@ namespace inutralia.ViewModels
get { return !_LoadingRecipes; }
set
{
SetProperty (ref _LoadingRecipes, !value, "IsLoadingRecipes");
OnPropertyChanged ("IsNotLoadingRecipes");
SetProperty(ref _LoadingRecipes, !value, "IsLoadingRecipes");
OnPropertyChanged("IsNotLoadingRecipes");
}
}
......@@ -96,8 +96,8 @@ namespace inutralia.ViewModels
/// <summary>
/// Comando para mostrar una receta
/// </summary>
public Command ShowRecipeCommand => _ShowRecipeCommand ??
(_ShowRecipeCommand = new Command (async (parameter) => await ShowRecipe (parameter as Recipe)));
public Command ShowRecipeCommand => _ShowRecipeCommand ??
(_ShowRecipeCommand = new Command(async (parameter) => await ShowRecipe(parameter as Recipe)));
protected Command _ShowRecomendationCommand = null;
......@@ -105,7 +105,7 @@ namespace inutralia.ViewModels
/// Comando para mostrar las recomendaciones
/// </summary>
public Command ShowRecomendationCommand => _ShowRecomendationCommand ??
(_ShowRecomendationCommand = new Command (async () => await ShowRecomendation()));
(_ShowRecomendationCommand = new Command(async () => await ShowRecomendation()));
#endregion
......@@ -114,7 +114,7 @@ namespace inutralia.ViewModels
/// <summary>
/// Actualiza los datos de todas las recetas
/// </summary>
public async Task LoadAllRecipesAsync ()
public async Task LoadAllRecipesAsync()
{
IsLoadingRecipes = true;
......@@ -122,13 +122,13 @@ namespace inutralia.ViewModels
foreach (var d in WeekMenu.Days)
{
foreach (var r in d.LunchFirst)
await App.API.RefreshItemAsync (r);
await App.API.RefreshItemAsync(r);
foreach (var r in d.LunchSecond)
await App.API.RefreshItemAsync (r);
await App.API.RefreshItemAsync(r);
foreach (var r in d.DinnerFirst)
await App.API.RefreshItemAsync (r);
await App.API.RefreshItemAsync(r);
foreach (var r in d.DinnerSecond)
await App.API.RefreshItemAsync (r);
await App.API.RefreshItemAsync(r);
} //endforeach
IsLoadingRecipes = false;
......@@ -140,15 +140,15 @@ namespace inutralia.ViewModels
/// <param name="recipe">La receta a mostrar</param>
protected async Task ShowRecipe(Recipe recipe)
{
await PushAsync (new RecipeDetailView () { BindingContext = new RecipeViewModel(recipe) });
await PushAsync(new RecipeDetailView() { BindingContext = new RecipeViewModel(recipe) });
}
/// <summary>
/// Navega a la vista de recomendaciones
/// </summary>
protected async Task ShowRecomendation ()
protected async Task ShowRecomendation()
{
await PushAsync (new RecomendationView () { BindingContext = WeekMenu });
await PushAsync(new RecomendationView() { BindingContext = WeekMenu });
}
#endregion
......@@ -156,12 +156,12 @@ namespace inutralia.ViewModels
/// <summary>
/// Llamado cuando se han actualizado los datos
/// </summary>
protected override void OnDataRefreshed ()
protected override void OnDataRefreshed()
{
base.OnDataRefreshed ();
base.OnDataRefreshed();
// Informar que ha cambiado el menú
OnPropertyChanged ("WeekMenu");
OnPropertyChanged("WeekMenu");
// Cambiar título
Title = WeekMenu?.Title;
......@@ -173,19 +173,17 @@ namespace inutralia.ViewModels
DayOfWeek dw = DateTime.Now.DayOfWeek;
// Como DayOfWeek empieza con el 0 en Domingo, le "restamos 1 modulo 7"
Index = ( (int) dw + 6) % 7;
Index = ((int)dw + 6) % 7;
} //endif
// Informar que ha cambiado el día actual (aunque no cambie el índice
// puede haber cambiado el contenido)
OnPropertyChanged ("CurrentDay");
OnPropertyChanged("CurrentDay");
}
/// <summary>
/// Llamado cuando ha cambiado el índice del día seleccionado
/// </summary>
protected virtual void OnIndexChanged ()
{
}
protected virtual void OnIndexChanged() { }
}
}
......@@ -12,12 +12,10 @@ namespace inutralia.ViewModels
public RecipeListViewModel()
{
Title = "Recetas";
Filters = new RecipeListOptionsViewModel();
}
public RecipeListOptionsViewModel Filters
{ get; private set; }
public RecipeListOptionsViewModel Filters { get; private set; }
// Lista de articulos
ObservableRangeCollection<Recipe> _Recipes;
......@@ -36,13 +34,13 @@ namespace inutralia.ViewModels
{
_Recipes = value;
OnPropertyChanged("Recipes");
}
}
// Indica si hay resultados
public bool IsEmpty => IsNotBusy && (Recipes.Count < 1);
public bool IsNotEmpty => IsNotBusy && (Recipes.Count > 0);
/// <summary>
/// Método que realiza la carga inicial del listado
/// </summary>
......@@ -106,31 +104,31 @@ namespace inutralia.ViewModels
{
if (orFlags.Length > 0)
orFlags += ",";
orFlags += cat.Id.ToString ();
orFlags += cat.Id.ToString();
}
else
{
if (flags.Length > 0)
flags += ",";
flags += cat.Id.ToString ();
flags += cat.Id.ToString();
} //endif
} //endif
} //endforeach
} //endforeach
if (string.IsNullOrEmpty (flags) && string.IsNullOrEmpty (orFlags) && string.IsNullOrEmpty(Filters?.Desc) )
if (string.IsNullOrEmpty(flags) && string.IsNullOrEmpty(orFlags) && string.IsNullOrEmpty(Filters?.Desc))
{
Recipes = new ObservableRangeCollection<Recipe> (await App.API.RefreshListAsync<Recipe> ());
Recipes = new ObservableRangeCollection<Recipe>(await App.API.RefreshListAsync<Recipe>());
}
else
{
var options = new Dictionary<string, string> ();
if (!string.IsNullOrEmpty (flags)) options.Add ("flags", flags);
if (!string.IsNullOrEmpty (orFlags)) options.Add ("flags_or", orFlags);
if (!string.IsNullOrEmpty (Filters?.Desc)) options.Add ("desc", Filters.Desc);
var options = new Dictionary<string, string>();
if (!string.IsNullOrEmpty(flags)) options.Add("flags", flags);
if (!string.IsNullOrEmpty(orFlags)) options.Add("flags_or", orFlags);
if (!string.IsNullOrEmpty(Filters?.Desc)) options.Add("desc", Filters.Desc);
var recipes = await App.API.RawMessage<List<Recipe>> (HttpMethod.Post, "recipes", options);
Recipes = new ObservableRangeCollection<Recipe> (recipes);
var recipes = await App.API.RawMessage<List<Recipe>>(HttpMethod.Post, "recipes", options);
Recipes = new ObservableRangeCollection<Recipe>(recipes);
} //endif
}
catch (System.Exception e)
......@@ -143,6 +141,5 @@ namespace inutralia.ViewModels
OnPropertyChanged("IsEmpty");
OnPropertyChanged("IsNotEmpty");
}
}
}
using inutralia.Models;
using MvvmHelpers;
using System.Threading.Tasks;
namespace inutralia.ViewModels
{
public class RecipeViewModel : BaseNavigationViewModel
{
public RecipeViewModel ( Recipe recipe)
public RecipeViewModel(Recipe recipe)
{
Recipe = recipe;
Title = Recipe.Name;
if(Recipe.Ingredients == null)
if (Recipe.Ingredients == null)
Recipe.Ingredients = new Ingredient[0];
}
public Recipe Recipe { get; private set; }
public async Task RefreshData ()
public async Task RefreshData()
{
if (Recipe == null)
return;
IsBusy = true;
if (await App.API.RefreshItemAsync (Recipe))
if (await App.API.RefreshItemAsync(Recipe))
{
OnPropertyChanged ("Recipe");
OnPropertyChanged("Recipe");
// Cambiar título
Title = Recipe.Name;
......@@ -33,6 +32,5 @@ namespace inutralia.ViewModels
IsBusy = false;
}
}
}
using inutralia.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace inutralia.ViewModels
......@@ -12,7 +8,7 @@ namespace inutralia.ViewModels
/// </summary>
public abstract class ModelBasedViewModel : BaseNavigationViewModel
{
public ModelBasedViewModel ( ObservableEntityData model)
public ModelBasedViewModel(ObservableEntityData model)
{
Model = model;
}
......@@ -25,20 +21,20 @@ namespace inutralia.ViewModels
/// <summary>
/// Refresca los datos del modelo asociado
/// </summary>
public async Task RefreshData ()
public async Task RefreshData()
{
if (Model == null)
return;
IsBusy = true;
if (await App.API.RefreshItemAsync (Model))
if (await App.API.RefreshItemAsync(Model))
{
// Informar que el modelo ha cambiado
OnPropertyChanged ("Model");
OnPropertyChanged("Model");
// Comportamiento específico de clases hijas
OnDataRefreshed ();
OnDataRefreshed();
} //endif
IsBusy = false;
......@@ -47,9 +43,6 @@ namespace inutralia.ViewModels
/// <summary>
/// Permite a las clases hijas realizar acciones específicas
/// </summary>
protected virtual void OnDataRefreshed ()
{
}
protected virtual void OnDataRefreshed() { }
}
}
using inutralia.Models;
using System.Threading.Tasks;
using MvvmHelpers; // Este namespace está en el paquete Refractored.MvvmHelpers
using Xamarin.Forms;
using System;
namespace inutralia.ViewModels
{
public class ProfileViewModel : BaseNavigationViewModel
{
public ProfileViewModel()
{
Profile = new Profile();
}
public class ProfileViewModel : BaseNavigationViewModel
{
public ProfileViewModel() { Profile = new Profile(); }
public Profile Profile { private set; get;}
public Profile Profile { private set; get; }
public string Code => Profile?.Code;
public int Gender
{
get
{
return Profile.Gender == 'H' ? 0 : 1;
}
set
{
Profile.Gender = value == 0 ?'H':'M';
}
get { return Profile.Gender == 'H' ? 0 : 1; }
set { Profile.Gender = value == 0 ? 'H' : 'M'; }
}
public int Physical
{
get
{
return Profile.Physical > 0 ? (Profile.Physical -1) : 0;
}
set
{
Profile.Physical = value + 1;
}
get { return Profile.Physical > 0 ? (Profile.Physical - 1) : 0; }
set { Profile.Physical = value + 1; }
}
public int Preference
{
get
{
return Profile.Preference -1 ;
}
set
{
Profile.Preference = value + 1;
}
get { return Profile.Preference - 1; }
set { Profile.Preference = value + 1; }
}
public async Task RefreshData()
{
IsBusy = true;
{
IsBusy = true;
if (await App.API.RefreshItemAsync(Profile))
{
if (await App.API.RefreshItemAsync(Profile))
{
OnPropertyChanged("Preference");
OnPropertyChanged("Profile");
OnPropertyChanged("Profile");
OnPropertyChanged("Physical");
OnPropertyChanged("Gender");
}
IsBusy = false;
}
public async Task saveData()
{
IsBusy = true;
IsBusy = false;
}
public async Task saveData()
{
IsBusy = true;
await App.API.UpdateItemAsync(Profile);
IsBusy = false;
}
}
IsBusy = false;
}
}
}
using inutralia.Models;
using MvvmHelpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using MvvmHelpers;
namespace inutralia.ViewModels
{
public class RecipeListOptionsViewModel : BaseNavigationViewModel
{
public RecipeListOptionsViewModel ()
{
Title = "Filtrado de Recetas";
}
public RecipeListOptionsViewModel() { Title = "Filtrado de Recetas"; }
public string Desc { get; set; }
......@@ -22,29 +12,26 @@ namespace inutralia.ViewModels
public ObservableRangeCollection<RecipeOptionGroupViewModel> Groups
{
get { return _Groups ?? (_Groups = new ObservableRangeCollection<RecipeOptionGroupViewModel> ()); }
get { return _Groups ?? (_Groups = new ObservableRangeCollection<RecipeOptionGroupViewModel>()); }
set
{
SetProperty (ref _Groups, value);
}
set { SetProperty(ref _Groups, value); }
}
/// <summary>
/// Método que realiza la carga inicial de las opciones de filtrado
/// </summary>
public async Task ExecuteLoadOptionsCommand ()
public void ExecuteLoadOptionsCommand()
{
// Realiza el proceso de actualización si hay menos de un
// elemento en el listado
if (Groups.Count < 1)
await FetchOptions ();
FetchOptions();
}
/// <summary>
/// Proceso de actualización del listado
/// </summary>
async Task FetchOptions ()
void FetchOptions()
{
// Indicamos que estamos ocupados (provoca que aparezca el indicador de carga)
IsBusy = true;
......@@ -55,21 +42,18 @@ namespace inutralia.ViewModels
try
{
var groups = App.FilterOptions;
var groupList = new ObservableRangeCollection<RecipeOptionGroupViewModel> ();
var groupList = new ObservableRangeCollection<RecipeOptionGroupViewModel>();
foreach (var group in groups)
groupList.Add (new RecipeOptionGroupViewModel (group));
groupList.Add(new RecipeOptionGroupViewModel(group));
Groups = groupList;
}
catch (System.Exception e)
{
Groups.Clear ();
Groups.Clear();
}
// Indicamos que ya no estamos ocupados (provoca que desaparezca el indicador de carga)
IsBusy = false;
}
}
}
......@@ -9,11 +9,11 @@ namespace inutralia.ViewModels
public RecipeOptionGroup Group { get; private set; }
public RecipeOptionGroupViewModel ( RecipeOptionGroup group)
public RecipeOptionGroupViewModel(RecipeOptionGroup group)
{
Name = group.Name;
Group = group;
AddRange (group.Options);
AddRange(group.Options);
}
}
}
using inutralia.Models;
using MvvmHelpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
......@@ -11,10 +7,7 @@ namespace inutralia.ViewModels
{
public class ShoppingListViewModel : BaseNavigationViewModel
{
public ShoppingListViewModel()
{
}
public ShoppingListViewModel() { }
ObservableRangeCollection<ShoppingList> _ShoppingList;
......@@ -38,36 +31,36 @@ namespace inutralia.ViewModels
}
}
public async Task AddItem (ShoppingList item)
public async Task AddItem(ShoppingList item)
{
// Añadir elemento y refrescar lista
if (await App.LocalData.UpdateItemAsync (item, true) != null)
await FetchShoppingList ();
if (await App.LocalData.UpdateItemAsync(item, true) != null)
await FetchShoppingList();
}
public async Task DeleteSelected ()
public async Task DeleteSelected()
{
IsBusy = true;
foreach (var item in ShoppingList)
if(item.Select)
await App.LocalData.DeleteItemAsync (item);
if (item.Select)
await App.LocalData.DeleteItemAsync(item);
ShoppingList.Clear ();
ShoppingList.Clear();
await FetchShoppingList ();
await FetchShoppingList();
}
public async Task DeleteAll ()
public async Task DeleteAll()
{
IsBusy = true;
foreach (var item in ShoppingList)
await App.LocalData.DeleteItemAsync (item);
await App.LocalData.DeleteItemAsync(item);
ShoppingList.Clear ();
ShoppingList.Clear();
await FetchShoppingList ();
await FetchShoppingList();
}
/// <summary>
......@@ -121,10 +114,10 @@ namespace inutralia.ViewModels
try
{
// Obtener lista
var list = await App.LocalData.RefreshListAsync<ShoppingList> ();
var list = await App.LocalData.RefreshListAsync<ShoppingList>();
// Ordenarla
list.Sort ((a, b) => { return a.Text.CompareTo (b.Text); });
list.Sort((a, b) => { return a.Text.CompareTo(b.Text); });
// Asignarla a la que utiliza la vista
ShoppingList = new ObservableRangeCollection<ShoppingList>(list);
......@@ -138,7 +131,6 @@ namespace inutralia.ViewModels
IsBusy = false;
}
public Command DeleteShoppingListCommand
{
// Getter (lazy load), crea el comando si no existe. Nótese que, a diferencia del comando
......@@ -173,6 +165,6 @@ namespace inutralia.ViewModels
// Indicamos que ya no estamos ocupados
IsBusy = false;
} //endif
}
}
}
}
using inutralia.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace inutralia.ViewModels
......@@ -13,9 +10,9 @@ namespace inutralia.ViewModels
{
public TrivialQuestion Question { get; set; }
public string ValidAnswer => Question.Options [Question.ValidIndex];
public string ValidAnswer => Question.Options[Question.ValidIndex];
public string Answer => Question.Options [SelectedAnswer];
public string Answer => Question.Options[SelectedAnswer];
public int SelectedAnswer { get; set; }
......@@ -28,8 +25,8 @@ namespace inutralia.ViewModels
public List<QuestionResult> Results { get; private set; }
public bool IsComplete =>
(Game?.Questions?.Count > 0) &&
public bool IsComplete =>
(Game?.Questions?.Count > 0) &&
(Game?.Questions?.Count == Game?.Answers?.Count);
public bool IsNotComplete => !IsComplete;
......@@ -39,45 +36,45 @@ namespace inutralia.ViewModels
get
{
int n = Game.Answers.Count;
return (n >= 0) && (n < Game.Questions.Count) ? Game.Questions [n] : null;
return (n >= 0) && (n < Game.Questions.Count) ? Game.Questions[n] : null;
}
}
public TrivialGameViewModel ( TrivialGame game)
public TrivialGameViewModel(TrivialGame game)
{
Game = game;
Results = null;
GenerateTitle ();
GenerateResults ();
GenerateTitle();
GenerateResults();
}
public async Task<bool> Answer ( int answer)
public async Task<bool> Answer(int answer)
{
bool retVal = Game.Answer (answer);
bool retVal = Game.Answer(answer);
await App.LocalData.UpdateItemAsync (Game);
await App.LocalData.UpdateItemAsync(Game);
GenerateTitle ();
GenerateResults ();
OnPropertyChanged ("CurrentQuestion");
OnPropertyChanged ("IsComplete");
OnPropertyChanged ("IsNotComplete");
GenerateTitle();
GenerateResults();
OnPropertyChanged("CurrentQuestion");
OnPropertyChanged("IsComplete");
OnPropertyChanged("IsNotComplete");
return retVal;
}
protected void GenerateResults ()
protected void GenerateResults()
{
if(IsComplete)
if (IsComplete)
{
if(Results == null)
if (Results == null)
{
Results = new List<QuestionResult> ();
for(int i = 0; i < Game.Questions.Count; i++)
Results = new List<QuestionResult>();
for (int i = 0; i < Game.Questions.Count; i++)
{
TrivialQuestion q = Game.Questions [i];
int answer = Game.Answers [i];
Results.Add (new QuestionResult ()
TrivialQuestion q = Game.Questions[i];
int answer = Game.Answers[i];
Results.Add(new QuestionResult()
{
Question = q,
SelectedAnswer = answer,
......@@ -85,14 +82,14 @@ namespace inutralia.ViewModels
});
} //endfor
OnPropertyChanged ("Results");
OnPropertyChanged("Results");
} //endif
} //endif
}
protected void GenerateTitle ()
protected void GenerateTitle()
{
if(IsComplete)
if (IsComplete)
{
Title = "Trivial: Partida completada";
}
......@@ -101,6 +98,5 @@ namespace inutralia.ViewModels
Title = $"Trivial: Pregunta {Game.Answers.Count + 1} de {Game.Questions.Count}";
} //endif
}
}
}
......@@ -3,8 +3,6 @@ using inutralia.Views;
using MvvmHelpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
......@@ -12,9 +10,7 @@ namespace inutralia.ViewModels
{
public class TrivialListViewModel : BaseNavigationViewModel
{
public TrivialListViewModel ()
{
}
public TrivialListViewModel() { }
// Lista de partidas
ObservableRangeCollection<TrivialGame> _Games;
......@@ -23,13 +19,13 @@ namespace inutralia.ViewModels
public ObservableRangeCollection<TrivialGame> Games
{
// Getter (lazy load), crea la lista si no existe
get { return _Games ?? (_Games = new ObservableRangeCollection<TrivialGame> ()); }
get { return _Games ?? (_Games = new ObservableRangeCollection<TrivialGame>()); }
// Setter. cambiar el valor y notifica a la vista de dicho cambio
set
{
_Games = value;
OnPropertyChanged ("Games");
OnPropertyChanged("Games");
}
}
......@@ -37,24 +33,21 @@ namespace inutralia.ViewModels
Command _NewGameCommand;
public Command NewGameCommand =>
_NewGameCommand ?? (_NewGameCommand = new Command(async () => await ExecuteNewGameCommand ()));
public Command NewGameCommand => _NewGameCommand ?? (_NewGameCommand = new Command(async () => await ExecuteNewGameCommand()));
protected async Task ExecuteNewGameCommand ()
protected async Task ExecuteNewGameCommand()
{
NewGameCommand.ChangeCanExecute ();
NewGameCommand.ChangeCanExecute();
List<TrivialQuestion> questions = null;
try
{
questions = await App.API.RefreshListAsync<TrivialQuestion> ();
questions = await App.API.RefreshListAsync<TrivialQuestion>();
}
catch (Exception e)
{ }
catch (Exception e) { }
if (questions == null)
questions = new List<TrivialQuestion> ()
if (questions == null) questions = new List<TrivialQuestion>()
{
new TrivialQuestion ()
{
......@@ -66,16 +59,15 @@ namespace inutralia.ViewModels
}
};
var game = TrivialGame.Create (questions);
await App.LocalData.UpdateItemAsync (game, true);
var game = TrivialGame.Create(questions);
await App.LocalData.UpdateItemAsync(game, true);
await PushAsync (new TrivialGameView ()
await PushAsync(new TrivialGameView()
{
BindingContext = new TrivialGameViewModel (game)
BindingContext = new TrivialGameViewModel(game)
});
NewGameCommand.ChangeCanExecute ();
NewGameCommand.ChangeCanExecute();
}
#endregion
......@@ -85,9 +77,9 @@ namespace inutralia.ViewModels
Command _DeleteGameCommand;
public Command DeleteGameCommand =>
_DeleteGameCommand ?? (_DeleteGameCommand = new Command (async (parameter) => await ExecuteDeleteGameCommand (parameter as TrivialGame)));
_DeleteGameCommand ?? (_DeleteGameCommand = new Command(async (parameter) => await ExecuteDeleteGameCommand(parameter as TrivialGame)));
protected async Task ExecuteDeleteGameCommand (TrivialGame game)
protected async Task ExecuteDeleteGameCommand(TrivialGame game)
{
// Verificar parámetro
if (game != null)
......@@ -96,10 +88,10 @@ namespace inutralia.ViewModels
IsBusy = true;
// Llamamos al API para borrar la notificación
await App.LocalData.DeleteItemAsync (game);
await App.LocalData.DeleteItemAsync(game);
// Actualizamos la lista
Games.Remove (game);
Games.Remove(game);
// Indicamos que ya no estamos ocupados (provoca que desaparezca el indicador de carga)
IsBusy = false;
......@@ -112,15 +104,15 @@ namespace inutralia.ViewModels
/// <summary>
/// Método que realiza la carga inicial del listado
/// </summary>
public async Task RefreshList ()
public async Task RefreshList()
{
await FetchGames ();
await FetchGames();
}
/// <summary>
/// Proceso de actualización del listado
/// </summary>
async Task FetchGames ()
async Task FetchGames()
{
// Indicamos que estamos ocupados (provoca que aparezca el indicador de carga)
IsBusy = true;
......@@ -128,11 +120,11 @@ namespace inutralia.ViewModels
// Llamada al API para coger el listado (provoca que se actualize la vista del listado)
try
{
Games = new ObservableRangeCollection<TrivialGame> (await App.LocalData.RefreshListAsync<TrivialGame> ());
Games = new ObservableRangeCollection<TrivialGame>(await App.LocalData.RefreshListAsync<TrivialGame>());
}
catch (System.Exception e)
{
Games.Clear ();
Games.Clear();
}
// Indicamos que ya no estamos ocupados (provoca que desaparezca el indicador de carga)
......
......@@ -14,34 +14,34 @@
-->
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
xmlns:conv="clr-namespace:inutralia.Converters;assembly=inutralia"
xmlns:views="clr-namespace:inutralia.Views;assembly=inutralia"
x:Class="inutralia.Views.ArticleListView"
x:Name="ArticleListView"
BackgroundColor="White"
Title="Articulos"
>
Title="Articulos">
<ContentPage.Resources>
<ResourceDictionary>
<conv:ImageTransformator x:Key="cnvImg"></conv:ImageTransformator>
</ResourceDictionary>
</ContentPage.Resources>
<!-- Este es el componente para el listado. Primero configura de dónde obtiene los datos
y el método al que llamar cuando se hace tap en un elemento de la lista. Luego
configura el pull-to-refresh. Por último algunas opciones de visionado y gestión
de memoria
-->
<ListView
SeparatorVisibility="None"
SeparatorColor="{ DynamicResource ListViewSeparatorColor }"
Footer=""
ItemsSource="{Binding Articles}"
RowHeight="240"
ItemTapped="ItemTapped"
HasUnevenRows="false"
x:Name="listArticle">
<ListView SeparatorVisibility="None"
SeparatorColor="{ DynamicResource ListViewSeparatorColor }"
Footer=""
ItemsSource="{Binding Articles}"
RowHeight="240"
ItemTapped="ItemTapped"
HasUnevenRows="false"
x:Name="listArticle">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
......
......@@ -4,17 +4,16 @@ using Xamarin.Forms;
namespace inutralia.Views
{
public partial class ArticleListView : ContentPage
{
// Accesor al ViewModel
protected ArticleListViewModel ViewModel => BindingContext as ArticleListViewModel;
public partial class ArticleListView : ContentPage
{
// Accesor al ViewModel
protected ArticleListViewModel ViewModel => BindingContext as ArticleListViewModel;
public ArticleListView()
{
InitializeComponent();
BindingContext = new ArticleListViewModel();
}
public ArticleListView()
{
InitializeComponent();
BindingContext = new ArticleListViewModel();
}
/// <summary>
/// Método llamado al hacer tap en un elemento de la lista. Navega a la página de detalle
......@@ -23,7 +22,7 @@ namespace inutralia.Views
/// <param name="sender">La ListView</param>
/// <param name="e">Argumentos del evento</param>
void ItemTapped(object sender, ItemTappedEventArgs e)
{
{
// e.Item apunta a la notificación seleccionada. A partir de ella se crea su ViewModel
// y con él se crea la página de detalle y se navega a ella
Navigation.PushAsync(
......@@ -35,17 +34,17 @@ namespace inutralia.Views
// Deselecciona el item para que no le cambie el color de fondo
((ListView)sender).SelectedItem = null;
}
}
/// <summary>
/// Método llamado cada vez que una página pasa a ser visible
/// </summary>
protected override async void OnAppearing()
{
base.OnAppearing();
/// <summary>
/// Método llamado cada vez que una página pasa a ser visible
/// </summary>
protected override async void OnAppearing()
{
base.OnAppearing();
// Le decimos al ViewModel que realice la primera carga del listado
await ViewModel.ExecuteLoadArticlesCommand();
}
}
// Le decimos al ViewModel que realice la primera carga del listado
await ViewModel.ExecuteLoadArticlesCommand();
}
}
}
......@@ -3,14 +3,10 @@
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.Views.ArticleViewPage"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
xmlns:fftransformations="clr-namespace:FFImageLoading.Transformations;assembly=FFImageLoading.Transformations"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
BackgroundColor="{ DynamicResource MainWrapperBackgroundColor }">
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
BackgroundColor="{ DynamicResource MainWrapperBackgroundColor }">
<ScrollView x:Name="outerScrollView">
<Grid
x:Name="layeringGrid"
RowSpacing="0"
......@@ -61,15 +57,6 @@
Margin="10"
HorizontalOptions="CenterAndExpand"
VerticalOptions="Center"/>
<!--<Label
Text="{ Binding Article.Subtitle }"
LineBreakMode="WordWrap"
TextColor="{ DynamicResource OverImageTextColor }"
FontSize="16"/>
<BoxView
Style="{StaticResource BrandNameOrnamentStyle}"
Margin="0,20,0,0"/>-->
</Grid>
</StackLayout>
......@@ -111,8 +98,6 @@
FontSize="14"
TextColor="{ DynamicResource BaseTextColor }"
HorizontalOptions="End"/>
</StackLayout>
<!-- SEPARATOR (CAJA EN LA QUE SE INCLUYEN LAS DOS VARIABLES ANTERIORES (ARTICULO Y FECHA)) -->
......@@ -170,5 +155,4 @@
</StackLayout>
</Grid>
</ScrollView>
</ContentPage>
......@@ -4,70 +4,72 @@ using Xamarin.Forms;
namespace inutralia.Views
{
public partial class ArticleViewPage : ContentPage
{
public partial class ArticleViewPage : ContentPage
{
public ArticleViewPage()
{
InitializeComponent();
}
public ArticleViewPage (ArticleDetailViewModel viewModel)
{
InitializeComponent ();
BindingContext = viewModel;
}
protected override void OnAppearing (){
base.OnAppearing ();
public ArticleViewPage(ArticleDetailViewModel viewModel)
{
InitializeComponent();
BindingContext = viewModel;
}
outerScrollView.Scrolled += OnScroll;
}
protected override void OnAppearing()
{
base.OnAppearing();
outerScrollView.Scrolled += OnScroll;
}
protected override void OnDisappearing ()
{
base.OnDisappearing ();
outerScrollView.Scrolled -= OnScroll;
}
protected override void OnDisappearing()
{
base.OnDisappearing();
outerScrollView.Scrolled -= OnScroll;
}
public void OnScroll (object sender, ScrolledEventArgs e) {
var imageHeight = img.Height * 2;
var scrollRegion = layeringGrid.Height - outerScrollView.Height;
var parallexRegion = imageHeight - outerScrollView.Height;
var factor = outerScrollView.ScrollY - parallexRegion * (outerScrollView.ScrollY / scrollRegion);
if (factor < 0)
{
factor = 0;
}
else
{
if (img.TranslationY > img.Height)
{
factor = img.Height;
}
else if( img.TranslationY > outerScrollView.ScrollY ){
img.TranslationY = outerScrollView.ScrollY;
}
}
img.TranslationY = factor;
img.Opacity = 1 - ( factor / imageHeight ) ;
//headers.Scale = 1 - ( (factor ) / (imageHeight * 2) ) ;
}
public void OnScroll(object sender, ScrolledEventArgs e)
{
var imageHeight = img.Height * 2;
var scrollRegion = layeringGrid.Height - outerScrollView.Height;
var parallexRegion = imageHeight - outerScrollView.Height;
var factor = outerScrollView.ScrollY - parallexRegion * (outerScrollView.ScrollY / scrollRegion);
public void OnMore (object sender, EventArgs e) {
var mi = ((MenuItem)sender);
DisplayAlert("More Context Action", mi.CommandParameter + " more context action", "OK");
}
if (factor < 0)
{
factor = 0;
}
public void OnDelete (object sender, EventArgs e) {
var mi = ((MenuItem)sender);
DisplayAlert("Delete Context Action", mi.CommandParameter + " delete context action", "OK");
}
else
{
if (img.TranslationY > img.Height)
{
factor = img.Height;
}
else if (img.TranslationY > outerScrollView.ScrollY)
{
img.TranslationY = outerScrollView.ScrollY;
}
}
img.TranslationY = factor;
img.Opacity = 1 - (factor / imageHeight);
//headers.Scale = 1 - ( (factor ) / (imageHeight * 2) ) ;
}
public void OnMore(object sender, EventArgs e)
{
var mi = ((MenuItem)sender);
DisplayAlert("More Context Action", mi.CommandParameter + " more context action", "OK");
}
public void OnPrimaryActionButtonClicked (object sender, EventArgs e){
public void OnDelete(object sender, EventArgs e)
{
var mi = ((MenuItem)sender);
DisplayAlert("Delete Context Action", mi.CommandParameter + " delete context action", "OK");
}
}
}
public void OnPrimaryActionButtonClicked(object sender, EventArgs e) { }
}
}
......@@ -2,18 +2,11 @@
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
x:Class="inutralia.Views.ArticleItemTemplate"
x:Name="ArticleItemTemplate"
BackgroundColor="White">
<!--<ContentPage.Resources>
<ResourceDictionary>
<local:ImageTransformator x:Key="cnvImg"></local:ImageTransformator>
</ResourceDictionary>
</ContentPage.Resources>-->
<Grid BackgroundColor="Black">
<ffimageloading:CachedImage
......@@ -22,72 +15,59 @@
Aspect="AspectFill"
Opacity="0.5"/>
<Grid
ColumnSpacing="0"
RowSpacing="6"
Padding="20">
<Grid ColumnSpacing="0"
RowSpacing="6"
Padding="20">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="10" />
</Grid.RowDefinitions>
<!--PARTE SUPERIOR-->
<StackLayout
Grid.Row="0"
VerticalOptions="End"
HorizontalOptions="Start"
>
<StackLayout
Grid.Row="1"
Orientation="Horizontal"
HorizontalOptions="Fill"
VerticalOptions="FillAndExpand"
Padding="5"
>
<StackLayout Grid.Row="0"
VerticalOptions="End"
HorizontalOptions="Start">
<StackLayout Grid.Row="1"
Orientation="Horizontal"
HorizontalOptions="Fill"
VerticalOptions="FillAndExpand"
Padding="5">
<!--TITULO-->
<Label
FontSize="Large"
FontAttributes="Bold"
Text="{Binding Title}"
LineBreakMode="WordWrap"
TextColor="{ DynamicResource InverseTextColor }"/>
<Label FontSize="Large"
FontAttributes="Bold"
Text="{Binding Title}"
LineBreakMode="WordWrap"
TextColor="{ DynamicResource InverseTextColor }"/>
</StackLayout>
</StackLayout>
<!--PARTE INFERIOR-->
<StackLayout
Grid.Row="1"
Orientation="Horizontal"
HorizontalOptions="Fill"
VerticalOptions="FillAndExpand">
<StackLayout Grid.Row="1"
Orientation="Horizontal"
HorizontalOptions="Fill"
VerticalOptions="FillAndExpand">
<!--RESUMEN -->
<Label
Text="{ Binding ExcerptCompress }"
TextColor="{ DynamicResource InverseTextColor }"
HorizontalOptions="FillAndExpand"
VerticalOptions="End"
FontSize="Small"/>
<Label Text="{ Binding ExcerptCompress }"
TextColor="{ DynamicResource InverseTextColor }"
HorizontalOptions="FillAndExpand"
VerticalOptions="End"
FontSize="Small"/>
<!--FECHA-->
<Label
Text="{Binding Date}"
TextColor="{ DynamicResource InverseTextColor }"
VerticalOptions="End"
HorizontalOptions="End"
FontSize="Micro"/>
<Label Text="{Binding Date}"
TextColor="{ DynamicResource InverseTextColor }"
VerticalOptions="End"
HorizontalOptions="End"
FontSize="Micro"/>
</StackLayout>
<BoxView
Grid.Row="2"
Style="{StaticResource BrandNameOrnamentStyle}"/>
<BoxView Grid.Row="2"
Style="{StaticResource BrandNameOrnamentStyle}"/>
</Grid>
</Grid>
</ContentView>
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace inutralia.Views
{
public partial class ArticleItemTemplate : ContentView
{
public ArticleItemTemplate ()
{
InitializeComponent ();
}
}
public partial class ArticleItemTemplate : ContentView
{
public ArticleItemTemplate()
{
InitializeComponent();
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
xmlns:converter="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared.Base"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:converter="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared.Base"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
x:Class="inutralia.Views.Badge"
x:Name="Root">
<ContentView.Resources>
<ResourceDictionary>
<converter:IsNotStringEmptyConverter
<ContentView.Resources>
<ResourceDictionary>
<converter:IsNotStringEmptyConverter
x:Key="isBadgeVisibleConverter" />
</ResourceDictionary>
</ContentView.Resources>
</ResourceDictionary>
</ContentView.Resources>
<ContentView.Content>
<AbsoluteLayout
<ContentView.Content>
<AbsoluteLayout
IsVisible="{Binding Source={x:Reference Root}, Path=BadgeText, Converter={StaticResource isBadgeVisibleConverter}}">
<Label
FontSize="28"
Text="{ x:Static local:GrialShapesFont.Circle }"
TextColor="{Binding Source={x:Reference Root}, Path=BadgeBackgroundColor}"
Style="{StaticResource FontIconBase}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
AbsoluteLayout.LayoutBounds="0,0,28,28"
/>
<Label
Text="{Binding Source={x:Reference Root}, Path=BadgeText}"
TextColor="{Binding Source={x:Reference Root}, Path=BadgeTextColor}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontSize="12"
FontAttributes="Bold"
AbsoluteLayout.LayoutBounds="0,0,28,28"
/>
</AbsoluteLayout>
</ContentView.Content>
<Label FontSize="28"
Text="{ x:Static local:GrialShapesFont.Circle }"
TextColor="{Binding Source={x:Reference Root}, Path=BadgeBackgroundColor}"
Style="{StaticResource FontIconBase}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
AbsoluteLayout.LayoutBounds="0,0,28,28"/>
<Label Text="{Binding Source={x:Reference Root}, Path=BadgeText}"
TextColor="{Binding Source={x:Reference Root}, Path=BadgeTextColor}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontSize="12"
FontAttributes="Bold"
AbsoluteLayout.LayoutBounds="0,0,28,28"/>
</AbsoluteLayout>
</ContentView.Content>
</ContentView>
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace inutralia.Views
{
public partial class Badge : ContentView
{
public Badge ()
{
InitializeComponent ();
}
/* CIRCLE */
public static BindableProperty BadgeBackgroundColorProperty =
BindableProperty.Create (
nameof ( BadgeBackgroundColor ),
typeof ( Color ),
typeof ( Badge ),
defaultValue : Color.Default,
defaultBindingMode : BindingMode.OneWay
);
public Color BadgeBackgroundColor {
get { return ( Color )GetValue( BadgeBackgroundColorProperty ); }
set { SetValue ( BadgeBackgroundColorProperty, value ); }
}
/* ICON */
public static BindableProperty BadgeTextColorProperty =
BindableProperty.Create (
nameof( BadgeTextColor ),
typeof ( Color ),
typeof ( Badge ),
defaultValue : Color.White,
defaultBindingMode : BindingMode.OneWay
);
public Color BadgeTextColor {
get { return ( Color )GetValue( BadgeTextColorProperty ); }
set { SetValue ( BadgeTextColorProperty, value ); }
}
public static BindableProperty BadgeTextProperty =
BindableProperty.Create (
nameof( BadgeText ),
typeof ( string ),
typeof ( Badge ),
defaultValue : "",
defaultBindingMode : BindingMode.OneWay
);
public string BadgeText {
get { return ( string ) GetValue( BadgeTextProperty ); }
set { SetValue ( BadgeTextProperty, value ); }
}
}
public partial class Badge : ContentView
{
public Badge()
{
InitializeComponent();
}
/* CIRCLE */
public static BindableProperty BadgeBackgroundColorProperty =
BindableProperty.Create(
nameof(BadgeBackgroundColor),
typeof(Color),
typeof(Badge),
defaultValue: Color.Default,
defaultBindingMode: BindingMode.OneWay);
public Color BadgeBackgroundColor
{
get { return (Color)GetValue(BadgeBackgroundColorProperty); }
set { SetValue(BadgeBackgroundColorProperty, value); }
}
/* ICON */
public static BindableProperty BadgeTextColorProperty =
BindableProperty.Create(
nameof(BadgeTextColor),
typeof(Color),
typeof(Badge),
defaultValue: Color.White,
defaultBindingMode: BindingMode.OneWay);
public Color BadgeTextColor
{
get { return (Color)GetValue(BadgeTextColorProperty); }
set { SetValue(BadgeTextColorProperty, value); }
}
public static BindableProperty BadgeTextProperty =
BindableProperty.Create(
nameof(BadgeText),
typeof(string),
typeof(Badge),
defaultValue: "",
defaultBindingMode: BindingMode.OneWay);
public string BadgeText
{
get { return (string)GetValue(BadgeTextProperty); }
set { SetValue(BadgeTextProperty, value); }
}
}
}
......@@ -5,43 +5,35 @@
x:Class="inutralia.BrandBlock"
Padding="20">
<Grid
ColumnSpacing="10"
Padding="0"
Style="{ StaticResource BrandContainerStyle }">
<Grid ColumnSpacing="10"
Padding="0"
Style="{ StaticResource BrandContainerStyle }">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Image
Grid.Column="0"
HeightRequest="64"
WidthRequest="64"
Source="{ StaticResource BrandImage }"
BackgroundColor="{ DynamicResource AccentColor }"
/>
<Image Grid.Column="0"
HeightRequest="64"
WidthRequest="64"
Source="{ StaticResource BrandImage }"
BackgroundColor="{ DynamicResource AccentColor }" />
<StackLayout
Grid.Column="1"
Orientation="Vertical"
HorizontalOptions="Start"
VerticalOptions="Center"
Spacing="0">
<Label
Style="{ DynamicResource BrandNameStyle }"
Text="GRIAL"
FontAttributes="Bold"
VerticalTextAlignment="Start"/>
<Label
Style="{ DynamicResource BrandNameStyle }"
Text="UI.KIT"
VerticalTextAlignment="Start"/>
</StackLayout>
<StackLayout Grid.Column="1"
Orientation="Vertical"
HorizontalOptions="Start"
VerticalOptions="Center"
Spacing="0">
</Grid>
<Label Style="{ DynamicResource BrandNameStyle }"
Text="GRIAL"
FontAttributes="Bold"
VerticalTextAlignment="Start"/>
<Label Style="{ DynamicResource BrandNameStyle }"
Text="UI.KIT"
VerticalTextAlignment="Start"/>
</StackLayout>
</Grid>
</ContentView>
......@@ -2,11 +2,11 @@ using Xamarin.Forms;
namespace inutralia
{
public partial class BrandBlock : ContentView
{
public BrandBlock ()
{
InitializeComponent ();
}
}
public partial class BrandBlock : ContentView
{
public BrandBlock()
{
InitializeComponent();
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
x:Class="inutralia.CircleIcon">
<Grid>
<Label
Text="{ x:Static local:GrialShapesFont.Circle }"
IsVisible="{ Binding ShowBackgroundColor }"
Style="{ StaticResource FontIconBase }"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
Opacity="1"
FontSize="60"
TextColor="{ DynamicResource OkColor }"
/>
<Grid>
<Label Text="{ x:Static local:GrialShapesFont.Circle }"
IsVisible="{ Binding ShowBackgroundColor }"
Style="{ StaticResource FontIconBase }"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
Opacity="1"
FontSize="60"
TextColor="{ DynamicResource OkColor }" />
<Label
Text="{ x:Static local:GrialShapesFont.ShoppingCart }"
FontSize="25"
Style="{ StaticResource FontIcon }"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
TextColor="{ DynamicResource InverseTextColor }"
/>
</Grid>
<Label Text="{ x:Static local:GrialShapesFont.ShoppingCart }"
FontSize="25"
Style="{ StaticResource FontIcon }"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
TextColor="{ DynamicResource InverseTextColor }" />
</Grid>
</ContentView>
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace inutralia
{
public partial class CircleIcon : ContentView
{
public CircleIcon ()
{
InitializeComponent ();
}
}
public partial class CircleIcon : ContentView
{
public CircleIcon()
{
InitializeComponent();
}
}
}
......@@ -3,24 +3,22 @@
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
x:Class="inutralia.CustomActivityIndicator"
>
<ContentView.Content>
<Grid
x:Class="inutralia.CustomActivityIndicator" >
<ContentView.Content>
<Grid
x:Name="Wrapper">
<BoxView
HeightRequest="64"
WidthRequest="64"
BackgroundColor="{DynamicResource AccentColor}" />
<Label
Text="{ x:Static local:GrialShapesFont.LogoGrial }"
Style="{ DynamicResource FontIconBase }"
TextColor="White"
FontSize="45"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Center"/>
</Grid>
</ContentView.Content>
<BoxView HeightRequest="64"
WidthRequest="64"
BackgroundColor="{DynamicResource AccentColor}" />
<Label Text="{ x:Static local:GrialShapesFont.LogoGrial }"
Style="{ DynamicResource FontIconBase }"
TextColor="White"
FontSize="45"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Center"/>
</Grid>
</ContentView.Content>
</ContentView>
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace inutralia
{
public partial class CustomActivityIndicator : ContentView
{
public CustomActivityIndicator()
{
InitializeComponent();
spinY(Wrapper, 1000);
}
static void spinY(View child, uint duration)
{
var animation = new Animation(
callback: d => child.RotationY = d,
start: 0,
end: 360,
easing: Easing.Linear);
animation.Commit(child, "Loop", length: duration, repeat:()=>true);
}
}
public partial class CustomActivityIndicator : ContentView
{
public CustomActivityIndicator()
{
InitializeComponent();
SpinY(Wrapper, 1000);
}
static void SpinY(View child, uint duration)
{
var animation = new Animation(
callback: d => child.RotationY = d,
start: 0,
end: 360,
easing: Easing.Linear);
animation.Commit(child, "Loop", length: duration, repeat: () => true);
}
}
}
......@@ -4,22 +4,20 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
x:Class="inutralia.Rating">
<ContentView.Content>
<Label
x:Name="RatingLabel"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Start"
Text="{ Binding Value }"
TextColor="#ffb300"
Style="{ StaticResource FontIconBase }"
FontSize="{ artina:OnOrientationDouble
PortraitPhone=24,
LandscapePhone=24,
PortraitTablet=34,
LandscapeTablet=34 }"/>
</ContentView.Content>
<ContentView.Content>
<Label x:Name="RatingLabel"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Start"
Text="{ Binding Value }"
TextColor="#ffb300"
Style="{ StaticResource FontIconBase }"
FontSize="{ artina:OnOrientationDouble
PortraitPhone=24,
LandscapePhone=24,
PortraitTablet=34,
LandscapeTablet=34 }"/>
</ContentView.Content>
</ContentView>
......
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace inutralia
{
public partial class Rating : ContentView
{
private string RATING_EMPTY_ICON_CHAR = GrialShapesFont.StarBorder;
private string RATING_PARTIAL_ICON_CHAR = GrialShapesFont.StarHalf;
private string RATING_FULL_ICON_CHAR = GrialShapesFont.Star;
public Rating()
{
InitializeComponent();
}
public static BindableProperty ValueProperty =
BindableProperty.Create(
nameof(Value),
typeof(double),
typeof(Rating),
0.0,
defaultBindingMode: BindingMode.OneWay,
propertyChanged: (bindable, oldValue, newValue) =>
{
var ctrl = (Rating)bindable;
ctrl.RatingLabel.Text = ctrl.Update();
}
);
public double Value
{
get { return (double)GetValue(ValueProperty); }
set { SetValue(ValueProperty, value); }
}
public static BindableProperty MaxProperty =
BindableProperty.Create(
nameof(Max),
typeof(double),
typeof(Rating),
5.0,
defaultBindingMode: BindingMode.OneWay,
propertyChanged: (bindable, oldValue, newValue) =>
{
var ctrl = (Rating)bindable;
ctrl.RatingLabel.Text = ctrl.Update();
}
);
public double Max
{
get { return (double)GetValue(MaxProperty); }
set { SetValue(MaxProperty, value); }
}
public string Update()
{
var str = string.Empty;
var value = Value;
if (Value > Max)
{
value = Max;
}
else if (Value < 0)
{
value = 0;
}
for (var i = 1; i <= Max; i++)
{
if (i < value || Math.Abs((double)i - value) < 0.01) // i <= value
{
str += RATING_FULL_ICON_CHAR;
}
else {
if (i - value > 1.0)
{
str += RATING_EMPTY_ICON_CHAR;
}
else {
var decimals = value - Math.Floor(value);
if (decimals < 0.2)
{
str += RATING_EMPTY_ICON_CHAR;
}
else if (decimals > 0.8)
{
str += RATING_FULL_ICON_CHAR;
}
else {
str += RATING_PARTIAL_ICON_CHAR;
}
}
}
}
return str;
}
}
public partial class Rating : ContentView
{
private string RATING_EMPTY_ICON_CHAR = GrialShapesFont.StarBorder;
private string RATING_PARTIAL_ICON_CHAR = GrialShapesFont.StarHalf;
private string RATING_FULL_ICON_CHAR = GrialShapesFont.Star;
public Rating()
{
InitializeComponent();
}
public static BindableProperty ValueProperty =
BindableProperty.Create(
nameof(Value),
typeof(double),
typeof(Rating),
0.0,
defaultBindingMode: BindingMode.OneWay,
propertyChanged: (bindable, oldValue, newValue) =>
{
var ctrl = (Rating)bindable;
ctrl.RatingLabel.Text = ctrl.Update();
}
);
public double Value
{
get { return (double)GetValue(ValueProperty); }
set { SetValue(ValueProperty, value); }
}
public static BindableProperty MaxProperty =
BindableProperty.Create(
nameof(Max),
typeof(double),
typeof(Rating),
5.0,
defaultBindingMode: BindingMode.OneWay,
propertyChanged: (bindable, oldValue, newValue) =>
{
var ctrl = (Rating)bindable;
ctrl.RatingLabel.Text = ctrl.Update();
}
);
public double Max
{
get { return (double)GetValue(MaxProperty); }
set { SetValue(MaxProperty, value); }
}
public string Update()
{
var str = string.Empty;
var value = Value;
if (Value > Max)
{
value = Max;
}
else if (Value < 0)
{
value = 0;
}
for (var i = 1; i <= Max; i++)
{
if (i < value || Math.Abs((double)i - value) < 0.01) // i <= value
{
str += RATING_FULL_ICON_CHAR;
}
else
{
if (i - value > 1.0)
{
str += RATING_EMPTY_ICON_CHAR;
}
else
{
var decimals = value - Math.Floor(value);
if (decimals < 0.2)
{
str += RATING_EMPTY_ICON_CHAR;
}
else if (decimals > 0.8)
{
str += RATING_FULL_ICON_CHAR;
}
else
{
str += RATING_PARTIAL_ICON_CHAR;
}
}
}
}
return str;
}
}
}
......@@ -6,24 +6,22 @@
xmlns:effects="clr-namespace:UXDivers.Effects;assembly=UXDivers.Effects"
x:Class="inutralia.RoundedLabel"
Padding="0">
<ContentView.Content>
<AbsoluteLayout
<ContentView.Content>
<AbsoluteLayout
effects:Effects.CornerRadius="{ Binding Source={ x:Reference Root }, Path=RoundedLabelCornerRadius }"
BackgroundColor="{ Binding Source={ x:Reference Root }, Path=RoundedLabelBackgroundColor }"
>
<Label
VerticalOptions="Center"
LineBreakMode="TailTruncation"
Margin="{ Binding Source={ x:Reference Root }, Path=RoundedLabelPadding }"
FontSize="{ Binding Source={ x:Reference Root }, Path=RoundedLabelFontSize }"
Text="{ Binding Source={ x:Reference Root }, Path=RoundedLabelText }"
TextColor="{ Binding Source={ x:Reference Root }, Path=RoundedLabelTextColor }"
AbsoluteLayout.LayoutBounds="0, 0.5, AutoSize, AutoSize"
AbsoluteLayout.LayoutFlags="XProportional, YProportional" />
</AbsoluteLayout>
</ContentView.Content>
BackgroundColor="{ Binding Source={ x:Reference Root }, Path=RoundedLabelBackgroundColor }" >
<Label VerticalOptions="Center"
LineBreakMode="TailTruncation"
Margin="{ Binding Source={ x:Reference Root }, Path=RoundedLabelPadding }"
FontSize="{ Binding Source={ x:Reference Root }, Path=RoundedLabelFontSize }"
Text="{ Binding Source={ x:Reference Root }, Path=RoundedLabelText }"
TextColor="{ Binding Source={ x:Reference Root }, Path=RoundedLabelTextColor }"
AbsoluteLayout.LayoutBounds="0, 0.5, AutoSize, AutoSize"
AbsoluteLayout.LayoutFlags="XProportional, YProportional" />
</AbsoluteLayout>
</ContentView.Content>
</ContentView>
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace inutralia
{
public partial class RoundedLabel : ContentView
{
public RoundedLabel()
{
InitializeComponent();
}
public static BindableProperty RoundedLabelBackgroundColorProperty =
BindableProperty.Create (
nameof ( RoundedLabelBackgroundColor ),
typeof ( Color ),
typeof ( RoundedLabel ),
defaultValue : Color.Green,
defaultBindingMode : BindingMode.OneWay
);
public partial class RoundedLabel : ContentView
{
public RoundedLabel()
{
InitializeComponent();
}
public Color RoundedLabelBackgroundColor {
get { return ( Color )GetValue( RoundedLabelBackgroundColorProperty ); }
set { SetValue ( RoundedLabelBackgroundColorProperty, value ); }
}
public static BindableProperty RoundedLabelTextColorProperty =
BindableProperty.Create (
nameof( RoundedLabelTextColor ),
typeof ( Color ),
typeof ( RoundedLabel ),
defaultValue : Color.White,
defaultBindingMode : BindingMode.OneWay
);
public static BindableProperty RoundedLabelBackgroundColorProperty = BindableProperty.Create(
nameof(RoundedLabelBackgroundColor),
typeof(Color),
typeof(RoundedLabel),
defaultValue: Color.Green,
defaultBindingMode: BindingMode.OneWay);
public Color RoundedLabelTextColor {
get { return ( Color )GetValue( RoundedLabelTextColorProperty ); }
set { SetValue ( RoundedLabelTextColorProperty, value ); }
}
public Color RoundedLabelBackgroundColor
{
get { return (Color)GetValue(RoundedLabelBackgroundColorProperty); }
set { SetValue(RoundedLabelBackgroundColorProperty, value); }
}
public static BindableProperty RoundedLabelTextProperty =
BindableProperty.Create (
nameof( RoundedLabelText ),
typeof ( string ),
typeof ( RoundedLabel ),
defaultValue : "",
defaultBindingMode : BindingMode.OneWay
);
public static BindableProperty RoundedLabelTextColorProperty = BindableProperty.Create(
nameof(RoundedLabelTextColor),
typeof(Color),
typeof(RoundedLabel),
defaultValue: Color.White,
defaultBindingMode: BindingMode.OneWay);
public string RoundedLabelText {
get { return (string) GetValue( RoundedLabelTextProperty ); }
set { SetValue ( RoundedLabelTextProperty, value ); }
}
public static BindableProperty RoundedLabelPaddingProperty =
BindableProperty.Create (
nameof ( RoundedLabelPadding ),
typeof ( Thickness ),
typeof ( RoundedLabel ),
defaultValue : new Thickness(6,0),
defaultBindingMode : BindingMode.OneWay
);
public Color RoundedLabelTextColor
{
get { return (Color)GetValue(RoundedLabelTextColorProperty); }
set { SetValue(RoundedLabelTextColorProperty, value); }
}
public Thickness RoundedLabelPadding {
get { return ( Thickness )GetValue( RoundedLabelPaddingProperty ); }
set { SetValue ( RoundedLabelPaddingProperty, value ); }
}
public static BindableProperty RoundedLabelCornerRadiusProperty =
BindableProperty.Create (
nameof ( RoundedLabelCornerRadius ),
typeof ( Double ),
typeof ( RoundedLabel ),
defaultValue : 6.0,
defaultBindingMode : BindingMode.OneWay
);
public static BindableProperty RoundedLabelTextProperty = BindableProperty.Create(
nameof(RoundedLabelText),
typeof(string),
typeof(RoundedLabel),
defaultValue: "",
defaultBindingMode: BindingMode.OneWay);
public Double RoundedLabelCornerRadius {
get { return ( Double )GetValue( RoundedLabelCornerRadiusProperty ); }
set { SetValue ( RoundedLabelCornerRadiusProperty, value ); }
}
public static BindableProperty RoundedLabelFontSizeProperty =
BindableProperty.Create (
nameof ( RoundedLabelFontSize ),
typeof ( Double ),
typeof ( RoundedLabel ),
defaultValue : 10.0,
defaultBindingMode : BindingMode.OneWay
);
public string RoundedLabelText
{
get { return (string)GetValue(RoundedLabelTextProperty); }
set { SetValue(RoundedLabelTextProperty, value); }
}
public Double RoundedLabelFontSize {
get { return ( Double )GetValue( RoundedLabelFontSizeProperty ); }
set { SetValue ( RoundedLabelFontSizeProperty, value ); }
}
public static BindableProperty RoundedLabelFontAttributesProperty =
BindableProperty.Create (
nameof ( RoundedLabelFontAttributes ),
typeof ( Enum ),
typeof ( RoundedLabel ),
defaultValue : null,
defaultBindingMode : BindingMode.OneWay
);
public static BindableProperty RoundedLabelPaddingProperty = BindableProperty.Create(
nameof(RoundedLabelPadding),
typeof(Thickness),
typeof(RoundedLabel),
defaultValue: new Thickness(6, 0),
defaultBindingMode: BindingMode.OneWay);
public Enum RoundedLabelFontAttributes {
get { return ( Enum )GetValue( RoundedLabelFontAttributesProperty ); }
set { SetValue ( RoundedLabelFontAttributesProperty, value ); }
}
}
public Thickness RoundedLabelPadding
{
get { return (Thickness)GetValue(RoundedLabelPaddingProperty); }
set { SetValue(RoundedLabelPaddingProperty, value); }
}
public static BindableProperty RoundedLabelCornerRadiusProperty = BindableProperty.Create(
nameof(RoundedLabelCornerRadius),
typeof(Double),
typeof(RoundedLabel),
defaultValue: 6.0,
defaultBindingMode: BindingMode.OneWay);
public Double RoundedLabelCornerRadius
{
get { return (Double)GetValue(RoundedLabelCornerRadiusProperty); }
set { SetValue(RoundedLabelCornerRadiusProperty, value); }
}
public static BindableProperty RoundedLabelFontSizeProperty = BindableProperty.Create(
nameof(RoundedLabelFontSize),
typeof(Double),
typeof(RoundedLabel),
defaultValue: 10.0,
defaultBindingMode: BindingMode.OneWay);
public Double RoundedLabelFontSize
{
get { return (Double)GetValue(RoundedLabelFontSizeProperty); }
set { SetValue(RoundedLabelFontSizeProperty, value); }
}
public static BindableProperty RoundedLabelFontAttributesProperty = BindableProperty.Create(
nameof(RoundedLabelFontAttributes),
typeof(Enum),
typeof(RoundedLabel),
defaultValue: null,
defaultBindingMode: BindingMode.OneWay);
public Enum RoundedLabelFontAttributes
{
get { return (Enum)GetValue(RoundedLabelFontAttributesProperty); }
set { SetValue(RoundedLabelFontAttributesProperty, value); }
}
}
}
......@@ -2,13 +2,14 @@
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.Views.HomeView"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
NavigationPage.HasNavigationBar="false"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
NavigationPage.HasNavigationBar="false"
Padding ="0,40,0,10">
<StackLayout>
<!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*LOGO-*-*-*-*-*-*-*-*-*-*-*-* -->
<StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Image Source="logo_empresa.png" Aspect="AspectFit" HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand" >
<Image.WidthRequest>
......@@ -30,6 +31,7 @@
</StackLayout>
<!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*MENÚ CUADRADOS-*-*-*-*-*-*-*-*-*-*-*-* -->
<Grid HorizontalOptions="Center" VerticalOptions="FillAndExpand" Padding="15,20,15,10" ColumnSpacing="10" RowSpacing="10">
<Grid.RowDefinitions>
......@@ -60,9 +62,8 @@
</Image.WidthRequest>
<Image.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnTapGestureProfile"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Tapped="OnTapGestureProfile"
NumberOfTapsRequired="1" />
</Image.GestureRecognizers>
</Image>
......@@ -84,9 +85,8 @@
</Image.WidthRequest>
<Image.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnTapGestureMenu"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Tapped="OnTapGestureMenu"
NumberOfTapsRequired="1" />
</Image.GestureRecognizers>
</Image>
......@@ -108,9 +108,8 @@
</Image.WidthRequest>
<Image.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnTapGestureGeneric"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Tapped="OnTapGestureGeneric"
NumberOfTapsRequired="1" />
</Image.GestureRecognizers>
</Image>
......@@ -132,16 +131,15 @@
</Image.WidthRequest>
<Image.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnTapGestureTrivial"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Tapped="OnTapGestureTrivial"
NumberOfTapsRequired="1" />
</Image.GestureRecognizers>
</Image>
</Grid>
<!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*MENÚ LISTADO-*-*-*-*-*-*-*-*-*-*-*-* -->
<Grid Padding="15,0,10,20" VerticalOptions="End">
<Grid Padding="15,0,10,20" VerticalOptions="End">
<Grid.RowDefinitions>
<RowDefinition>
<RowDefinition.Height>
......@@ -200,9 +198,8 @@
<!--label clickable que englobal las 3 columnas del item del menú-->
<Label HorizontalOptions="Fill" VerticalOptions="Fill" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
<Label.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnTapGestureRecipe"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Tapped="OnTapGestureRecipe"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
......@@ -213,10 +210,10 @@
Phone="30"
Tablet="50"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnTapGestureRecipe"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Tapped="OnTapGestureRecipe"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
......@@ -227,10 +224,10 @@
Phone="15"
Tablet="25"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnTapGestureRecipe"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Tapped="OnTapGestureRecipe"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
......@@ -241,10 +238,10 @@
Phone="30"
Tablet="50"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnTapGestureRecipe"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Tapped="OnTapGestureRecipe"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
......@@ -257,9 +254,8 @@
<!--label clickable que englobal las 3 columnas del item del menú-->
<Label HorizontalOptions="Fill" VerticalOptions="Fill" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3">
<Label.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnTapGestureArticle"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Tapped="OnTapGestureArticle"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
......@@ -270,10 +266,10 @@
Phone="30"
Tablet="50"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnTapGestureArticle"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Tapped="OnTapGestureArticle"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
......@@ -284,10 +280,10 @@
Phone="15"
Tablet="25"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnTapGestureArticle"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Tapped="OnTapGestureArticle"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
......@@ -298,10 +294,10 @@
Phone="30"
Tablet="50"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnTapGestureArticle"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Tapped="OnTapGestureArticle"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
......@@ -314,9 +310,8 @@
<!--label clickable que englobal las 3 columnas del item del menú-->
<Label HorizontalOptions="Fill" VerticalOptions="Fill" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="3" >
<Label.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnTapGestureShoppingList"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Tapped="OnTapGestureShoppingList"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
......@@ -327,10 +322,10 @@
Phone="30"
Tablet="50"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnTapGestureShoppingList"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Tapped="OnTapGestureShoppingList"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
......@@ -341,10 +336,10 @@
Phone="15"
Tablet="25"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnTapGestureShoppingList"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Tapped="OnTapGestureShoppingList"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
......@@ -355,16 +350,15 @@
Phone="30"
Tablet="50"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnTapGestureShoppingList"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Tapped="OnTapGestureShoppingList"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<!---*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-5. item separator-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*_*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-* -->
<BoxView Grid.Row="5" HeightRequest="1" Grid.ColumnSpan="3" BackgroundColor="{ DynamicResource ListViewSeparatorColor }" HorizontalOptions="FillAndExpand" />
</Grid>
</StackLayout>
</ContentPage>
using inutralia.Views;
using System;
using System.Collections.Generic;
using System;
using Xamarin.Forms;
namespace inutralia.Views
{
public partial class HomeView : ContentPage
{
public partial class HomeView : ContentPage
{
protected RootPage RootPage => Application.Current.MainPage as RootPage;
public HomeView()
{
InitializeComponent();
public HomeView()
{
InitializeComponent();
}
void OnTapGestureProfile(object sender, EventArgs args)
void OnTapGestureProfile(object sender, EventArgs args)
{
RootPage?.Navigate<ProfileView> ();
}
RootPage?.Navigate<ProfileView>();
}
void OnTapGestureMenu (object sender, EventArgs args)
void OnTapGestureMenu(object sender, EventArgs args)
{
RootPage?.Navigate<CustomMenuView> ();
RootPage?.Navigate<CustomMenuView>();
}
void OnTapGestureGeneric (object sender, EventArgs args)
{
RootPage?.Navigate<GenericListView> ();
}
void OnTapGestureGeneric(object sender, EventArgs args)
{
RootPage?.Navigate<GenericListView>();
}
void OnTapGestureTrivial (object sender, EventArgs args)
void OnTapGestureTrivial(object sender, EventArgs args)
{
RootPage?.Navigate<TrivialListView> ();
RootPage?.Navigate<TrivialListView>();
}
void OnTapGestureArticle (object sender, EventArgs args)
{
RootPage?.Navigate<ArticleListView> ();
}
void OnTapGestureArticle(object sender, EventArgs args)
{
RootPage?.Navigate<ArticleListView>();
}
void OnTapGestureShoppingList(object sender, EventArgs args)
{
RootPage?.Navigate<ShoppingListView> ();
RootPage?.Navigate<ShoppingListView>();
}
void OnTapGestureRecipe(object sender, EventArgs args)
{
RootPage?.Navigate<RecipeListView> ();
RootPage?.Navigate<RecipeListView>();
}
}
}
}
......@@ -7,246 +7,187 @@
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
Title="Acceso a la Aplicación ..."
NavigationPage.HasNavigationBar="False"
BackgroundColor="{DynamicResource BasePageColor}">
<ContentPage.Content>
<AbsoluteLayout>
<!-- GRADIENT-->
<Image
AbsoluteLayout.LayoutBounds="0,0,1,44"
AbsoluteLayout.LayoutFlags="WidthProportional"
Style="{ StaticResource StatusBarShimStyle }"
VerticalOptions="Start"/>
<ScrollView
AbsoluteLayout.LayoutBounds="0,0,1,1"
AbsoluteLayout.LayoutFlags="All"
VerticalOptions="FillAndExpand"
Padding="{ DynamicResource MainWrapperPadding }">
<!-- MAIN CONTAINER -->
<Grid
ColumnSpacing="0"
RowSpacing="0"
Padding="20,30,20,10"
HorizontalOptions="Fill"
VerticalOptions="FillAndExpand" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- HEADER -->
<StackLayout
Grid.Row="0"
Spacing="5"
Padding="0,20,0,0"
InputTransparent="true">
<!-- LOGO -->
<Grid
Grid.Row="1"
WidthRequest="150"
VerticalOptions="Center"
HorizontalOptions="Center">
<Image Source="logo_empresa.png" WidthRequest="150"></Image>
</Grid>
<!-- WELCOME TEXT -->
<Label
Text="{ StaticResource LoginWelcomeText }"
FontSize="{ artina:OnOrientationDouble
PortraitPhone=22,
LandscapePhone=22,
PortraitTablet=28,
LandscapeTablet=28 }"
HorizontalTextAlignment="Center"
TextColor="{ DynamicResource BaseTextColor }"/>
<Label
Text="Por favor, ingrese usuario y password"
HorizontalTextAlignment="Center"
FontSize="{ artina:OnOrientationDouble
PortraitPhone=15,
LandscapePhone=15,
PortraitTablet=18,
LandscapeTablet=18 }"/>
<!--SEPARATOR-->
<BoxView
WidthRequest="80"
HeightRequest="1"
HorizontalOptions="Center"
VerticalOptions="End"
BackgroundColor="{DynamicResource BaseTextColor}"/>
</StackLayout>
<!---FIELDS CONTAINER-->
<Grid
Grid.Row="1"
RowSpacing="30"
Padding="0,20,0,20"
VerticalOptions="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- ICON BACKGROUND -->
<Label
Grid.Column="0"
Grid.Row="0"
FontSize="40"
Style="{StaticResource RoundShape}"
HorizontalTextAlignment="Center"
TextColor="{DynamicResource ComplementColor}"
VerticalOptions="Center"
HorizontalOptions="Center"
/>
<!-- ICON -->
<Label
Grid.Column="0"
Grid.Row="0"
FontSize="14"
Text="{ x:Static local:GrialShapesFont.Email }"
Style="{StaticResource FontIconBase}"
HorizontalTextAlignment="Center"
TextColor="White"
VerticalOptions="Center"
HorizontalOptions="Center"
/>
<!--EMAIL FIELD-->
<Entry
Grid.Column="1"
Grid.Row="0"
HeightRequest="40"
x:Name = "userEntry"
Placeholder="Usuario"
BackgroundColor="{ DynamicResource PlaceholderColorEntry }"
PlaceholderColor="{ DynamicResource BaseTextColor }"/>
<!-- ICON BACKGROUND -->
<Label
Grid.Column="0"
Grid.Row="1"
FontSize="40"
Style="{StaticResource RoundShape}"
HorizontalTextAlignment="Center"
TextColor="{DynamicResource ComplementColor}"
VerticalOptions="Center"
HorizontalOptions="Center"
/>
<!-- ICON -->
<Label
Grid.Column="0"
Grid.Row="1"
FontSize="14"
Text="{ x:Static local:GrialShapesFont.Lock }"
Style="{StaticResource FontIconBase}"
HorizontalTextAlignment="Center"
TextColor="White"
VerticalOptions="Center"
HorizontalOptions="Center"
/>
<!-- PASSWORD ENTRY -->
<Entry
Grid.Column="1"
Grid.Row="1"
HeightRequest="40"
x:Name = "passwordEntry"
Placeholder="Contraseña"
IsPassword="True"
BackgroundColor="{ DynamicResource PlaceholderColorEntry }"
PlaceholderColor="{ DynamicResource BaseTextColor }"/>
</Grid>
<!-- BUTTONS -->
<StackLayout
Grid.Row="2"
Spacing="10"
Padding="0,10,0,0"
HorizontalOptions="FillAndExpand"
VerticalOptions="End" >
<ContentPage.Content>
<AbsoluteLayout>
<!-- GRADIENT-->
<Image AbsoluteLayout.LayoutBounds="0,0,1,44"
AbsoluteLayout.LayoutFlags="WidthProportional"
Style="{ StaticResource StatusBarShimStyle }"
VerticalOptions="Start"/>
<ScrollView AbsoluteLayout.LayoutBounds="0,0,1,1"
AbsoluteLayout.LayoutFlags="All"
VerticalOptions="FillAndExpand"
Padding="{ DynamicResource MainWrapperPadding }">
<!-- MAIN CONTAINER -->
<Grid ColumnSpacing="0"
RowSpacing="0"
Padding="20,30,20,10"
HorizontalOptions="Fill"
VerticalOptions="FillAndExpand" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- HEADER -->
<StackLayout Grid.Row="0"
Spacing="5"
Padding="0,20,0,0"
InputTransparent="true">
<!-- LOGO -->
<Grid Grid.Row="1"
WidthRequest="150"
VerticalOptions="Center"
HorizontalOptions="Center">
<Image Source="logo_empresa.png"
WidthRequest="150" />
</Grid>
<!-- WELCOME TEXT -->
<Label Text="{ StaticResource LoginWelcomeText }"
FontSize="{ artina:OnOrientationDouble
PortraitPhone=22,
LandscapePhone=22,
PortraitTablet=28,
LandscapeTablet=28 }"
HorizontalTextAlignment="Center"
TextColor="{ DynamicResource BaseTextColor }"/>
<Label Text="Por favor, ingrese usuario y password"
HorizontalTextAlignment="Center"
FontSize="{ artina:OnOrientationDouble
PortraitPhone=15,
LandscapePhone=15,
PortraitTablet=18,
LandscapeTablet=18 }"/>
<!--SEPARATOR-->
<BoxView WidthRequest="80"
HeightRequest="1"
HorizontalOptions="Center"
VerticalOptions="End"
BackgroundColor="{DynamicResource BaseTextColor}"/>
</StackLayout>
<!---FIELDS CONTAINER-->
<Grid Grid.Row="1"
RowSpacing="30"
Padding="0,20,0,20"
VerticalOptions="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- ICON BACKGROUND -->
<Label Grid.Column="0"
Grid.Row="0"
FontSize="40"
Style="{StaticResource RoundShape}"
HorizontalTextAlignment="Center"
TextColor="{DynamicResource ComplementColor}"
VerticalOptions="Center"
HorizontalOptions="Center"/>
<!-- ICON -->
<Label Grid.Column="0"
Grid.Row="0"
FontSize="14"
Text="{ x:Static local:GrialShapesFont.Email }"
Style="{StaticResource FontIconBase}"
HorizontalTextAlignment="Center"
TextColor="White"
VerticalOptions="Center"
HorizontalOptions="Center"/>
<!--EMAIL FIELD-->
<Entry Grid.Column="1"
Grid.Row="0"
HeightRequest="40"
x:Name = "userEntry"
Placeholder="Usuario"
BackgroundColor="{ DynamicResource PlaceholderColorEntry }"
PlaceholderColor="{ DynamicResource BaseTextColor }"/>
<!-- ICON BACKGROUND -->
<Label Grid.Column="0"
Grid.Row="1"
FontSize="40"
Style="{StaticResource RoundShape}"
HorizontalTextAlignment="Center"
TextColor="{DynamicResource ComplementColor}"
VerticalOptions="Center"
HorizontalOptions="Center"/>
<!-- ICON -->
<Label Grid.Column="0"
Grid.Row="1"
FontSize="14"
Text="{ x:Static local:GrialShapesFont.Lock }"
Style="{StaticResource FontIconBase}"
HorizontalTextAlignment="Center"
TextColor="White"
VerticalOptions="Center"
HorizontalOptions="Center" />
<!-- PASSWORD ENTRY -->
<Entry Grid.Column="1"
Grid.Row="1"
HeightRequest="40"
x:Name = "passwordEntry"
Placeholder="Contraseña"
IsPassword="True"
BackgroundColor="{ DynamicResource PlaceholderColorEntry }"
PlaceholderColor="{ DynamicResource BaseTextColor }"/>
</Grid>
<!-- BUTTONS -->
<StackLayout Grid.Row="2"
Spacing="10"
Padding="0,10,0,0"
HorizontalOptions="FillAndExpand"
VerticalOptions="End" >
<!-- LOGIN -->
<artina:Button x:Name="loginButton"
Clicked="OnLoginButtonClicked"
Style="{DynamicResource PrimaryActionButtonStyle}"
VerticalOptions="End"
Text="Login"
WidthRequest="{ artina:OnOrientationDouble
LandscapePhone=200,
LandscapeTablet=400 }"
HorizontalOptions="{ artina:OnOrientationLayoutOptions
PortraitPhone=Fill,
LandscapePhone=Center,
PortraitTablet=Fill,
LandscapeTablet=Center }"/>
<!--<Label
Text="Si todavía no se ha registrado ..."
FontSize="13"
HorizontalTextAlignment="Center"/>
--><!-- FACEBOOK --><!--
<artina:Button
Style="{ DynamicResource PrimaryActionButtonStyle }"
BackgroundColor="#3b5998"
VerticalOptions="End"
x:Name="registerButton"
Text = "Registrar"
Clicked="OnRegisterButtonClicked"
WidthRequest="{ artina:OnOrientationDouble
LandscapePhone=200,
LandscapeTablet=400 }"
HorizontalOptions="{ artina:OnOrientationLayoutOptions
PortraitPhone=Fill,
LandscapePhone=Center,
PortraitTablet=Fill,
LandscapeTablet=Center }"/>-->
Clicked="OnLoginButtonClicked"
Style="{DynamicResource PrimaryActionButtonStyle}"
VerticalOptions="End"
Text="Login"
WidthRequest="{ artina:OnOrientationDouble
LandscapePhone=200,
LandscapeTablet=400 }"
HorizontalOptions="{ artina:OnOrientationLayoutOptions
PortraitPhone=Fill,
LandscapePhone=Center,
PortraitTablet=Fill,
LandscapeTablet=Center }"/>
<!--SEPARATOR-->
<BoxView
Grid.Row="4"
HeightRequest="1"
VerticalOptions="Start"
HorizontalOptions="Center"
WidthRequest="300"
BackgroundColor="{DynamicResource BaseTextColor}"/>
<!--
<Label
Grid.Row="4"
HorizontalOptions="Center"
VerticalOptions="Center"
FontSize="14"
x:Name="rememberButton"
Text = "Recordar Contraseña"
Clicked="OnRememberButtonClicked"/>
-->
<BoxView Grid.Row="4"
HeightRequest="1"
VerticalOptions="Start"
HorizontalOptions="Center"
WidthRequest="300"
BackgroundColor="{DynamicResource BaseTextColor}"/>
</StackLayout>
</Grid>
</ScrollView>
</AbsoluteLayout>
</ContentPage.Content>
</ScrollView>
</AbsoluteLayout>
</ContentPage.Content>
</ContentPage>
using System;
using System.Collections.Generic;
using inutralia.Models;
using Xamarin.Forms;
namespace inutralia.Views
{
public partial class LoginView : ContentPage
{
private bool processing
{
set
{
loginButton.IsEnabled = !value;
}
}
public partial class LoginView : ContentPage
{
private bool processing
{
set { loginButton.IsEnabled = !value; }
}
public LoginView()
{
InitializeComponent();
public LoginView()
{
InitializeComponent();
if (Application.Current.Properties.ContainsKey("Username")) userEntry.Text = Application.Current.Properties["Username"].ToString();
if (Application.Current.Properties.ContainsKey("Password")) passwordEntry.Text = Application.Current.Properties["Password"].ToString();
}
async void OnLoginButtonClicked(object sender, EventArgs e)
{
processing = true;
{
processing = true;
Application.Current.Properties["Username"] = userEntry.Text;
Application.Current.Properties["Password"] = passwordEntry.Text;
var Username = userEntry.Text;
var Password = passwordEntry.Text;
//passwordEntry.Text = string.Empty;
var Password = passwordEntry.Text;
App.API.CredentialsSet(Username, Password);
App.API.CredentialsSet(Username, Password);
try
{
var users = await App.API.RefreshListAsync<User>();
try
{
var users = await App.API.RefreshListAsync<User>();
if (users.Count > 0)
{
App.IsUserLoggedIn = true;
if (users.Count > 0)
{
App.IsUserLoggedIn = true;
Page nextView = new RootPage() as Page;
Page nextView = new RootPage() as Page;
// Cambiar de vista
Application.Current.MainPage = nextView;
}
// Cambiar de vista
Application.Current.MainPage = nextView;
}
else
{
throw new Exception();
}
}
catch (Exception err)
{
await DisplayAlert("Error", "El usuario o la contraseña no son correctos", "Entendido");
}
else
{
throw new Exception();
}
}
processing = false;
}
catch (Exception err)
{
await DisplayAlert("Error", "El usuario o la contraseña no son correctos", "Entendido");
}
processing = false;
}
protected override void OnDisappearing()
{
base.OnDisappearing();
}
//async void OnRegisterButtonClicked(object sender, EventArgs e)
//{
// Page nextView = new RegisterView() as Page;
// // Cambiar de vista
// await Navigation.PushModalAsync (nextView);
//}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.Views.MenuView"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
Icon="hamburguer_icon.png"
Padding="0,40,0,0"
Title="Inutralia">
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.Views.MenuView"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
Icon="hamburguer_icon.png"
Padding="0,40,0,0"
Title="Inutralia">
<ContentPage.Content>
<StackLayout VerticalOptions="FillAndExpand" BackgroundColor="{DynamicResource CorporativeColor}">
<Image Source="logo_empresa.png" WidthRequest="100" HorizontalOptions="Center"/>
<StackLayout>
<Label />
<BoxView HeightRequest="1" BackgroundColor="Black" HorizontalOptions="FillAndExpand" />
</StackLayout>
<StackLayout VerticalOptions="FillAndExpand" BackgroundColor="{DynamicResource CorporativeColor}">
<StackLayout x:Name="btnHome" Orientation="Horizontal" Padding="10,0,0,0" Spacing="25" >
<Label Text="{ x:Static local:IoniciconsFont.IosHomeOutline }" FontSize="40" Style="{StaticResource FontIcon}" HorizontalOptions="Center" VerticalOptions="Center" TextColor="{ DynamicResource ListViewItemTextColor }"/>
<Label FontSize="Medium" Text="Inicio" TextColor="{ DynamicResource ListViewItemTextColor }" VerticalTextAlignment="Center" />
</StackLayout>
<StackLayout>
<BoxView HeightRequest="1" BackgroundColor="{ DynamicResource ListViewItemTextColor }" HorizontalOptions="FillAndExpand" />
</StackLayout>
<StackLayout x:Name="btnMyProfile" Orientation="Horizontal" Padding="10,0,0,0" Spacing="25" >
<StackLayout x:Name="btnMyProfile" Orientation="Horizontal" Padding="10,0,0,0" Spacing="25" >
<Label Text="{ x:Static local:IoniciconsFont.IosContactOutline }" FontSize="40" Style="{StaticResource FontIcon}" HorizontalOptions="Center" VerticalOptions="Center" TextColor="{ DynamicResource ListViewItemTextColor }" />
<Label FontSize="Medium" Text="Mi Perfil" TextColor="{ DynamicResource ListViewItemTextColor }" VerticalTextAlignment="Center" />
</StackLayout>
<StackLayout x:Name="btnMyMenu" Orientation="Horizontal" Padding="10,0,0,0" Spacing="25" >
<StackLayout x:Name="btnMyMenu" Orientation="Horizontal" Padding="10,0,0,0" Spacing="25" >
<Label Text="{ x:Static local:IoniciconsFont.Clipboard }" FontSize="40" Style="{StaticResource FontIcon}" HorizontalOptions="Center" VerticalOptions="Center" TextColor="{ DynamicResource ListViewItemTextColor }" />
<Label FontSize="Medium" Text="Mi Menú" TextColor="{ DynamicResource ListViewItemTextColor }" VerticalTextAlignment="Center" />
</StackLayout>
<StackLayout x:Name="btnShoppingList" Orientation="Horizontal" Padding="10,0,0,0" Spacing="25" >
<StackLayout x:Name="btnShoppingList" Orientation="Horizontal" Padding="10,0,0,0" Spacing="25" >
<Label Text="{ x:Static local:IoniciconsFont.IosCartOutline }" FontSize="40" Style="{StaticResource FontIcon}" HorizontalOptions="Center" VerticalOptions="Center" TextColor="{ DynamicResource ListViewItemTextColor }" />
<Label FontSize="Medium" Text="Lista de la Compra" TextColor="{ DynamicResource ListViewItemTextColor }" VerticalTextAlignment="Center" />
</StackLayout>
<StackLayout>
<BoxView HeightRequest="1" BackgroundColor="{ DynamicResource ListViewItemTextColor }" HorizontalOptions="FillAndExpand" />
</StackLayout>
<StackLayout x:Name="btnGenericMenus" Orientation="Horizontal" Padding="10,0,0,0" Spacing="25" >
<StackLayout x:Name="btnGenericMenus" Orientation="Horizontal" Padding="10,0,0,0" Spacing="25" >
<Label Text="{ x:Static local:IoniciconsFont.IosPaperOutline }" FontSize="40" Style="{StaticResource FontIcon}" HorizontalOptions="Center" VerticalOptions="Center" TextColor="{ DynamicResource ListViewItemTextColor }" />
<Label FontSize="Medium" Text="Menús Saludables" TextColor="{ DynamicResource ListViewItemTextColor }" VerticalTextAlignment="Center" />
</StackLayout>
<StackLayout>
<BoxView HeightRequest="1" BackgroundColor="{ DynamicResource ListViewItemTextColor }" HorizontalOptions="FillAndExpand" />
</StackLayout>
<StackLayout x:Name="btnRecipeBook" Orientation="Horizontal" Padding="10,0,0,0" Spacing="25" >
<StackLayout x:Name="btnRecipeBook" Orientation="Horizontal" Padding="10,0,0,0" Spacing="25" >
<Label Text="{ x:Static local:IoniciconsFont.IosBookmarksOutline }" FontSize="40" Style="{StaticResource FontIcon}" HorizontalOptions="Center" VerticalOptions="Center" TextColor="{ DynamicResource ListViewItemTextColor }" />
<Label FontSize="Medium" Text="Recetario" TextColor="{ DynamicResource ListViewItemTextColor }" VerticalTextAlignment="Center" />
</StackLayout>
<StackLayout>
<BoxView HeightRequest="1" BackgroundColor="{ DynamicResource ListViewItemTextColor }" HorizontalOptions="FillAndExpand" />
</StackLayout>
<StackLayout x:Name="btnLoginOut" Orientation="Horizontal" Padding="10,0,0,0" Spacing="25" >
<StackLayout x:Name="btnLoginOut" Orientation="Horizontal" Padding="10,0,0,0" Spacing="25" >
<Label Text="{ x:Static local:IoniciconsFont.LogOut }" FontSize="40" Style="{StaticResource FontIcon}" HorizontalOptions="Center" VerticalOptions="Center" TextColor="{ DynamicResource ListViewItemTextColor }" />
<Label FontSize="Medium" Text="Salir" TextColor="{ DynamicResource ListViewItemTextColor }" VerticalTextAlignment="Center" />
</StackLayout>
<!--<ButtonText="Inicio" Clicked="onBtnHomeClicked"/>-->
</StackLayout>
</StackLayout>
</ContentPage.Content>
......
using inutralia.Views;
using System;
using System.Collections.Generic;
using Xamarin.Forms;
using Xamarin.Forms;
namespace inutralia.Views
{
public partial class MenuView : ContentPage
{
public MenuView()
{
InitializeComponent();
public partial class MenuView : ContentPage
{
public MenuView()
{
InitializeComponent();
btnHome.GestureRecognizers.Add(new TapGestureRecognizer
{
Command = new Command(() => onBtnHomeClicked())
Command = new Command(() => OnBtnHomeClicked())
});
btnLoginOut .GestureRecognizers.Add(new TapGestureRecognizer
btnLoginOut.GestureRecognizers.Add(new TapGestureRecognizer
{
Command = new Command(() => onLoginOutClicked())
});;
btnMyMenu .GestureRecognizers.Add(new TapGestureRecognizer
Command = new Command(() => OnLoginOutClicked())
}); ;
btnMyMenu.GestureRecognizers.Add(new TapGestureRecognizer
{
Command = new Command(() => onBtnMyMenuClicked())
});;
btnMyProfile .GestureRecognizers.Add(new TapGestureRecognizer
Command = new Command(() => OnBtnMyMenuClicked())
}); ;
btnMyProfile.GestureRecognizers.Add(new TapGestureRecognizer
{
Command = new Command(() => onBtnMyProfileClicked())
});;
btnRecipeBook .GestureRecognizers.Add(new TapGestureRecognizer
Command = new Command(() => OnBtnMyProfileClicked())
}); ;
btnRecipeBook.GestureRecognizers.Add(new TapGestureRecognizer
{
Command = new Command(() => onBtnRecipeBookClicked())
});;
Command = new Command(() => OnBtnRecipeBookClicked())
}); ;
btnShoppingList.GestureRecognizers.Add(new TapGestureRecognizer
{
Command = new Command(() => onBtnShoppingListClicked())
Command = new Command(() => OnBtnShoppingListClicked())
}); ;
btnGenericMenus.GestureRecognizers.Add(new TapGestureRecognizer
{
Command = new Command(() => onBtnGenericMenusClicked())
Command = new Command(() => OnBtnGenericMenusClicked())
}); ;
}
void onBtnHomeClicked()
void OnBtnHomeClicked()
{
//await (App.Current.MainPage as MasterDetailPage).Detail.Navigation.PopToRootAsync();
(App.Current.MainPage as RootPage).Navigate<HomeView>();
}
void onBtnMyMenuClicked()
void OnBtnMyMenuClicked()
{
(App.Current.MainPage as RootPage).Navigate<CustomMenuView>();
}
void onBtnMyProfileClicked()
void OnBtnMyProfileClicked()
{
(App.Current.MainPage as RootPage).Navigate<ProfileView>();
}
void onBtnRecipeBookClicked()
void OnBtnRecipeBookClicked()
{
(App.Current.MainPage as RootPage).Navigate<RecipeListView>();
}
void onBtnGenericMenusClicked()
void OnBtnGenericMenusClicked()
{
(App.Current.MainPage as RootPage).Navigate<GenericListView>();
}
void onBtnShoppingListClicked()
void OnBtnShoppingListClicked()
{
(App.Current.MainPage as RootPage).Navigate<ShoppingListView>();
}
void onLoginOutClicked()
void OnLoginOutClicked()
{
App.IsUserLoggedIn = false;
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:inutralia.Views;assembly=inutralia"
xmlns:views="clr-namespace:inutralia.Views;assembly=inutralia"
x:Class="inutralia.Views.RootPage">
<MasterDetailPage.Master>
<local:MenuView x:Name="MenuView" />
</MasterDetailPage.Master>
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:inutralia.Views;assembly=inutralia"
xmlns:views="clr-namespace:inutralia.Views;assembly=inutralia"
x:Class="inutralia.Views.RootPage">
<MasterDetailPage.Detail>
<MasterDetailPage.Master>
<local:MenuView x:Name="MenuView" />
</MasterDetailPage.Master>
<MasterDetailPage.Detail>
<NavigationPage>
<x:Arguments>
<views:HomeView />
</x:Arguments>
</NavigationPage>
</MasterDetailPage.Detail>
</MasterDetailPage>
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace inutralia.Views
{
public partial class RootPage : MasterDetailPage
{
public RootPage()
{
InitializeComponent();
}
public partial class RootPage : MasterDetailPage
{
public RootPage()
{
InitializeComponent();
}
public void Navigate<T>() where T:ContentPage
{
public void Navigate<T>() where T : ContentPage
{
NavigationPage p = Detail as NavigationPage;
if(p?.Navigation?.NavigationStack?[0]?.GetType() != typeof(T) )
Detail = new NavigationPage(Activator.CreateInstance(typeof(T)) as Page);
if (p?.Navigation?.NavigationStack?[0]?.GetType() != typeof(T))
Detail = new NavigationPage(Activator.CreateInstance(typeof(T)) as Page);
IsPresented = false;
}
}
IsPresented = false;
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.WelcomeStarterPage"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
Title="Welcome Starter"
BackgroundColor="{DynamicResource BasePageColor}">
<ContentPage.Content>
<!-- MAIN WRAPPER -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.WelcomeStarterPage"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
Title="Welcome Starter"
BackgroundColor="{DynamicResource BasePageColor}">
<Grid
Grid.Row="0"
VerticalOptions="Center"
HorizontalOptions="Center">
<Grid.RowDefinitions>
<RowDefinition Height="60*"/>
<RowDefinition Height="40*"/>
</Grid.RowDefinitions>
<ContentPage.Content>
<!-- MAIN WRAPPER -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0"
VerticalOptions="Center"
HorizontalOptions="Center">
<!--ICON BACKGROUND-->
<Label
Grid.Row="0"
Style="{StaticResource RoundShape}"
TextColor="{DynamicResource ComplementColor}"
VerticalOptions="Center"
HorizontalOptions="Center"
FontSize="250"
Opacity="0.1"/>
<Grid.RowDefinitions>
<RowDefinition Height="60*"/>
<RowDefinition Height="40*"/>
</Grid.RowDefinitions>
<!--ICON BACKGROUND-->
<Label
Grid.Row="0"
Style="{StaticResource RoundShape}"
TextColor="{DynamicResource ComplementColor}"
VerticalOptions="Center"
HorizontalOptions="Center"
FontSize="180"
Opacity="0.1"/>
<!--ICON BACKGROUND-->
<Label Grid.Row="0"
Style="{StaticResource RoundShape}"
TextColor="{DynamicResource ComplementColor}"
VerticalOptions="Center"
HorizontalOptions="Center"
FontSize="250"
Opacity="0.1"/>
<!--ICON-->
<Label
Grid.Row="0"
Text="{ x:Static local:GrialShapesFont.Whatshot }"
Style="{StaticResource FontIconBase}"
FontSize="100"
HorizontalTextAlignment="Center"
TextColor="{ DynamicResource ComplementColor }"
VerticalOptions="Center"
HorizontalOptions="Center"/>
<!--ICON BACKGROUND-->
<Label Grid.Row="0"
Style="{StaticResource RoundShape}"
TextColor="{DynamicResource ComplementColor}"
VerticalOptions="Center"
HorizontalOptions="Center"
FontSize="180"
Opacity="0.1"/>
<!--TEXT -->
<StackLayout
Grid.Row="1"
VerticalOptions="Center"
Padding="60,0"
Spacing="2">
<Label
HorizontalTextAlignment="Center"
Text="Welcome to Grial.Starter"
FontSize="24"
FontAttributes="Bold"
TextColor="{ DynamicResource BaseTextColor }"/>
<Label
HorizontalTextAlignment="Center"
Opacity="0.8"
Text="Welcome to Grial 2.0 Starter. You are all setup and ready to rock!"
FontSize="16"
TextColor="{ DynamicResource BaseTextColor }"/>
</StackLayout>
<!--ICON-->
<Label Grid.Row="0"
Text="{ x:Static local:GrialShapesFont.Whatshot }"
Style="{StaticResource FontIconBase}"
FontSize="100"
HorizontalTextAlignment="Center"
TextColor="{ DynamicResource ComplementColor }"
VerticalOptions="Center"
HorizontalOptions="Center"/>
</Grid>
<!--TEXT -->
<StackLayout Grid.Row="1"
VerticalOptions="Center"
Padding="60,0"
Spacing="2">
</Grid>
</ContentPage.Content>
<Label HorizontalTextAlignment="Center"
Text="Welcome to Grial.Starter"
FontSize="24"
FontAttributes="Bold"
TextColor="{ DynamicResource BaseTextColor }"/>
<Label HorizontalTextAlignment="Center"
Opacity="0.8"
Text="Welcome to Grial 2.0 Starter. You are all setup and ready to rock!"
FontSize="16"
TextColor="{ DynamicResource BaseTextColor }"/>
</StackLayout>
</Grid>
</Grid>
</ContentPage.Content>
</ContentPage>
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace inutralia
{
public partial class WelcomeStarterPage : ContentPage
{
public WelcomeStarterPage()
{
InitializeComponent();
}
}
public partial class WelcomeStarterPage : ContentPage
{
public WelcomeStarterPage()
{
InitializeComponent();
}
}
}
<?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:app="clr-namespace:inutralia;assembly=inutralia"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
x:Class="inutralia.Views.ProfileView"
x:Name="profileView"
Title="Mi Perfil"
......@@ -117,6 +115,7 @@
</OnIdiom>
</Label.FontSize>
</Label>
<Entry VerticalOptions="CenterAndExpand" HorizontalOptions="FillAndExpand" x:Name = "weightEntry" Text="{Binding Profile.Weight}" Placeholder="Kg.">
<Entry.FontSize>
<OnIdiom x:TypeArguments="x:Double">
......@@ -170,6 +169,7 @@
</OnIdiom>
</Label.FontSize>
</Label>
<Entry VerticalOptions="CenterAndExpand" HorizontalOptions="FillAndExpand" x:Name = "heightEntry" Text="{Binding Profile.Height}" Placeholder="cm.">
<Entry.FontSize>
<OnIdiom x:TypeArguments="x:Double">
......@@ -223,11 +223,13 @@
</OnIdiom>
</Label.FontSize>
</Label>
<Picker x:Name="genderPicker" HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand" SelectedIndex="{Binding Gender}" >
<Picker.Items>
<x:String>Hombre</x:String>
<x:String>Mujer</x:String>
</Picker.Items>
<Picker.SelectedIndex>0</Picker.SelectedIndex>
</Picker>
</StackLayout>
......@@ -266,6 +268,7 @@
</OnIdiom>
</Label.FontSize>
</Label>
<Picker x:Name="fisExerPicker" HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand" SelectedIndex="{Binding Physical}" >
<Picker.Items>
<x:String>Sedentario</x:String>
......@@ -274,6 +277,7 @@
<x:String>Intenso</x:String>
<x:String>Muy Intenso</x:String>
</Picker.Items>
<Picker.SelectedIndex>0</Picker.SelectedIndex>
</Picker>
</StackLayout>
......@@ -312,12 +316,14 @@
</OnIdiom>
</Label.FontSize>
</Label>
<Picker x:Name="preferencePicker" HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand" SelectedIndex="{Binding Preference}">
<Picker.Items>
<x:String>Normal</x:String>
<x:String>Vegetariano</x:String>
<x:String>Vegano</x:String>
</Picker.Items>
<Picker.SelectedIndex>0</Picker.SelectedIndex>
</Picker>
</StackLayout>
......@@ -378,6 +384,7 @@
<StackLayout Grid.Row="1" Orientation="Horizontal" Padding="0,20,0,0">
<Switch IsToggled="{Binding Profile.Cv}" />
<Label Text=" ... una enfermedad cardiovascular ?">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
......@@ -399,6 +406,7 @@
<StackLayout Grid.Row="2" Orientation="Horizontal" >
<Switch IsToggled="{Binding Profile.Hypertension}"/>
<Label Text=" ... hipertensión ?">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
......@@ -420,6 +428,7 @@
<StackLayout Grid.Row="3" Orientation="Horizontal" >
<Switch IsToggled="{Binding Profile.Menopause}" />
<Label Text=" ... menopausia ?">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
......@@ -441,6 +450,7 @@
<StackLayout Grid.Row="4" Orientation="Horizontal">
<Switch IsToggled="{Binding Profile.Pregnancy}"/>
<Label Text=" ... embarazo ?">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
......@@ -462,6 +472,7 @@
<StackLayout Grid.Row="5" Orientation="Horizontal" >
<Switch IsToggled="{Binding Profile.Lactation}"/>
<Label Text=" ... lactancia ?">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
......@@ -483,6 +494,7 @@
<StackLayout Grid.Row="6" Orientation="Horizontal" >
<Switch IsToggled="{Binding Profile.Celiac}"/>
<Label Text=" ... celiaco ?">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
......@@ -504,6 +516,7 @@
<StackLayout Grid.Row="7" Orientation="Horizontal" >
<Switch IsToggled="{Binding Profile.Lactose}"/>
<Label Text=" ... intoleracia a la lactosa ?">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
......@@ -525,6 +538,7 @@
<StackLayout Grid.Row="8" Orientation="Horizontal" >
<Switch IsToggled="{Binding Profile.Diabetes}"/>
<Label Text=" ... diabetes ?" >
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
......@@ -546,6 +560,7 @@
<StackLayout Grid.Row="9" Orientation="Horizontal" >
<Switch IsToggled="{Binding Profile.Cholesterol}"/>
<Label Text=" ... colesterol ?">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
......@@ -567,6 +582,7 @@
<StackLayout Grid.Row="10" Orientation="Horizontal">
<Switch IsToggled="{Binding Profile.Triglycerides}"/>
<Label Text=" ... trigliceridos ?">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
......@@ -588,6 +604,7 @@
<StackLayout Grid.Row="11" Orientation="Horizontal">
<Switch IsToggled="{Binding Profile.Al_fish}"/>
<Label Text=" ... alergia al pescado/marisco ?">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
......@@ -609,6 +626,7 @@
<StackLayout Grid.Row="12" Orientation="Horizontal">
<Switch IsToggled="{Binding Profile.Al_egg}"/>
<Label Text=" ... alergia al huevo ?">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
......@@ -630,6 +648,7 @@
<StackLayout Grid.Row="13" Orientation="Horizontal">
<Switch IsToggled="{Binding Profile.Al_nuts}"/>
<Label Text=" ... alergia a los frutos secos ?">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
......@@ -652,19 +671,19 @@
</StackLayout>
<artina:Button x:Name="saveButton"
Clicked="OnSaveButtonClicked"
Style="{DynamicResource PrimaryActionButtonStyle}"
VerticalOptions="Center"
FontSize="{artina:OnOrientationDouble
Clicked="OnSaveButtonClicked"
Style="{DynamicResource PrimaryActionButtonStyle}"
VerticalOptions="Center"
FontSize="{artina:OnOrientationDouble
PortraitPhone=18,
LandscapePhone=18,
PortraitTablet=30,
LandscapeTablet=30 }"
Text="GUARDAR PERFIL"
HeightRequest="{artina:OnOrientationDouble
Text="GUARDAR PERFIL"
HeightRequest="{artina:OnOrientationDouble
LandscapePhone=20,
LandscapeTablet=40 }"
HorizontalOptions="FillAndExpand"/>
HorizontalOptions="FillAndExpand"/>
</StackLayout>
</ScrollView>
</ContentPage>
\ No newline at end of file
using System;
using System.Collections.Generic;
using inutralia.ViewModels;
using Xamarin.Forms;
namespace inutralia.Views
{
public partial class ProfileView : ContentPage
{
protected ProfileViewModel ViewModel => BindingContext as ProfileViewModel;
public ProfileView()
{
InitializeComponent();
BindingContext = new ProfileViewModel();
}
public partial class ProfileView : ContentPage
{
protected ProfileViewModel ViewModel => BindingContext as ProfileViewModel;
public ProfileView()
{
InitializeComponent();
BindingContext = new ProfileViewModel();
}
protected override async void OnAppearing()
{
protected override async void OnAppearing()
{
try
{
await ViewModel.RefreshData();
base.OnAppearing();
}
catch(Exception e)
catch (Exception e) { }
}
async void OnSaveButtonClicked(object sender, EventArgs e)
{
try
{
await ViewModel.saveData();
await DisplayAlert("Exito", "La grabación se ha realizado correctamente.", "Entendido");
(App.Current.MainPage as RootPage).Navigate<HomeView>();
}
}
async void OnSaveButtonClicked(object sender, EventArgs e)
{
try
{
await ViewModel.saveData();
await DisplayAlert("Exito", "La grabación se ha realizado correctamente.", "Entendido");
(App.Current.MainPage as RootPage).Navigate<HomeView>();
}
catch (Exception err)
{
await DisplayAlert("Error", "Se ha producido un error. Por favbor, intentelo más tarde", "Entendido");
}
}
}
catch (Exception err)
{
await DisplayAlert("Error", "Se ha producido un error. Por favbor, intentelo más tarde", "Entendido");
}
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.Views.RecipeDetailView"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
xmlns:fftransformations="clr-namespace:FFImageLoading.Transformations;assembly=FFImageLoading.Transformations"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
BackgroundColor="{ DynamicResource MainWrapperBackgroundColor }"
Title="{Binding Title}">
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.Views.RecipeDetailView"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
BackgroundColor="{ DynamicResource MainWrapperBackgroundColor }"
Title="{Binding Title}">
<StackLayout>
<ScrollView
x:Name="outerScrollView">
<ScrollView x:Name="outerScrollView">
<Grid x:Name="layeringGrid" RowSpacing="0" VerticalOptions="FillAndExpand" >
......@@ -30,19 +26,20 @@
BackgroundColor="Black">
<!-- MAIN IMAGE -->
<ffimageloading:CachedImage
x:Name="img"
Source="{ Binding Recipe.Image }"
Aspect="AspectFill"
BackgroundColor="Black"
HeightRequest="270"
WidthRequest="200"
HorizontalOptions="FillAndExpand"
VerticalOptions="Start"
Opacity=".8"/>
<ffimageloading:CachedImage x:Name="img"
Source="{ Binding Recipe.Image }"
Aspect="AspectFill"
BackgroundColor="Black"
HeightRequest="270"
WidthRequest="200"
HorizontalOptions="FillAndExpand"
VerticalOptions="Start"
Opacity=".8"/>
</Grid>
<!--GRID CUERPO DEPUES DE LA IMAGEN -->
<Grid Grid.Row="1" BackgroundColor="{ DynamicResource BasePageColor }">
<Grid.RowDefinitions>
......@@ -52,29 +49,35 @@
</Grid.RowDefinitions>
<!--HEADER BACKGROUND-->
<BoxView Grid.Row="0" BackgroundColor="{ DynamicResource ArticleHeaderBackgroundColor }" />
<StackLayout Orientation="Horizontal" Grid.Row="0" Padding="20">
<!--HEADER INFO-->
<StackLayout Orientation="Horizontal" Grid.Row="0" HorizontalOptions="StartAndExpand">
<Label Text="{ x:Static local:IoniciconsFont.IosTimeOutline }" FontSize="Large" TextColor="{ DynamicResource BaseTextColor }" HorizontalOptions="Center" Style="{StaticResource FontIcon}"/>
<Label Text="{ Binding Recipe.Time , StringFormat='{0:N} min' }" FontSize="Small" TextColor="{ DynamicResource BaseTextColor }" HorizontalOptions="Center"/>
</StackLayout>
<StackLayout Orientation="Horizontal" Grid.Row="0" HorizontalOptions="EndAndExpand">
<!--DESCRIPCIÓN (FECHA)-->
<Label Text="{ x:Static local:IoniciconsFont.Fork }" FontSize="Large" TextColor="{ DynamicResource BaseTextColor }" HorizontalOptions="Center" Style="{StaticResource FontIcon}"/>
<Label Text="{ Binding Recipe.Difficulty, StringFormat='Dificultad : {0:N}'}" FontSize="Small" TextColor="{ DynamicResource BaseTextColor }" HorizontalOptions="Center"/>
</StackLayout>
</StackLayout>
<!-- SEPARATOR (CAJA EN LA QUE SE INCLUYEN LAS DOS VARIABLES ANTERIORES (ARTICULO Y FECHA)) -->
<BoxView Grid.Row="0" VerticalOptions="End" Style="{ StaticResource Horizontal1ptLineStyle}" />
<!--************************* MAIN PARAGRAPH *************************-->
<!-- TEXT (CUERPO DE LA RECETA) -->
<Grid Grid.Row="1" Padding="20,20,20,0" VerticalOptions="Center">
<Grid.RowDefinitions>
......@@ -94,32 +97,26 @@
<!--++++++++++++++++++ FIN RESUMEN ++++++++++++++++++++++-->
<!--++++++++++++++++++ INGREDIENTES ++++++++++++++++++++++-->
<!-- INGREDIENTE CABECERA -->
<StackLayout Orientation="Horizontal" BackgroundColor="#FF62b9ae" Grid.Row="1" Margin="0,5" Padding="10,5,10,5">
<Label HorizontalOptions="Start"
FontSize="50"
Text="{ x:Static local:IoniciconsFont.IosNutrition }"
Style="{StaticResource FontIcon}"
TextColor="#FFFFFFFF"/>
<StackLayout Orientation="Horizontal" BackgroundColor="#FF62b9ae" Grid.Row="1" Margin="0,5" Padding="10,5,10,5">
<Label HorizontalOptions="Start" FontSize="50" Text="{ x:Static local:IoniciconsFont.IosNutrition }" Style="{StaticResource FontIcon}" TextColor="#FFFFFFFF"/>
<Label Text=" Ingredientes (4 personas)" VerticalOptions="Center" TextColor="#FFFFFFFF"/>
</StackLayout>
<!--INGREDIENTE CUERPO-->
<ListView
SeparatorVisibility="None"
Grid.Row="2"
ItemsSource="{Binding Recipe.Ingredients}"
x:Name="listTable"
HasUnevenRows="False"
Footer=""
RowHeight="30"
ItemTapped="UnSelectedItem"
VerticalOptions="FillAndExpand">
<ListView SeparatorVisibility="None"
Grid.Row="2"
ItemsSource="{Binding Recipe.Ingredients}"
x:Name="listTable"
HasUnevenRows="False"
Footer=""
RowHeight="30"
ItemTapped="UnSelectedItem"
VerticalOptions="FillAndExpand">
<ListView.ItemTemplate>
<DataTemplate>
......@@ -132,56 +129,38 @@
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<!--++++++++++++++++++FIN INGREDIENTES++++++++++++++++++++++-->
<Label/>
<Label/>
<!--++++++++++++++++++ PREPARACIÓN ++++++++++++++++++++++-->
<!--CABECERA-->
<StackLayout Orientation="Horizontal" BackgroundColor="#FF62b9ae" Grid.Row="3" Margin="0,5" Padding="10,5,10,5">
<Label HorizontalOptions="Start"
FontSize="50"
Text="{ x:Static local:IoniciconsFont.ErlenmeyerFlaskBubbles }"
Style="{StaticResource FontIcon}"
TextColor="#FFFFFFFF"/>
<!--CABECERA-->
<StackLayout Orientation="Horizontal" BackgroundColor="#FF62b9ae" Grid.Row="3" Margin="0,5" Padding="10,5,10,5">
<Label HorizontalOptions="Start" FontSize="50" Text="{ x:Static local:IoniciconsFont.ErlenmeyerFlaskBubbles }" Style="{StaticResource FontIcon}" TextColor="#FFFFFFFF"/>
<Label Text="Preparación" VerticalOptions="Center" TextColor="#FFFFFFFF"/>
</StackLayout>
<!-- CUERPO -->
<Label
Grid.Row="4"
Text="{ Binding Recipe.Description }"
VerticalOptions="Center"
TextColor="{ DynamicResource BaseTextColor }"/>
<!--++++++++++++++++++ FIN PREPARACIÓN ++++++++++++++++++++++-->
<Label Grid.Row="4" Text="{ Binding Recipe.Description }" VerticalOptions="Center" TextColor="{ DynamicResource BaseTextColor }"/>
<!--++++++++++++++++++ FIN PREPARACIÓN ++++++++++++++++++++++-->
<!--++++++++++++++++++ TABLA INFORMACIÓN NUTRICIONAL ++++++++++++++++++++++-->
<!-- CABECERA -->
<StackLayout Orientation="Horizontal" BackgroundColor="#FF62b9ae" Grid.Row="5" Margin="0,5" Padding="10,5,10,5">
<Label
HorizontalOptions="Start"
FontSize="50"
Text="{ x:Static local:IoniciconsFont.IosInformation }"
Style="{StaticResource FontIcon}"
TextColor="#FFFFFFFF"/>
<Label
Text="Información nutricional por ración"
VerticalOptions="Center"
TextColor="#FFFFFFFF"/>
<Label HorizontalOptions="Start" FontSize="50" Text="{ x:Static local:IoniciconsFont.IosInformation }" Style="{StaticResource FontIcon}" TextColor="#FFFFFFFF"/>
<Label Text="Información nutricional por ración" VerticalOptions="Center" TextColor="#FFFFFFFF"/>
</StackLayout>
<!-- TABLA -->
<!-- INFORMATION CUERPO-->
<Grid
HorizontalOptions="StartAndExpand"
Grid.Row="6">
<Grid HorizontalOptions="StartAndExpand" Grid.Row="6">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
......@@ -191,127 +170,47 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- COLUMN 1 (ENERGÍA)-->
<Label
Grid.Column="0"
Grid.Row="0"
Text="Energía"
VerticalOptions="Center"
TextColor="{ DynamicResource BaseTextColor }"/>
<Label
Grid.Column="1"
Margin="30,0"
Grid.Row="0"
Text="{Binding Recipe.Energy}"
VerticalOptions="Center"
TextColor="{ DynamicResource BaseTextColor }"/>
<Label Grid.Column="0" Grid.Row="0" Text="Energía" VerticalOptions="Center" TextColor="{ DynamicResource BaseTextColor }"/>
<Label Grid.Column="1" Margin="30,0" Grid.Row="0" Text="{Binding Recipe.Energy}" VerticalOptions="Center" TextColor="{ DynamicResource BaseTextColor }"/>
<!-- COLUMN 2 (PROTEINAS)-->
<Label
Grid.Column="0"
Grid.Row="1"
Text="Proteinas"
VerticalOptions="Center"
TextColor="{ DynamicResource BaseTextColor }"/>
<Label
Grid.Column="1"
Margin="30,0"
Grid.Row="1"
Text="{Binding Recipe.Protein}"
VerticalOptions="Center"
TextColor="{ DynamicResource BaseTextColor }"/>
<Label Grid.Column="0" Grid.Row="1" Text="Proteinas" VerticalOptions="Center" TextColor="{ DynamicResource BaseTextColor }"/>
<Label Grid.Column="1" Margin="30,0" Grid.Row="1" Text="{Binding Recipe.Protein}" VerticalOptions="Center" TextColor="{ DynamicResource BaseTextColor }"/>
<!-- COLUMN 3 (HIDRATOS DE CARBONO)-->
<Label
Grid.Column="0"
Grid.Row="2"
Text="Hidratos de Carbono"
VerticalOptions="Center"
TextColor="{ DynamicResource BaseTextColor }"/>
<Label
Grid.Column="1"
Grid.Row="2"
Margin="30,0"
Text="{Binding Recipe.Carbohydrates}"
VerticalOptions="Center"
TextColor="{ DynamicResource BaseTextColor }"/>
<Label Grid.Column="0" Grid.Row="2" Text="Hidratos de Carbono" VerticalOptions="Center" TextColor="{ DynamicResource BaseTextColor }"/>
<Label Grid.Column="1" Grid.Row="2" Margin="30,0" Text="{Binding Recipe.Carbohydrates}" VerticalOptions="Center" TextColor="{ DynamicResource BaseTextColor }"/>
<!-- COLUMN 4 (LÍQUIDOS)-->
<Label
Grid.Column="0"
Grid.Row="3"
Text="Líquidos"
VerticalOptions="Center"
TextColor="{ DynamicResource BaseTextColor }"/>
<Label
Grid.Column="1"
Grid.Row="3"
Margin="30,0"
Text="{Binding Recipe.Lipids}"
VerticalOptions="Center"
TextColor="{ DynamicResource BaseTextColor }"/>
<Label Grid.Column="0" Grid.Row="3" Text="Líquidos" VerticalOptions="Center" TextColor="{ DynamicResource BaseTextColor }"/>
<Label Grid.Column="1" Grid.Row="3" Margin="30,0" Text="{Binding Recipe.Lipids}" VerticalOptions="Center" TextColor="{ DynamicResource BaseTextColor }"/>
<!-- COLUMN 5 (FIBRA)-->
<Label
Grid.Column="0"
Grid.Row="4"
Text="Fibra"
VerticalOptions="Center"
TextColor="{ DynamicResource BaseTextColor }"/>
<Label
Grid.Column="1"
Grid.Row="4"
Margin="30,0"
Text="{Binding Recipe.Fiber}"
VerticalOptions="Center"
TextColor="{ DynamicResource BaseTextColor }"/>
<Label Grid.Column="0" Grid.Row="4" Text="Fibra" VerticalOptions="Center" TextColor="{ DynamicResource BaseTextColor }"/>
<Label Grid.Column="1" Grid.Row="4" Margin="30,0" Text="{Binding Recipe.Fiber}" VerticalOptions="Center" TextColor="{ DynamicResource BaseTextColor }"/>
<!-- COLUMN 6 (COLESTEROL)-->
<Label
Grid.Column="0"
Grid.Row="5"
Text="Colesterol"
VerticalOptions="Center"
TextColor="{ DynamicResource BaseTextColor }"/>
<Label
Grid.Column="1"
Grid.Row="5"
Margin="30,0"
Text="{Binding Recipe.Cholesterol}"
VerticalOptions="Center"
TextColor="{ DynamicResource BaseTextColor }"/>
<Label Grid.Column="0" Grid.Row="5" Text="Colesterol" VerticalOptions="Center" TextColor="{ DynamicResource BaseTextColor }"/>
<Label Grid.Column="1" Grid.Row="5" Margin="30,0" Text="{Binding Recipe.Cholesterol}" VerticalOptions="Center" TextColor="{ DynamicResource BaseTextColor }"/>
</Grid>
<!--++++++++++++++++++ FIN INFORMACIÓN ++++++++++++++++++++++-->
</Grid>
</Grid>
</Grid>
</ScrollView>
<!-- POSTED -->
<StackLayout
Padding="0,0,0,5"
Orientation="Horizontal"
VerticalOptions="FillAndExpand"
HorizontalOptions="Center">
<Label
Text="Publicado por : "
TextColor="{ DynamicResource AccentColor }"
VerticalTextAlignment="Center"
HorizontalOptions="End"/>
<Image
Source="inutralia.png"
HorizontalOptions="End"/>
<StackLayout Padding="0,0,0,5" Orientation="Horizontal" VerticalOptions="FillAndExpand" HorizontalOptions="Center">
<Label Text="Publicado por : " TextColor="{ DynamicResource AccentColor }" VerticalTextAlignment="Center" HorizontalOptions="End"/>
<Image Source="inutralia.png" HorizontalOptions="End"/>
</StackLayout>
</StackLayout>
</ContentPage>
\ No newline at end of file
using inutralia.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace inutralia.Views
......@@ -19,39 +15,23 @@ namespace inutralia.Views
{
InitializeComponent();
}
catch(Exception e)
{
}
catch (Exception e) { }
}
protected override async void OnAppearing()
{
base.OnAppearing();
await ViewModel.RefreshData();
//setTimeout(Excerpt.Text = "\""+ Excerpt.Text+ "\"");
//await Task.Run(async () =>
//{
// await Task.Delay(5000);
// Device.BeginInvokeOnMainThread(() =>
// {
// });
//});
outerScrollView.Scrolled += OnScroll;
}
public void UnSelectedItem()
{
((ListView)listTable).SelectedItem = null;
}
protected override void OnDisappearing()
{
base.OnDisappearing();
......@@ -64,21 +44,25 @@ namespace inutralia.Views
var scrollRegion = layeringGrid.Height - outerScrollView.Height;
var parallexRegion = imageHeight - outerScrollView.Height;
var factor = outerScrollView.ScrollY - parallexRegion * (outerScrollView.ScrollY / scrollRegion);
if (factor < 0)
{
factor = 0;
}
else
{
if (img.TranslationY > img.Height)
{
factor = img.Height;
}
else if (img.TranslationY > outerScrollView.ScrollY)
{
img.TranslationY = outerScrollView.ScrollY;
}
}
img.TranslationY = factor;
img.Opacity = 1 - (factor / imageHeight);
//headers.Scale = 1 - ( (factor ) / (imageHeight * 2) ) ;
......@@ -119,11 +103,7 @@ namespace inutralia.Views
} //endif
}
public void OnPrimaryActionButtonClicked(object sender, EventArgs e)
{
}
public void OnPrimaryActionButtonClicked(object sender, EventArgs e) { }
}
}
<?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:app="clr-namespace:inutralia;assembly=inutralia"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
x:Class="inutralia.Views.ModalFiltersRecipe"
x:Name="modalFiltersRecipe"
BackgroundColor="{DynamicResource BasePageColor}"
Title="Recetas">
<StackLayout Padding="20"
VerticalOptions="FillAndExpand"
>
<StackLayout Padding="20" VerticalOptions="FillAndExpand">
<StackLayout VerticalOptions="Start" Orientation="Horizontal" Padding="0,0,0,10">
<Entry HorizontalOptions="FillAndExpand" Text="{Binding Desc}" Placeholder="Introduzca búsqueda" />
</StackLayout>
<ListView ItemTapped="ItemTapped"
ItemsSource="{Binding Groups}"
ItemsSource="{Binding Groups}"
Footer=""
HasUnevenRows="True"
IsGroupingEnabled="True">
<ListView.GroupHeaderTemplate>
<DataTemplate>
<ViewCell>
......@@ -32,25 +28,24 @@
</ViewCell>
</DataTemplate>
</ListView.GroupHeaderTemplate>
<ListView.ItemTemplate>
<DataTemplate>
<SwitchCell Text="{Binding Name}" On="{Binding Selected}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<artina:Button x:Name="applyButton"
Grid.Row="1"
HorizontalOptions="{ artina:OnOrientationLayoutOptions
PortraitPhone=Fill,
LandscapePhone=Center,
PortraitTablet=Fill,
LandscapeTablet=Center} "
PortraitPhone=Fill,
LandscapePhone=Center,
PortraitTablet=Fill,
LandscapeTablet=Center} "
VerticalOptions="End"
Clicked="ApplyModalButton"
Style="{DynamicResource PrimaryActionButtonStyle}"
Text= "Aplicar"
/>
Text= "Aplicar"/>
</StackLayout>
</ContentPage>
\ No newline at end of file
using inutralia.ViewModels;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace inutralia.Views
{
public partial class ModalFiltersRecipe : ContentPage
{
protected RecipeListOptionsViewModel ViewModel => BindingContext as RecipeListOptionsViewModel;
protected RecipeListView ListView;
public ModalFiltersRecipe( RecipeListView listView)
public ModalFiltersRecipe(RecipeListView listView)
{
InitializeComponent();
ListView = listView;
}
void ItemTapped(object sender, ItemTappedEventArgs e)
{
{
((ListView)sender).SelectedItem = null;
}
private async void ApplyModalButton(object sender, EventArgs e)
{
await ListView.ApplyFilters ();
await ListView.ApplyFilters();
}
protected override async void OnAppearing()
protected override void OnAppearing()
{
base.OnAppearing();
await ViewModel.ExecuteLoadOptionsCommand();
ViewModel.ExecuteLoadOptionsCommand();
}
}
}
......@@ -2,92 +2,43 @@
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
x:Class="inutralia.Views.RecipeItemTemplate"
x:Name="RecipeItemTemplate"
BackgroundColor="White">
<!--<ContentPage.Resources>
<ResourceDictionary>
<local:ImageTransformator x:Key="cnvImg"></local:ImageTransformator>
</ResourceDictionary>
</ContentPage.Resources>-->
<Grid BackgroundColor="Black">
<!-- TODO: Cambiar icon.png por imagen adecuada -->
<ffimageloading:CachedImage
FadeAnimationEnabled="true"
Source="{ Binding Image }"
Aspect="AspectFill"
Opacity="0.5"/>
<ffimageloading:CachedImage FadeAnimationEnabled="true"
Source="{ Binding Image }"
Aspect="AspectFill"
Opacity="0.5"/>
<Grid
ColumnSpacing="0"
RowSpacing="6"
Padding="20">
<Grid ColumnSpacing="0" RowSpacing="6" Padding="20">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="10" />
</Grid.RowDefinitions>
<!--PARTE SUPERIOR-->
<StackLayout
Grid.Row="0"
VerticalOptions="End"
HorizontalOptions="Start">
<StackLayout
Grid.Row="1"
Orientation="Horizontal"
HorizontalOptions="Fill"
VerticalOptions="FillAndExpand"
Padding="5"
>
<StackLayout Grid.Row="0" VerticalOptions="End" HorizontalOptions="Start">
<StackLayout Grid.Row="1" Orientation="Horizontal" HorizontalOptions="Fill" VerticalOptions="FillAndExpand" Padding="5" >
<!--TITULO-->
<Label
FontSize="30"
FontAttributes="Bold"
Text="{Binding ShortName}"
LineBreakMode="WordWrap"
TextColor="{ DynamicResource InverseTextColor }"/>
<Label FontSize="30" FontAttributes="Bold" Text="{Binding ShortName}" LineBreakMode="WordWrap" TextColor="{ DynamicResource InverseTextColor }"/>
</StackLayout>
</StackLayout>
<!--PARTE INFERIOR-->
<StackLayout
Grid.Row="1"
Orientation="Horizontal"
HorizontalOptions="FillAndExpand"
VerticalOptions="End">
<StackLayout Grid.Row="1" Orientation="Horizontal" HorizontalOptions="FillAndExpand" VerticalOptions="End">
<!--RESUMEN -->
<Label
Text="{ Binding Excerpt}"
TextColor="{ DynamicResource InverseTextColor }"
HorizontalOptions="FillAndExpand" />
<!--KCAL-->
<!-- <Label
Text="{Binding Energy}"
TextColor="{ DynamicResource InverseTextColor }"
FontSize="Small"
LineBreakMode="NoWrap"
HorizontalOptions="End" />-->
</StackLayout>
<Label Text="{ Binding Excerpt}" TextColor="{ DynamicResource InverseTextColor }" HorizontalOptions="FillAndExpand" />
</StackLayout>
<BoxView
Grid.Row="2"
Style="{StaticResource BrandNameOrnamentStyle}"/>
<BoxView Grid.Row="2" Style="{StaticResource BrandNameOrnamentStyle}"/>
</Grid>
</Grid>
</ContentView>
......@@ -14,7 +14,6 @@
-->
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
xmlns:conv="clr-namespace:inutralia.Converters;assembly=inutralia"
xmlns:views="clr-namespace:inutralia.Views;assembly=inutralia"
x:Class="inutralia.Views.RecipeListView"
......@@ -31,30 +30,20 @@
<conv:ImageTransformator x:Key="cnvImg"></conv:ImageTransformator>
</ResourceDictionary>
</ContentPage.Resources>
<!-- Este es el componente para el listado. Primero configura de dónde obtiene los datos
y el método al que llamar cuando se hace tap en un elemento de la lista. Luego
configura el pull-to-refresh. Por último algunas opciones de visionado y gestión
de memoria
-->
<StackLayout VerticalOptions="FillAndExpand">
<ActivityIndicator HorizontalOptions="FillAndExpand" IsRunning="{Binding IsBusy}" IsVisible="{Binding IsBusy}"/>
<Label Text="Buscando recetas..."
VerticalOptions="CenterAndExpand"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Center"
IsVisible="{Binding IsBusy}"
/>
<StackLayout VerticalOptions="FillAndExpand">
<ActivityIndicator HorizontalOptions="FillAndExpand" IsRunning="{Binding IsBusy}" IsVisible="{Binding IsBusy}"/>
<Label Margin="8,0,8,0"
Text="No se encontraron resultados. Cambie los filtros y pulse Aplicar"
VerticalOptions="CenterAndExpand"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Center"
IsVisible="{Binding IsEmpty}"
/>
<Label Text="Buscando recetas..." VerticalOptions="CenterAndExpand" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" IsVisible="{Binding IsBusy}"/>
<Label Margin="8,0,8,0" Text="No se encontraron resultados. Cambie los filtros y pulse Aplicar" VerticalOptions="CenterAndExpand" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" IsVisible="{Binding IsEmpty}"/>
<ListView VerticalOptions="FillAndExpand"
<ListView VerticalOptions="FillAndExpand"
SeparatorVisibility="None"
SeparatorColor="{ DynamicResource ListViewSeparatorColor }"
Footer=""
......@@ -63,15 +52,15 @@
ItemTapped="ItemTapped"
HasUnevenRows="false"
x:Name="listRecipe"
IsVisible="{Binding IsNotEmpty}"
>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<views:RecipeItemTemplate/>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
IsVisible="{Binding IsNotEmpty}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<views:RecipeItemTemplate/>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage>
using inutralia.Models;
using inutralia.ViewModels;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace inutralia.Views
{
public partial class RecipeListView : ContentPage
{
public partial class RecipeListView : ContentPage
{
protected RecipeListViewModel ViewModel => BindingContext as RecipeListViewModel;
protected bool firstTime = true;
......@@ -16,9 +15,8 @@ namespace inutralia.Views
protected ModalFiltersRecipe filtersPage = null;
public RecipeListView()
{
InitializeComponent();
{
InitializeComponent();
BindingContext = new RecipeListViewModel();
}
......@@ -37,11 +35,11 @@ namespace inutralia.Views
);
}
public async Task ApplyFilters ()
public async Task ApplyFilters()
{
await Navigation.PopAsync ();
ViewModel.Recipes.Clear ();
ViewModel.RefreshRecipesCommand.Execute (BindingContext);
await Navigation.PopAsync();
ViewModel.Recipes.Clear();
ViewModel.RefreshRecipesCommand.Execute(BindingContext);
}
/// <summary>
......@@ -56,36 +54,35 @@ namespace inutralia.Views
{
firstTime = false;
await DoFiltersAsync ();
await DoFiltersAsync();
} //endif
}
/// <summary>
/// Método llamado al pulsar el toolbar 'Filtros'
/// </summary>
private async void ToolbarFiltersClicked (object sender, EventArgs e)
private async void ToolbarFiltersClicked(object sender, EventArgs e)
{
if(ViewModel.IsNotBusy)
await DoFiltersAsync ();
if (ViewModel.IsNotBusy)
await DoFiltersAsync();
}
/// <summary>
/// Tarea de filtrado. Muestra el modal, espera a que se cierre, y actualiza el listado
/// </summary>
protected async Task DoFiltersAsync ()
protected async Task DoFiltersAsync()
{
// Crear la página de filtros si todavía no existe
if (filtersPage == null)
{
filtersPage = new ModalFiltersRecipe (this)
filtersPage = new ModalFiltersRecipe(this)
{
BindingContext = ViewModel.Filters
};
} //endif
// Mostrarla
await Navigation.PushAsync (filtersPage);
await Navigation.PushAsync(filtersPage);
}
}
}
......@@ -4,15 +4,13 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.Views.RegisterConditionsView"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
Title="Registro en la aplicación ..."
Title="Registro en la aplicación ..."
BackgroundColor="{DynamicResource BasePageColor}">
<ContentPage.Content>
<ContentPage.Content>
<StackLayout Padding="{ DynamicResource MainWrapperPadding }">
<StackLayout Padding="20" >
<WebView x:Name="ConditionsWebView"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
......@@ -27,15 +25,14 @@
Text = "Volver"
Clicked="OnBackButtonClicked"
WidthRequest="{artina:OnOrientationDouble
LandscapePhone=200,
LandscapeTablet=400 }"
LandscapePhone=200,
LandscapeTablet=400 }"
HorizontalOptions="{ artina:OnOrientationLayoutOptions
PortraitPhone=Fill,
LandscapePhone=Center,
PortraitTablet=Fill,
LandscapeTablet=Center }"/>
PortraitPhone=Fill,
LandscapePhone=Center,
PortraitTablet=Fill,
LandscapeTablet=Center }"/>
</StackLayout>
</StackLayout>
</ContentPage.Content>
</ContentPage>
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using Xamarin.Forms;
namespace inutralia.Views
{
public partial class RegisterConditionsView : ContentPage
{
public RegisterConditionsView()
{
InitializeComponent();
public partial class RegisterConditionsView : ContentPage
{
public RegisterConditionsView()
{
InitializeComponent();
var htmlSource = new HtmlWebViewSource ();
var htmlSource = new HtmlWebViewSource();
var assembly = typeof (App).GetTypeInfo ().Assembly;
Stream stream = assembly.GetManifestResourceStream ("inutralia.LegalConditions.html");
using (var reader = new StreamReader (stream))
var assembly = typeof(App).GetTypeInfo().Assembly;
Stream stream = assembly.GetManifestResourceStream("inutralia.LegalConditions.html");
using (var reader = new StreamReader(stream))
{
htmlSource.Html = reader.ReadToEnd ();
htmlSource.Html = reader.ReadToEnd();
}
ConditionsWebView.Source = htmlSource;
}
async void OnBackButtonClicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync ();
}
{
await Navigation.PopModalAsync();
}
}
}
\ No newline at end of file
......@@ -6,214 +6,150 @@
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
Title="Registro en la aplicación ..."
BackgroundColor="{DynamicResource BasePageColor}">
<ContentPage.Content>
<AbsoluteLayout>
<!-- GRADIENT-->
<Image
AbsoluteLayout.LayoutBounds="0,0,1,44"
AbsoluteLayout.LayoutFlags="WidthProportional"
Style="{ StaticResource StatusBarShimStyle }"
VerticalOptions="Start"/>
<ScrollView
AbsoluteLayout.LayoutBounds="0,0,1,1"
AbsoluteLayout.LayoutFlags="All"
VerticalOptions="FillAndExpand"
Padding="{ DynamicResource MainWrapperPadding }">
<!-- MAIN CONTAINER -->
<Grid
ColumnSpacing="0"
RowSpacing="0"
Padding="20,30,20,10"
HorizontalOptions="Fill"
VerticalOptions="FillAndExpand" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- HEADER -->
<StackLayout
Grid.Row="0"
Spacing="5"
Padding="0,20,0,0"
InputTransparent="true">
<!-- LOGO -->
<Grid
Grid.Row="1"
WidthRequest="150"
VerticalOptions="Center"
HorizontalOptions="Center">
<Image Source="logo_empresa.png" WidthRequest="150"></Image>
</Grid>
<!--SEPARATOR-->
<BoxView
WidthRequest="80"
HeightRequest="1"
HorizontalOptions="Center"
VerticalOptions="End"
BackgroundColor="{DynamicResource BaseTextColor}"/>
</StackLayout>
<!---FIELDS CONTAINER-->
<Grid
Grid.Row="1"
RowSpacing="30"
Padding="0,20,0,20"
VerticalOptions="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- ICON BACKGROUND -->
<Label
Grid.Column="0"
Grid.Row="0"
FontSize="40"
Style="{StaticResource RoundShape}"
HorizontalTextAlignment="Center"
TextColor="{DynamicResource ComplementColor}"
VerticalOptions="Center"
HorizontalOptions="Center"
/>
<!-- ICON -->
<Label
Grid.Column="0"
Grid.Row="0"
FontSize="14"
Text="{ x:Static local:GrialShapesFont.Email }"
Style="{StaticResource FontIconBase}"
HorizontalTextAlignment="Center"
TextColor="White"
VerticalOptions="Center"
HorizontalOptions="Center"
/>
<!--EMAIL FIELD-->
<Entry
Grid.Column="1"
Grid.Row="0"
HeightRequest="40"
x:Name = "userNameEntry"
Placeholder="Usuario"
BackgroundColor="{ DynamicResource PlaceholderColorEntry }"
PlaceholderColor="{ DynamicResource BaseTextColor }"/>
<!-- ICON BACKGROUND -->
<Label
Grid.Column="0"
Grid.Row="1"
FontSize="40"
Style="{StaticResource RoundShape}"
HorizontalTextAlignment="Center"
TextColor="{DynamicResource ComplementColor}"
VerticalOptions="Center"
HorizontalOptions="Center"
/>
<!-- ICON -->
<Label
Grid.Column="0"
Grid.Row="1"
FontSize="14"
Text="{ x:Static local:GrialShapesFont.Lock }"
Style="{StaticResource FontIconBase}"
HorizontalTextAlignment="Center"
TextColor="White"
VerticalOptions="Center"
HorizontalOptions="Center"
/>
<!-- PASSWORD ENTRY -->
<Entry
Grid.Column="1"
Grid.Row="1"
HeightRequest="40"
x:Name = "passWordEntry"
Placeholder="Contraseña"
IsPassword="True"
BackgroundColor="{ DynamicResource PlaceholderColorEntry }"
PlaceholderColor="{ DynamicResource BaseTextColor }"/>
<!-- ICON BACKGROUND -->
<Label
Grid.Column="0"
Grid.Row="2"
FontSize="40"
Style="{StaticResource RoundShape}"
HorizontalTextAlignment="Center"
TextColor="{DynamicResource ComplementColor}"
VerticalOptions="Center"
HorizontalOptions="Center"
/>
<!-- ICON -->
<Label
Grid.Column="0"
Grid.Row="2"
FontSize="14"
Text="{ x:Static local:GrialShapesFont.Star }"
Style="{StaticResource FontIconBase}"
HorizontalTextAlignment="Center"
TextColor="White"
VerticalOptions="Center"
HorizontalOptions="Center"
/>
<!-- PASSWORD ENTRY -->
<Entry
Grid.Column="1"
Grid.Row="2"
HeightRequest="40"
x:Name = "companyCodeEntry"
Placeholder="Código de Descarga"
IsPassword="True"
BackgroundColor="{ DynamicResource PlaceholderColorEntry }"
PlaceholderColor="{ DynamicResource BaseTextColor }"/>
</Grid>
<!-- BUTTONS -->
<StackLayout
Grid.Row="2"
Spacing="10"
Padding="0,10,0,0"
HorizontalOptions="FillAndExpand"
VerticalOptions="End" >
<ContentPage.Content>
<AbsoluteLayout>
<!-- GRADIENT-->
<Image AbsoluteLayout.LayoutBounds="0,0,1,44" AbsoluteLayout.LayoutFlags="WidthProportional" Style="{ StaticResource StatusBarShimStyle }" VerticalOptions="Start"/>
<ScrollView AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All" VerticalOptions="FillAndExpand" Padding="{ DynamicResource MainWrapperPadding }">
<!-- MAIN CONTAINER -->
<Grid ColumnSpacing="0" RowSpacing="0" Padding="20,30,20,10" HorizontalOptions="Fill" VerticalOptions="FillAndExpand" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- HEADER -->
<StackLayout Grid.Row="0" Spacing="5" Padding="0,20,0,0" InputTransparent="true">
<!-- LOGO -->
<Grid Grid.Row="1" WidthRequest="150" VerticalOptions="Center" HorizontalOptions="Center">
<Image Source="logo_empresa.png" WidthRequest="150"></Image>
</Grid>
<!--SEPARATOR-->
<BoxView WidthRequest="80" HeightRequest="1" HorizontalOptions="Center" VerticalOptions="End" BackgroundColor="{DynamicResource BaseTextColor}"/>
</StackLayout>
<!---FIELDS CONTAINER-->
<Grid Grid.Row="1" RowSpacing="30" Padding="0,20,0,20" VerticalOptions="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- ICON BACKGROUND -->
<Label Grid.Column="0"
Grid.Row="0"
FontSize="40"
Style="{StaticResource RoundShape}"
HorizontalTextAlignment="Center"
TextColor="{DynamicResource ComplementColor}"
VerticalOptions="Center"
HorizontalOptions="Center"/>
<!-- ICON -->
<Label Grid.Column="0"
Grid.Row="0"
FontSize="14"
Text="{ x:Static local:GrialShapesFont.Email }"
Style="{StaticResource FontIconBase}"
HorizontalTextAlignment="Center"
TextColor="White"
VerticalOptions="Center"
HorizontalOptions="Center"/>
<!--EMAIL FIELD-->
<Entry Grid.Column="1"
Grid.Row="0"
HeightRequest="40"
x:Name = "userNameEntry"
Placeholder="Usuario"
BackgroundColor="{ DynamicResource PlaceholderColorEntry }"
PlaceholderColor="{ DynamicResource BaseTextColor }"/>
<!-- ICON BACKGROUND -->
<Label Grid.Column="0"
Grid.Row="1"
FontSize="40"
Style="{StaticResource RoundShape}"
HorizontalTextAlignment="Center"
TextColor="{DynamicResource ComplementColor}"
VerticalOptions="Center"
HorizontalOptions="Center"/>
<!-- ICON -->
<Label Grid.Column="0"
Grid.Row="1"
FontSize="14"
Text="{ x:Static local:GrialShapesFont.Lock }"
Style="{StaticResource FontIconBase}"
HorizontalTextAlignment="Center"
TextColor="White"
VerticalOptions="Center"
HorizontalOptions="Center" />
<!-- PASSWORD ENTRY -->
<Entry Grid.Column="1"
Grid.Row="1"
HeightRequest="40"
x:Name = "passWordEntry"
Placeholder="Contraseña"
IsPassword="True"
BackgroundColor="{ DynamicResource PlaceholderColorEntry }"
PlaceholderColor="{ DynamicResource BaseTextColor }" />
<!-- ICON BACKGROUND -->
<Label Grid.Column="0"
Grid.Row="2"
FontSize="40"
Style="{StaticResource RoundShape}"
HorizontalTextAlignment="Center"
TextColor="{DynamicResource ComplementColor}"
VerticalOptions="Center"
HorizontalOptions="Center" />
<!-- ICON -->
<Label Grid.Column="0"
Grid.Row="2"
FontSize="14"
Text="{ x:Static local:GrialShapesFont.Star }"
Style="{StaticResource FontIconBase}"
HorizontalTextAlignment="Center"
TextColor="White"
VerticalOptions="Center"
HorizontalOptions="Center"/>
<!-- PASSWORD ENTRY -->
<Entry Grid.Column="1"
Grid.Row="2"
HeightRequest="40"
x:Name = "companyCodeEntry"
Placeholder="Código de Descarga"
IsPassword="True"
BackgroundColor="{ DynamicResource PlaceholderColorEntry }"
PlaceholderColor="{ DynamicResource BaseTextColor }"/>
</Grid>
<!-- BUTTONS -->
<StackLayout Grid.Row="2" Spacing="10" Padding="0,10,0,0" HorizontalOptions="FillAndExpand" VerticalOptions="End" >
<StackLayout Orientation="Horizontal" IsVisible="False">
<Switch x:Name="ConditionsSwitch" Toggled="ConditionsSwitch_Toggled" />
<Label Text="Confirmo haber leído y aceptado la política de privacidad y las condiciones de uso">
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="ConditionsLabelTapped"
......@@ -223,56 +159,47 @@
</StackLayout>
<!-- LOGIN -->
<artina:Button x:Name="RegisterButton"
Clicked="OnRegisterButtonClicked"
Style="{DynamicResource PrimaryActionButtonStyle}"
VerticalOptions="End"
Text="Registrar"
WidthRequest="{ artina:OnOrientationDouble
LandscapePhone=200,
LandscapeTablet=400 }"
HorizontalOptions="{ artina:OnOrientationLayoutOptions
PortraitPhone=Fill,
LandscapePhone=Center,
PortraitTablet=Fill,
LandscapeTablet=Center }"/>
<!-- Volver -->
<artina:Button
Style="{ DynamicResource PrimaryActionButtonStyle }"
BackgroundColor="#3b5998"
VerticalOptions="End"
x:Name="backButton"
Text = "Volver al Login"
Clicked="OnBackButtonClicked"
WidthRequest="{ artina:OnOrientationDouble
LandscapePhone=200,
LandscapeTablet=400 }"
HorizontalOptions="{ artina:OnOrientationLayoutOptions
PortraitPhone=Fill,
LandscapePhone=Center,
PortraitTablet=Fill,
LandscapeTablet=Center }"/>
<!--SEPARATOR-->
<BoxView
Grid.Row="4"
HeightRequest="1"
VerticalOptions="Start"
HorizontalOptions="Center"
WidthRequest="300"
BackgroundColor="{DynamicResource BaseTextColor}"/>
</StackLayout>
</Grid>
</ScrollView>
</AbsoluteLayout>
</ContentPage.Content>
<artina:Button x:Name="RegisterButton"
Clicked="OnRegisterButtonClicked"
Style="{DynamicResource PrimaryActionButtonStyle}"
VerticalOptions="End"
Text="Registrar"
WidthRequest="{ artina:OnOrientationDouble
LandscapePhone=200,
LandscapeTablet=400 }"
HorizontalOptions="{ artina:OnOrientationLayoutOptions
PortraitPhone=Fill,
LandscapePhone=Center,
PortraitTablet=Fill,
LandscapeTablet=Center }"/>
<!-- Volver -->
<artina:Button Style="{ DynamicResource PrimaryActionButtonStyle }"
BackgroundColor="#3b5998"
VerticalOptions="End"
x:Name="backButton"
Text = "Volver al Login"
Clicked="OnBackButtonClicked"
WidthRequest="{ artina:OnOrientationDouble
LandscapePhone=200,
LandscapeTablet=400 }"
HorizontalOptions="{ artina:OnOrientationLayoutOptions
PortraitPhone=Fill,
LandscapePhone=Center,
PortraitTablet=Fill,
LandscapeTablet=Center }"/>
<!--SEPARATOR-->
<BoxView Grid.Row="4"
HeightRequest="1"
VerticalOptions="Start"
HorizontalOptions="Center"
WidthRequest="300"
BackgroundColor="{DynamicResource BaseTextColor}"/>
</StackLayout>
</Grid>
</ScrollView>
</AbsoluteLayout>
</ContentPage.Content>
</ContentPage>
using System;
using System.Collections.Generic;
using System.Net;
using Xamarin.Forms;
namespace inutralia.Views
{
public partial class RegisterView : ContentPage
{
public RegisterView()
{
InitializeComponent();
// RegisterButton.IsEnabled = false;
public partial class RegisterView : ContentPage
{
public RegisterView()
{
InitializeComponent();
}
async void OnRegisterButtonClicked(object sender, EventArgs e)
{
var companyCode = companyCodeEntry.Text;
var userName = userNameEntry.Text;
var passWord = passWordEntry.Text;
async void OnRegisterButtonClicked(object sender, EventArgs e)
{
var companyCode = companyCodeEntry.Text;
var userName = userNameEntry.Text;
var passWord = passWordEntry.Text;
HttpStatusCode? errorCode = await App.API.RegisterUser (companyCode, userName, passWord);
HttpStatusCode? errorCode = await App.API.RegisterUser(companyCode, userName, passWord);
if (errorCode == null)
{
await DisplayAlert("Correcto" , "Se ha registrado correctamente. Puede acceder a la aplicación." , "Entendido");
{
await DisplayAlert("Correcto", "Se ha registrado correctamente. Puede acceder a la aplicación.", "Entendido");
// Cambiar de vista
await Navigation.PopModalAsync ();
}
else
{
await Navigation.PopModalAsync();
}
else
{
string msg = (errorCode == HttpStatusCode.Conflict) ?
"Ya existe un usuario con ese nombre, pruebe con otro." :
"Se ha producido un error en la grabación, por favor, inténtelo más tarde.";
await DisplayAlert("Error", msg, "Entendido");
} //endif
}
} //endif
}
async void OnBackButtonClicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync ();
}
async void OnBackButtonClicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
}
private void ConditionsSwitch_Toggled (object sender, ToggledEventArgs e)
private void ConditionsSwitch_Toggled(object sender, ToggledEventArgs e)
{
RegisterButton.IsEnabled = e.Value;
}
private async void ConditionsLabelTapped (object sender, EventArgs e)
private async void ConditionsLabelTapped(object sender, EventArgs e)
{
// Vista con las condiciones legales
await Navigation.PushModalAsync (new RegisterConditionsView () as Page);
await Navigation.PushModalAsync(new RegisterConditionsView() as Page);
}
}
}
......@@ -2,15 +2,10 @@
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.Views.RememberView">
<StackLayout Padding = "25,50" >
<Label x:Name="messageLabel" HorizontalOptions = "Center"/>
<Entry x:Name = "userEntry" Placeholder="Usuario" HorizontalOptions = "Fill"
VerticalOptions = "CenterAndExpand" />
<Button x:Name="RememberButton" Text = "Recuperar" Clicked="OnRememberButtonClicked" HorizontalOptions = "Fill"
VerticalOptions = "EndAndExpand" FontSize="24" BorderRadius="10" BorderWidth="1"/>
</StackLayout>
<StackLayout Padding = "25,50" >
<Label x:Name="messageLabel" HorizontalOptions = "Center"/>
<Entry x:Name = "userEntry" Placeholder="Usuario" HorizontalOptions = "Fill" VerticalOptions = "CenterAndExpand" />
<Button x:Name="RememberButton" Text = "Recuperar" Clicked="OnRememberButtonClicked" HorizontalOptions = "Fill" VerticalOptions = "EndAndExpand" FontSize="24" BorderRadius="10" BorderWidth="1"/>
</StackLayout>
</ContentPage>
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace inutralia.Views
{
public partial class RememberView : ContentPage
{
public RememberView()
{
InitializeComponent();
}
void OnRememberButtonClicked(object sender, EventArgs e)
{
Page nextView = new LoginView() as Page;
public partial class RememberView : ContentPage
{
public RememberView()
{
InitializeComponent();
}
// Cambiar de vista
Application.Current.MainPage = nextView;
}
void OnRememberButtonClicked(object sender, EventArgs e)
{
Page nextView = new LoginView() as Page;
}
// Cambiar de vista
Application.Current.MainPage = nextView;
}
}
}
<?xml version="1.0" encoding="utf-8" ?>
<pages:PopupPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.Views.ShoppingList.InfoPopup"
x:Class="inutralia.Views.ShoppingList.InfoPopup"
xmlns:pages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"
xmlns:animations="clr-namespace:Rg.Plugins.Popup.Animations;assembly=Rg.Plugins.Popup"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
BackgroundColor="Transparent">
<pages:PopupPage.Animation>
<animations:ScaleAnimation
PositionIn="Center"
PositionOut="Center"
ScaleIn="1.2"
ScaleOut="0.8"
DurationIn="400"
DurationOut="300"
EasingIn="SinOut"
EasingOut="SinIn"
HasBackgroundAnimation="False"/>
</pages:PopupPage.Animation>
<pages:PopupPage.Animation>
<animations:ScaleAnimation PositionIn="Center"
PositionOut="Center"
ScaleIn="1.2"
ScaleOut="0.8"
DurationIn="400"
DurationOut="300"
EasingIn="SinOut"
EasingOut="SinIn"
HasBackgroundAnimation="False"/>
</pages:PopupPage.Animation>
<StackLayout VerticalOptions="Center" Padding="20,0" HorizontalOptions="FillAndExpand" >
<Frame CornerRadius="10" Padding="0" BackgroundColor="{DynamicResource AccentColor}" >
<StackLayout Padding="10">
<Label Text="COMO SE UTILIZA LA LISTA DE LA COMPRA" TextColor="White" HorizontalOptions="Start"/>
<Label Text="La lista de la compra mostrará por defecto los ingredientes a utilizar por orden alfabético." TextColor="#333333" FontSize="Small" HorizontalOptions="CenterAndExpand"></Label>
<Label Text="BOTONES A UTILIZAR" TextColor="White" HorizontalOptions="Start"></Label>
<Label Text="· Añadir Productos" HorizontalOptions="Start" TextColor="#FFFFFF" FontSize="Small"></Label>
<Label Text="Desde esta opción podremos añadir el producto que queramos, siempre que sean relativos a la nutrición" TextColor="#333333" FontSize="Small" HorizontalOptions="CenterAndExpand"></Label>
<Label Text="· Comprar en DELSUPER" HorizontalOptions="Start" TextColor="#FFFFFF" FontSize="Small"></Label>
<Label Text="Este botón se pulsará, siempre que se quiera realizar la compra a través de un supermercado de forma online. Para ello nuestra alianza con el marketplace DelSuper nos facilitará esta opción, integrando nuestra lista en el supermercado que elijamos, para que nos la traigan a casa*" TextColor="#333333" FontSize="Small" HorizontalOptions="CenterAndExpand"></Label>
<Label Text="* Ver códigos postales de reparto." TextColor="#333333" FontSize="Micro" HorizontalOptions="CenterAndExpand"></Label>
<Label Text="· Borrar marcados" HorizontalOptions="Start" TextColor="#FFFFFF" FontSize="Small"></Label>
<Label Text="Esta opción tiene 2 funcionalidades, la primera, si vas hacer la compra personalmente, puedes ir marcándolos según los vayas echando a la cesta, y la segunda, tiene una función de eliminación, de tal forma que si vas a hacer la compra online y un producto no lo quieres adquirir, lo deberás marcar y borrar. Puedes hacerlo uno por uno o de forma masiva." TextColor="#333333" FontSize="Small" HorizontalOptions="CenterAndExpand"></Label>
<Label Text="· Borrar todos" HorizontalOptions="Start" TextColor="#FFFFFF" FontSize="Small"></Label>
<Label Text="Esta opción tiene como objetivo borrar todos los productos de una sola vez" TextColor="#333333" FontSize="Small" HorizontalOptions="CenterAndExpand"></Label>
<StackLayout VerticalOptions="Center" Padding="20,0" HorizontalOptions="FillAndExpand" >
<StackLayout Orientation="Horizontal" VerticalOptions="End" Padding="10,20,10,0">
<artina:Button Text="Cerrar"
Clicked="Button_Clicked"
FontSize="Medium"
Style="{DynamicResource DeleteButtonStyle}"
VerticalOptions="Center"
HorizontalOptions="FillAndExpand" />
</StackLayout>
</StackLayout>
</Frame>
</StackLayout>
<Frame CornerRadius="10" Padding="0" BackgroundColor="{DynamicResource AccentColor}" >
<StackLayout Padding="10">
<Label Text="COMO SE UTILIZA LA LISTA DE LA COMPRA" TextColor="White" HorizontalOptions="Start"/>
<Label Text="La lista de la compra mostrará por defecto los ingredientes a utilizar por orden alfabético." TextColor="#333333" FontSize="Small" HorizontalOptions="CenterAndExpand"></Label>
<Label Text="BOTONES A UTILIZAR" TextColor="White" HorizontalOptions="Start"></Label>
<Label Text="· Añadir Productos" HorizontalOptions="Start" TextColor="#FFFFFF" FontSize="Small"></Label>
<Label Text="Desde esta opción podremos añadir el producto que queramos, siempre que sean relativos a la nutrición" TextColor="#333333" FontSize="Small" HorizontalOptions="CenterAndExpand"></Label>
<Label Text="· Comprar en DELSUPER" HorizontalOptions="Start" TextColor="#FFFFFF" FontSize="Small"></Label>
<Label Text="Este botón se pulsará, siempre que se quiera realizar la compra a través de un supermercado de forma online. Para ello nuestra alianza con el marketplace DelSuper nos facilitará esta opción, integrando nuestra lista en el supermercado que elijamos, para que nos la traigan a casa*" TextColor="#333333" FontSize="Small" HorizontalOptions="CenterAndExpand"></Label>
<Label Text="* Ver códigos postales de reparto." TextColor="#333333" FontSize="Micro" HorizontalOptions="CenterAndExpand"></Label>
<Label Text="· Borrar marcados" HorizontalOptions="Start" TextColor="#FFFFFF" FontSize="Small"></Label>
<Label Text="Esta opción tiene 2 funcionalidades, la primera, si vas hacer la compra personalmente, puedes ir marcándolos según los vayas echando a la cesta, y la segunda, tiene una función de eliminación, de tal forma que si vas a hacer la compra online y un producto no lo quieres adquirir, lo deberás marcar y borrar. Puedes hacerlo uno por uno o de forma masiva." TextColor="#333333" FontSize="Small" HorizontalOptions="CenterAndExpand"></Label>
<Label Text="· Borrar todos" HorizontalOptions="Start" TextColor="#FFFFFF" FontSize="Small"></Label>
<Label Text="Esta opción tiene como objetivo borrar todos los productos de una sola vez" TextColor="#333333" FontSize="Small" HorizontalOptions="CenterAndExpand"></Label>
<StackLayout Orientation="Horizontal" VerticalOptions="End" Padding="10,20,10,0">
<artina:Button Text="Cerrar"
Clicked="Button_Clicked"
FontSize="Medium"
Style="{DynamicResource DeleteButtonStyle}"
VerticalOptions="Center"
HorizontalOptions="FillAndExpand" />
</StackLayout>
</StackLayout>
</Frame>
</StackLayout>
</pages:PopupPage>
<?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:app="clr-namespace:inutralia;assembly=inutralia"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
x:Class="inutralia.Views.ListDelSuper"
x:Name="listDelSuper"
Title=" TU COMPRA DELSUPER" >
<StackLayout Margin="10,10" VerticalOptions="FillAndExpand" IsVisible="{Binding isBusy}">
<ListView
ItemsSource="{Binding ShoppingList}"
ItemTapped="ItemTapped"
IsPullToRefreshEnabled="True"
RefreshCommand="{Binding RefreshShoppingListCommand}"
IsRefreshing="{Binding IsBusy, Mode=OneWay}"
BackgroundColor="Transparent"
CachingStrategy="RecycleElement"
SeparatorColor="{DynamicResource AccentColor}"
Footer=""
HasUnevenRows="False"
x:Name="ListView"
>
<StackLayout Margin="10,10" VerticalOptions="FillAndExpand" IsVisible="{Binding isBusy}">
<ListView ItemsSource="{Binding ShoppingList}"
ItemTapped="ItemTapped"
IsPullToRefreshEnabled="True"
RefreshCommand="{Binding RefreshShoppingListCommand}"
IsRefreshing="{Binding IsBusy, Mode=OneWay}"
BackgroundColor="Transparent"
CachingStrategy="RecycleElement"
SeparatorColor="{DynamicResource AccentColor}"
Footer=""
HasUnevenRows="False"
x:Name="ListView">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ContentView VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" >
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ContentView VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" >
<StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand" Padding="10,10,10,10" >
<Label Text="{Binding Text}" HorizontalOptions="StartAndExpand" FontSize="Medium"/>
</StackLayout>
</ContentView>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" Padding="0,10,0,10" >
<artina:Button x:Name="buyModalButton"
Text="DELSUPER"
FontSize="Medium"
HorizontalOptions="FillAndExpand"
VerticalOptions="Center"
HeightRequest="60"
WidthRequest="120"
Clicked="BuyModalButton"
Style="{DynamicResource PrimaryActionButtonStyle}"
BackgroundColor="#3b5998"/>
<Label Text="{Binding Text}" HorizontalOptions="StartAndExpand" FontSize="Medium"/>
</StackLayout>
</ContentView>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<artina:Button x:Name="cancelModalButton"
Text="Cancelar"
FontSize="Medium"
HorizontalOptions="FillAndExpand"
VerticalOptions="Center"
HeightRequest="60"
WidthRequest="110"
Clicked="CancelModalButton"
Style="{DynamicResource DeleteButtonStyle}"/>
</StackLayout>
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" Padding="0,10,0,10" >
<artina:Button x:Name="buyModalButton"
Text="DELSUPER"
FontSize="Medium"
HorizontalOptions="FillAndExpand"
VerticalOptions="Center"
HeightRequest="60"
WidthRequest="120"
Clicked="BuyModalButton"
Style="{DynamicResource PrimaryActionButtonStyle}"
BackgroundColor="#3b5998"/>
<artina:Button x:Name="cancelModalButton"
Text="Cancelar"
FontSize="Medium"
HorizontalOptions="FillAndExpand"
VerticalOptions="Center"
HeightRequest="60"
WidthRequest="110"
Clicked="CancelModalButton"
Style="{DynamicResource DeleteButtonStyle}"/>
</StackLayout>
</StackLayout>
</ContentPage>
using inutralia.Models;
using inutralia.ViewModels;
using inutralia.ViewModels;
using System;
using System.Net.Http;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
......
<?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:app="clr-namespace:inutralia;assembly=inutralia"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
x:Class="inutralia.Views.ModalAddShoppingList"
x:Name="modalAddShoppingListView"
Title="Ingredientes adicionales"
BackgroundColor="{DynamicResource BasePageColor}">
<ContentPage.Padding>
<OnPlatform x:TypeArguments="Thickness"
iOS="0,40,0,0"
......@@ -21,7 +19,6 @@
<StackLayout VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
<StackLayout VerticalOptions="CenterAndExpand" Padding="10,20,10,20">
<Label Text="AÑADE QUE QUIERES COMPRAR" TextColor="{DynamicResource AccentColor}" HorizontalOptions="Center" FontSize="24"/>
<Entry x:Name="entryIngre" Placeholder="Añade el ingrediente" HorizontalOptions="FillAndExpand" VerticalOptions="Center" Margin="20,20" />
</StackLayout>
</StackLayout>
......
using inutralia.Models;
using inutralia.ViewModels;
using inutralia.ViewModels;
using System;
using System.Threading.Tasks;
using System.Windows.Input;
using Xamarin.Forms;
namespace inutralia.Views
......@@ -10,7 +7,7 @@ namespace inutralia.Views
public partial class ModalAddShoppingList : ContentPage
{
protected ShoppingListViewModel ViewModel => BindingContext as ShoppingListViewModel;
public ModalAddShoppingList()
{
InitializeComponent();
......@@ -26,10 +23,10 @@ namespace inutralia.Views
private async void AddModalButton(object sender, EventArgs e)
{
var newItem = new Models.ShoppingList() { FromMenus = false, Select = false, Text = entryIngre.Text};
var newItem = new Models.ShoppingList() { FromMenus = false, Select = false, Text = entryIngre.Text };
await ViewModel.AddItem(newItem);
await Navigation.PopModalAsync();
}
await Navigation.PopModalAsync();
}
async void CancelModalButton(object sender, EventArgs e)
{
......@@ -39,9 +36,8 @@ namespace inutralia.Views
protected override void OnAppearing()
{
base.OnAppearing();
}
}
}
<?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:app="clr-namespace:inutralia;assembly=inutralia"
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
x:Class="inutralia.Views.ShoppingListView"
x:Name="shoppingListView"
Title="Lista de la Compra"
BackgroundColor="{DynamicResource BasePageColor}">
<ContentPage.ToolbarItems>
<ToolbarItem Icon="icon_info.png" artina:Theme.Name="Info" Clicked="InfoButtonClicked"/>
</ContentPage.ToolbarItems>
......@@ -16,20 +14,17 @@
<ContentPage.Content>
<StackLayout Margin="10,10" VerticalOptions="FillAndExpand" IsVisible="{Binding isBusy}">
<ListView
ItemsSource="{Binding ShoppingList}"
ItemTapped="ItemTapped"
IsPullToRefreshEnabled="True"
RefreshCommand="{Binding RefreshShoppingListCommand}"
IsRefreshing="{Binding IsBusy, Mode=OneWay}"
BackgroundColor="Transparent"
Footer=""
CachingStrategy="RecycleElement"
HasUnevenRows="False"
Margin="10,20"
x:Name="ListView">
<ListView ItemsSource="{Binding ShoppingList}"
ItemTapped="ItemTapped"
IsPullToRefreshEnabled="True"
RefreshCommand="{Binding RefreshShoppingListCommand}"
IsRefreshing="{Binding IsBusy, Mode=OneWay}"
BackgroundColor="Transparent"
Footer=""
CachingStrategy="RecycleElement"
HasUnevenRows="False"
Margin="10,20"
x:Name="ListView">
<ListView.ItemTemplate>
<DataTemplate>
......@@ -39,60 +34,57 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackLayout >
<Label Text="{Binding Text}" FontSize="Medium"/>
</StackLayout>
<Switch IsToggled="{Binding Select}" Grid.Column="1" />
</Grid>
</ViewCell>
<!--<SwitchCell Text="{Binding Text}" On="{Binding Select}"/>-->
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" >
<!--button 1-->
<artina:Button x:Name="addButton"
HorizontalOptions="FillAndExpand"
VerticalOptions="Center"
Clicked="OnAddButtonClicked"
Style="{DynamicResource PrimaryActionButtonStyle}"
Text= "Añadir productos"
HorizontalOptions="FillAndExpand"
VerticalOptions="Center"
Clicked="OnAddButtonClicked"
Style="{DynamicResource PrimaryActionButtonStyle}"
Text= "Añadir productos"
FontSize="Medium"/>
<artina:Button x:Name="addDelSuperButton"
HorizontalOptions="FillAndExpand"
VerticalOptions="Center"
Clicked="OnAddDelSuperButtonClicked"
Style="{DynamicResource PrimaryActionButtonStyle}"
BackgroundColor="#3b5998"
Text= "Comprar en DELSUPER"
HorizontalOptions="FillAndExpand"
VerticalOptions="Center"
Clicked="OnAddDelSuperButtonClicked"
Style="{DynamicResource PrimaryActionButtonStyle}"
BackgroundColor="#3b5998"
Text= "Comprar en DELSUPER"
FontSize="Medium"/>
</StackLayout>
<StackLayout Orientation="Horizontal">
<!--button 2-->
<artina:Button x:Name="deleteButton"
HorizontalOptions="FillAndExpand"
VerticalOptions="Center"
Clicked="OnDeleteButtonClicked"
Style="{DynamicResource DeleteButtonStyle}"
Text ="Borrar marcados"
FontSize="Small"/>
HorizontalOptions="FillAndExpand"
VerticalOptions="Center"
Clicked="OnDeleteButtonClicked"
Style="{DynamicResource DeleteButtonStyle}"
Text ="Borrar marcados"
FontSize="Small"/>
<!--button 3-->
<artina:Button x:Name="deleteAllButton"
HorizontalOptions="FillAndExpand"
VerticalOptions="Center"
Clicked="OnDeleteAllButtonClicked"
Style="{DynamicResource DeleteButtonStyle}"
Text="Borrar todos"
FontSize="Small"/>
HorizontalOptions="FillAndExpand"
VerticalOptions="Center"
Clicked="OnDeleteAllButtonClicked"
Style="{DynamicResource DeleteButtonStyle}"
Text="Borrar todos"
FontSize="Small"/>
</StackLayout>
<!--<BoxView Style="{ DynamicResource ThemeShowCaseHorizontalRuleStyle }" />-->
</StackLayout>
</ContentPage.Content>
</ContentPage>
\ No newline at end of file
......@@ -15,10 +15,11 @@ namespace inutralia.Views
InitializeComponent();
BindingContext = new ShoppingListViewModel();
}
protected override async void OnAppearing()
{
base.OnAppearing();
await ViewModel.ExecuteLoadShoppingListCommand();
await ViewModel.ExecuteLoadShoppingListCommand();
}
void ItemTapped(object sender, ItemTappedEventArgs e)
......@@ -28,9 +29,8 @@ namespace inutralia.Views
private async void InfoButtonClicked(object sender, EventArgs e) => await PopupNavigation.PushAsync(new InfoPopup());
async void OnAddButtonClicked(object sender, EventArgs e)
{
{
var addingre = new ModalAddShoppingList()
{
BindingContext = ViewModel
......@@ -49,17 +49,17 @@ namespace inutralia.Views
async void OnDeleteButtonClicked(object sender, EventArgs e)
{
if(await DisplayAlert("Está a punto de borrar uno o varios ingredientes.", "¿Desea continuar?", "Aceptar", "Cancelar") )
if (await DisplayAlert("Está a punto de borrar uno o varios ingredientes.", "¿Desea continuar?", "Aceptar", "Cancelar"))
{
await ViewModel.DeleteSelected ();
await ViewModel.DeleteSelected();
} //endif
}
async void OnDeleteAllButtonClicked(object sender, EventArgs e)
{
if(await DisplayAlert("Está a punto de borrar todos los ingredientes.", "¿Desea continuar?", "Aceptar", "Cancelar") )
if (await DisplayAlert("Está a punto de borrar todos los ingredientes.", "¿Desea continuar?", "Aceptar", "Cancelar"))
{
await ViewModel.DeleteAll ();
await ViewModel.DeleteAll();
}
}
}
......
<?xml version="1.0" encoding="UTF-8"?>
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
x:Class="inutralia.Views.TrivialGameItemTemplate"
x:Name="TrivialGameItemTemplate"
BackgroundColor="White">
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="inutralia.Views.TrivialGameItemTemplate"
x:Name="TrivialGameItemTemplate"
BackgroundColor="White">
<Grid HorizontalOptions="Fill" VerticalOptions="Fill" Padding="8,8,8,8">
<Grid
HorizontalOptions="Fill"
VerticalOptions="Fill"
Padding="8,8,8,8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
......@@ -23,17 +18,8 @@
</Grid.RowDefinitions>
<!-- Datos -->
<Label Grid.Row="1"
Grid.Column="0"
Text="{Binding StartDate}"
XAlign="Center"/>
<Label Grid.Row="1"
Grid.Column="1"
Text="{Binding Progress}"
XAlign="Center"/>
<Label Grid.Row="1"
Grid.Column="2"
Text="{Binding Score}"
XAlign="Center"/>
<Label Grid.Row="1" Grid.Column="0" Text="{Binding StartDate}" XAlign="Center"/>
<Label Grid.Row="1" Grid.Column="1" Text="{Binding Progress}" XAlign="Center"/>
<Label Grid.Row="1" Grid.Column="2" Text="{Binding Score}" XAlign="Center"/>
</Grid>
</ContentView>
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace inutralia.Views
{
public partial class TrivialGameItemTemplate : ContentView
{
public TrivialGameItemTemplate ()
{
InitializeComponent ();
}
}
public partial class TrivialGameItemTemplate : ContentView
{
public TrivialGameItemTemplate()
{
InitializeComponent();
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ContentView
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:inutralia;assembly=inutralia"
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
x:Class="inutralia.Views.TrivialGameResultTemplate"
x:Name="TrivialGameItemTemplate"
x:Name="TrivialGameItemTemplate"
BackgroundColor="White">
<StackLayout Padding="8,8,8,8">
<Label Text="{Binding Question.Text}" HorizontalOptions="Start" />
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand">
<Label Text=" { x:Static local:IoniciconsFont.CheckmarkCircled }" IsVisible="{Binding IsCorrect}" Margin="26,0,26,0" HorizontalOptions="Start" TextColor="Green" Style="{StaticResource FontIcon}" FontSize="Small" YAlign="Center" XAlign="Start">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="12"
Tablet="20"/>
</Label.FontSize>
</Label>
<Label Text=" { x:Static local:IoniciconsFont.CloseCircled }" IsVisible="{Binding IsNotCorrect}" Margin="26,0,26,0" HorizontalOptions="Start" TextColor="Red" Style="{StaticResource FontIcon}" FontSize="Small" YAlign="Center" XAlign="Start">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="12"
Tablet="20"/>
</Label.FontSize>
</Label>
<Label Text="{Binding Answer}" HorizontalOptions="Start" YAlign="Center" />
</StackLayout>
<StackLayout IsVisible="{Binding IsNotCorrect}" Orientation="Horizontal" HorizontalOptions="FillAndExpand">
<Label Text=" { x:Static local:IoniciconsFont.CheckmarkCircled }" Margin="26,0,26,0" HorizontalOptions="Start" TextColor="Green" Style="{StaticResource FontIcon}" FontSize="Small" YAlign="Center" XAlign="Start">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="12"
Tablet="20"/>
</Label.FontSize>
</Label>
<Label Text="{Binding ValidAnswer}" HorizontalOptions="Start" YAlign="Center" />
</StackLayout>
<StackLayout Padding="8,8,8,8">
<Label Text="{Binding Question.Text}" HorizontalOptions="Start" />
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand">
<Label Text=" { x:Static local:IoniciconsFont.CheckmarkCircled }"
IsVisible="{Binding IsCorrect}"
Margin="26,0,26,0"
HorizontalOptions="Start"
TextColor="Green"
Style="{StaticResource FontIcon}"
FontSize="Small"
YAlign="Center"
XAlign="Start">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="12"
Tablet="20"/>
</Label.FontSize>
</Label>
<Label Text=" { x:Static local:IoniciconsFont.CloseCircled }"
IsVisible="{Binding IsNotCorrect}"
Margin="26,0,26,0"
HorizontalOptions="Start"
TextColor="Red"
Style="{StaticResource FontIcon}"
FontSize="Small"
YAlign="Center"
XAlign="Start">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="12"
Tablet="20"/>
</Label.FontSize>
</Label>
<Label Text="{Binding Answer}" HorizontalOptions="Start" YAlign="Center" />
</StackLayout>
<StackLayout IsVisible="{Binding IsNotCorrect}" Orientation="Horizontal" HorizontalOptions="FillAndExpand">
<Label Text=" { x:Static local:IoniciconsFont.CheckmarkCircled }" Margin="26,0,26,0" HorizontalOptions="Start" TextColor="Green" Style="{StaticResource FontIcon}" FontSize="Small" YAlign="Center" XAlign="Start">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="12"
Tablet="20"/>
</Label.FontSize>
</Label>
<Label Text="{Binding ValidAnswer}" HorizontalOptions="Start" YAlign="Center" />
</StackLayout>
</StackLayout>
</ContentView>
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace inutralia.Views
{
public partial class TrivialGameResultTemplate : ContentView
{
public TrivialGameResultTemplate ()
{
InitializeComponent ();
}
}
public partial class TrivialGameResultTemplate : ContentView
{
public TrivialGameResultTemplate()
{
InitializeComponent();
}
}
}
<?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:local="clr-namespace:inutralia;assembly=inutralia"
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
xmlns:views="clr-namespace:inutralia.Views;assembly=inutralia"
x:Class="inutralia.Views.TrivialGameView"
Title="{Binding Title}"
>
Title="{Binding Title}">
<!-- Contenedor principal -->
<StackLayout VerticalOptions="FillAndExpand">
<!-- Contenedor pregunta (visible cuando la partida no ha terminado) -->
<StackLayout VerticalOptions="Fill" IsVisible="{Binding IsNotComplete}">
<!-- MAIN IMAGE -->
<ffimageloading:CachedImage
x:Name="img"
Source="{ Binding CurrentQuestion.Image }"
Aspect="AspectFit"
BackgroundColor="Black"
HorizontalOptions="Center"
VerticalOptions="Start"
Opacity=".8"/>
<ffimageloading:CachedImage x:Name="img"
Source="{ Binding CurrentQuestion.Image }"
Aspect="AspectFit"
BackgroundColor="Black"
HorizontalOptions="Center"
VerticalOptions="Start"
Opacity=".8"/>
<!-- Pregunta -->
<Label HorizontalOptions="FillAndExpand"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding CurrentQuestion.Text}"
BackgroundColor="{ DynamicResource ComplementColor }"
TextColor="{DynamicResource CustomNavBarTextColor }"
/>
TextColor="{DynamicResource CustomNavBarTextColor }" />
<!-- Opciones -->
<ListView SeparatorVisibility="Default"
SeparatorColor="{ DynamicResource ListViewSeparatorColor }"
......@@ -39,19 +36,18 @@
ItemsSource="{Binding CurrentQuestion.Options}"
VerticalOptions="EndAndExpand"
ItemTapped="ItemTapped"
HasUnevenRows="True"
HasUnevenRows="True"
x:Name="listOptions">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ContentView>
<StackLayout Padding="10,10,10,10">
<Label Text="{Binding .}" />
</StackLayout>
</ContentView>
</ViewCell>
<ViewCell>
<ContentView>
<StackLayout Padding="10,10,10,10">
<Label Text="{Binding .}" />
</StackLayout>
</ContentView>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
......@@ -59,16 +55,17 @@
<!-- Contenedor resultado (visible cuando la partida ha terminado) -->
<StackLayout VerticalOptions="FillAndExpand" IsVisible="{Binding IsComplete}" Padding="8,8,8,8" Margin="8,8,8,8">
<!--titulo campos de cada partida-->
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" BackgroundColor="{DynamicResource ComplementColor}" Padding="8,8,8,8" Margin="0,20,0,0" Grid.Row="1">
<Label Text="Fecha" HorizontalOptions="CenterAndExpand" TextColor="{DynamicResource CustomNavBarTextColor}" />
<Label Text="Respuestas" HorizontalOptions="CenterAndExpand" TextColor="{DynamicResource CustomNavBarTextColor}" />
<Label Text="Puntuación" HorizontalOptions="CenterAndExpand" TextColor="{DynamicResource CustomNavBarTextColor}" />
</StackLayout>
<!--titulo campos de cada partida-->
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" BackgroundColor="{DynamicResource ComplementColor}" Padding="8,8,8,8" Margin="0,20,0,0" Grid.Row="1">
<Label Text="Fecha" HorizontalOptions="CenterAndExpand" TextColor="{DynamicResource CustomNavBarTextColor}" />
<Label Text="Respuestas" HorizontalOptions="CenterAndExpand" TextColor="{DynamicResource CustomNavBarTextColor}" />
<Label Text="Puntuación" HorizontalOptions="CenterAndExpand" TextColor="{DynamicResource CustomNavBarTextColor}" />
</StackLayout>
<!-- Resumen -->
<views:TrivialGameItemTemplate BindingContext="{Binding Game}" />
<!-- Resultados -->
<!--Título listado de resultados-->
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" BackgroundColor="#FF62b9ae" Padding="8,8,8,8" >
......@@ -82,6 +79,7 @@
ItemTapped="Results_ItemTapped"
HasUnevenRows="True"
x:Name="listResults">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
......
using inutralia.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace inutralia.Views
{
[XamlCompilation (XamlCompilationOptions.Compile)]
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class TrivialGameView : ContentPage
{
protected TrivialGameViewModel ViewModel => BindingContext as TrivialGameViewModel;
public TrivialGameView ()
public TrivialGameView()
{
InitializeComponent ();
InitializeComponent();
}
async Task ItemTapped (object sender, ItemTappedEventArgs e)
async Task ItemTapped(object sender, ItemTappedEventArgs e)
{
// Obtiene el índice de la respuesta seleccionada
var index = ((ListView) sender).ItemsSource.Cast<object> ().ToList ().IndexOf (e.Item);
var index = ((ListView)sender).ItemsSource.Cast<object>().ToList().IndexOf(e.Item);
// Deselecciona el item para que no le cambie el color de fondo
((ListView) sender).SelectedItem = null;
((ListView)sender).SelectedItem = null;
await ViewModel.Answer (index);
await ViewModel.Answer(index);
}
private void Results_ItemTapped (object sender, ItemTappedEventArgs e)
private void Results_ItemTapped(object sender, ItemTappedEventArgs e)
{
// Deselecciona el item para que no le cambie el color de fondo
((ListView) sender).SelectedItem = null;
((ListView)sender).SelectedItem = null;
}
}
}
......@@ -8,45 +8,37 @@
Title="Trivial">
<ContentPage.Content>
<Grid VerticalOptions="FillAndExpand" Padding="20,20,20,20" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!--PARTIDAS-->
<StackLayout Orientation="Vertical" HorizontalOptions="Fill" BackgroundColor="{DynamicResource ComplementColor}" Padding="8,8,8,8" Grid.Row="0" Margin="0,5,0,0">
<Label Text="PARTIDAS" HorizontalOptions="Center" TextColor="{DynamicResource CustomNavBarTextColor}" />
</StackLayout>
<!--titulo campos de cada partida-->
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" BackgroundColor="#FF62b9ae" Padding="8,8,8,8" Margin="0,5,0,0" Grid.Row="1">
<Label Text="Fecha" HorizontalOptions="CenterAndExpand" TextColor="{DynamicResource CustomNavBarTextColor}" />
<Label Text="Respuestas" IsVisible="{Binding IsCorrect}" HorizontalOptions="CenterAndExpand" TextColor="{DynamicResource CustomNavBarTextColor}" />
<Label Text="Puntuación" IsVisible="{Binding IsCorrect}" HorizontalOptions="CenterAndExpand" TextColor="{DynamicResource CustomNavBarTextColor}" />
<!--PARTIDAS-->
<StackLayout Orientation="Vertical" HorizontalOptions="Fill" BackgroundColor="{DynamicResource ComplementColor}" Padding="8,8,8,8" Grid.Row="0" Margin="0,5,0,0">
<Label Text="PARTIDAS" HorizontalOptions="Center" TextColor="{DynamicResource CustomNavBarTextColor}" />
</StackLayout>
<!--titulo campos de cada partida-->
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" BackgroundColor="#FF62b9ae" Padding="8,8,8,8" Margin="0,5,0,0" Grid.Row="1">
<Label Text="Fecha" HorizontalOptions="CenterAndExpand" TextColor="{DynamicResource CustomNavBarTextColor}" />
<Label Text="Respuestas" IsVisible="{Binding IsCorrect}" HorizontalOptions="CenterAndExpand" TextColor="{DynamicResource CustomNavBarTextColor}" />
<Label Text="Puntuación" IsVisible="{Binding IsCorrect}" HorizontalOptions="CenterAndExpand" TextColor="{DynamicResource CustomNavBarTextColor}" />
</StackLayout>
</StackLayout>
<ListView Grid.Row="2"
VerticalOptions="FillAndExpand"
HorizontalOptions="Fill"
SeparatorVisibility="None"
SeparatorColor="{ DynamicResource ListViewSeparatorColor }"
ItemsSource="{Binding Games}"
ItemsSource="{Binding Games}"
ItemTapped="ItemTapped"
HasUnevenRows="True"
x:Name="listGames">
<ListView.RowHeight>
<!--<OnIdiom x:TypeArguments="x:Int32"
Phone="80"
Tablet="120"/>-->
</ListView.RowHeight>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
......@@ -60,7 +52,7 @@
</ListView>
<artina:Button Grid.Row="3"
Command="{Binding NewGameCommand}"
Command="{Binding NewGameCommand}"
Style="{DynamicResource PrimaryActionButtonStyle}"
Text="Nueva partida"
VerticalOptions="End"
......@@ -73,6 +65,5 @@
PortraitTablet=Fill,
LandscapeTablet=Center }"/>
</Grid>
</ContentPage.Content>
</ContentPage>
\ No newline at end of file
using inutralia.Models;
using inutralia.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace inutralia.Views
{
[XamlCompilation (XamlCompilationOptions.Compile)]
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class TrivialListView : ContentPage
{
protected TrivialListViewModel ViewModel => BindingContext as TrivialListViewModel;
public TrivialListView ()
public TrivialListView()
{
InitializeComponent ();
BindingContext = new TrivialListViewModel ();
InitializeComponent();
BindingContext = new TrivialListViewModel();
}
/// <summary>
/// Método llamado cada vez que una página pasa a ser visible
/// </summary>
protected override async void OnAppearing ()
protected override async void OnAppearing()
{
base.OnAppearing ();
base.OnAppearing();
// Le decimos al ViewModel que realice la primera carga del listado
await ViewModel.RefreshList ();
await ViewModel.RefreshList();
}
/// <summary>
......@@ -39,20 +33,19 @@ namespace inutralia.Views
/// </summary>
/// <param name="sender">La ListView</param>
/// <param name="e">Argumentos del evento</param>
void ItemTapped (object sender, ItemTappedEventArgs e)
void ItemTapped(object sender, ItemTappedEventArgs e)
{
// e.Item apunta a la partida seleccionada. A partir de ella se crea su ViewModel
// y con él se crea la página de detalle y se navega a ella
Navigation.PushAsync (
new TrivialGameView ()
Navigation.PushAsync(
new TrivialGameView()
{
BindingContext = new TrivialGameViewModel((TrivialGame) e.Item)
BindingContext = new TrivialGameViewModel((TrivialGame)e.Item)
}
);
// Deselecciona el item para que no le cambie el color de fondo
((ListView) sender).SelectedItem = null;
((ListView)sender).SelectedItem = null;
}
}
}
......@@ -10,6 +10,7 @@
<StackLayout VerticalOptions="FillAndExpand">
<ActivityIndicator HorizontalOptions="FillAndExpand" IsRunning="{Binding IsBusy}" IsVisible="{Binding IsBusy}" />
<Label Text="Danos dos segundos estámos cargando tu menú personalizado..."
VerticalOptions="CenterAndExpand"
VerticalTextAlignment="Center"
......@@ -17,7 +18,6 @@
TextColor="{DynamicResource AccentColor}"
IsVisible="{Binding IsBusy}"/>
<!-- MAIN CONTAINER -->
<Grid IsVisible="{Binding IsNotBusy}" ColumnSpacing="0" RowSpacing="10" Padding="20,20,20,20" HorizontalOptions="Fill" VerticalOptions="FillAndExpand">
......@@ -29,9 +29,11 @@
Tablet="80"/>
</RowDefinition.Height>
</RowDefinition>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition>
<RowDefinition.Height>
<OnIdiom x:TypeArguments="GridLength"
Phone="50"
......@@ -74,14 +76,14 @@
<!-- Titulo Comida -->
<Label Text="COMIDA"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="4"
HorizontalTextAlignment="Center"
VerticalOptions="CenterAndExpand"
VerticalTextAlignment="Center"
TextColor="#ffffffff"
BackgroundColor="{DynamicResource ComplementColor}">
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="4"
HorizontalTextAlignment="Center"
VerticalOptions="CenterAndExpand"
VerticalTextAlignment="Center"
TextColor="#ffffffff"
BackgroundColor="{DynamicResource ComplementColor}">
<Label.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
......@@ -118,13 +120,7 @@
<!-- Primero Comida -->
<Label Text="1º"
Grid.Row="1"
Grid.Column="0"
Grid.RowSpan="2"
VerticalOptions="Center"
Margin="10,0,0,0">
<Label Text="1º" Grid.Row="1" Grid.Column="0" Grid.RowSpan="2" VerticalOptions="Center" Margin="10,0,0,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="18"
......@@ -134,88 +130,62 @@
<!-- Primero Comida - Opc 1 -->
<Label HorizontalOptions="Fill"
VerticalOptions="Fill"
Grid.Row="1"
Grid.Column="1"
Grid.ColumnSpan="3">
<Label HorizontalOptions="Fill" VerticalOptions="Fill" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3">
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Switch Grid.Row="1"
Grid.Column="1"
IsToggled="{Binding IsLunchFirstOption1}"
VerticalOptions="Center"/>
<Label Text="{Binding CurrentDay.LunchFirst[0].ShortName}"
Grid.Row="1"
Grid.Column="2"
VerticalOptions="Center"
HorizontalOptions="CenterAndExpand">
<Switch Grid.Row="1" Grid.Column="1" IsToggled="{Binding IsLunchFirstOption1}" VerticalOptions="Center"/>
<Label Text="{Binding CurrentDay.LunchFirst[0].ShortName}" Grid.Row="1" Grid.Column="2" VerticalOptions="Center" HorizontalOptions="CenterAndExpand">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="12"
Tablet="25"/>
Phone="12"
Tablet="25"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Label Text="{ x:Static app:IoniciconsFont.Search }"
Style="{StaticResource FontIcon}"
Grid.Row="1"
Grid.Column="3"
HorizontalOptions="Center"
VerticalOptions="Center"
Margin="3,0,10,0">
Style="{StaticResource FontIcon}"
Grid.Row="1"
Grid.Column="3"
HorizontalOptions="Center"
VerticalOptions="Center"
Margin="3,0,10,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="20"
Tablet="40"/>
Phone="20"
Tablet="40"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<!-- Primero Comida - Opc 2 -->
<Label HorizontalOptions="Fill"
VerticalOptions="Fill"
Grid.Row="2"
Grid.Column="1"
Grid.ColumnSpan="3" >
<Label HorizontalOptions="Fill" VerticalOptions="Fill" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" >
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[1]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[1]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Switch Grid.Row="2"
Grid.Column="1"
IsToggled="{Binding IsLunchFirstOption2}"
VerticalOptions="Center"/>
<Switch Grid.Row="2" Grid.Column="1" IsToggled="{Binding IsLunchFirstOption2}" VerticalOptions="Center"/>
<Label Text="{Binding CurrentDay.LunchFirst[1].ShortName}"
Grid.Row="2"
......@@ -225,180 +195,149 @@
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="12"
Tablet="25"/>
Phone="12"
Tablet="25"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[1]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[1]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Label Text="{ x:Static app:IoniciconsFont.Search }"
Style="{StaticResource FontIcon}"
Grid.Row="2"
Grid.Column="3"
HorizontalOptions="Center"
VerticalOptions="Center"
Margin="3,0,10,0">
Style="{StaticResource FontIcon}"
Grid.Row="2"
Grid.Column="3"
HorizontalOptions="Center"
VerticalOptions="Center"
Margin="3,0,10,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="20"
Tablet="40"/>
Phone="20"
Tablet="40"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[1]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[1]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<!-- Segundo Comida -->
<Label Text="2º"
Grid.Row="3"
Grid.Column="0"
Grid.RowSpan="2"
VerticalOptions="Center"
Margin="10,0,0,0">
<Label Text="2º" Grid.Row="3" Grid.Column="0" Grid.RowSpan="2" VerticalOptions="Center" Margin="10,0,0,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="15"
Tablet="25"/>
Phone="15"
Tablet="25"/>
</Label.FontSize>
</Label>
<!-- Segundo Comida - Opc 1 -->
<Label HorizontalOptions="Fill"
VerticalOptions="Fill"
Grid.Row="3"
Grid.Column="1"
Grid.ColumnSpan="3">
<Label HorizontalOptions="Fill" VerticalOptions="Fill" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3">
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Label Text="{Binding CurrentDay.LunchSecond[0].ShortName}"
Grid.Row="3"
Grid.Column="2"
VerticalOptions="Center"
HorizontalOptions="CenterAndExpand">
Grid.Row="3"
Grid.Column="2"
VerticalOptions="Center"
HorizontalOptions="CenterAndExpand">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="12"
Tablet="25"/>
Phone="12"
Tablet="25"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Switch Grid.Row="3"
Grid.Column="1"
IsToggled="{Binding IsLunchSecondOption1}"
VerticalOptions="Center"/>
<Switch Grid.Row="3" Grid.Column="1" IsToggled="{Binding IsLunchSecondOption1}" VerticalOptions="Center"/>
<Label Text="{ x:Static app:IoniciconsFont.Search }"
Style="{StaticResource FontIcon}"
Grid.Row="3"
Grid.Column="3"
HorizontalOptions="CenterAndExpand"
VerticalOptions="Center"
Margin="3,0,10,0">
Style="{StaticResource FontIcon}"
Grid.Row="3"
Grid.Column="3"
HorizontalOptions="CenterAndExpand"
VerticalOptions="Center"
Margin="3,0,10,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="20"
Tablet="40"/>
Phone="20"
Tablet="40"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<!-- Segundo Comida - Opc 2 -->
<Label HorizontalOptions="Fill"
VerticalOptions="Fill"
Grid.Row="4"
Grid.Column="1"
Grid.ColumnSpan="3">
<Label HorizontalOptions="Fill" VerticalOptions="Fill" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3">
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[1]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[1]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Switch Grid.Row="4"
Grid.Column="1"
IsToggled="{Binding IsLunchSecondOption2}"
VerticalOptions="Center"/>
<Switch Grid.Row="4" Grid.Column="1" IsToggled="{Binding IsLunchSecondOption2}" VerticalOptions="Center"/>
<Label Text="{Binding CurrentDay.LunchSecond[1].ShortName}"
Grid.Row="4"
Grid.Column="2"
VerticalOptions="Center"
HorizontalOptions="CenterAndExpand">
Grid.Row="4"
Grid.Column="2"
VerticalOptions="Center"
HorizontalOptions="CenterAndExpand">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="12"
Tablet="25"/>
Phone="12"
Tablet="25"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[1]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[1]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Label Text="{ x:Static app:IoniciconsFont.Search }"
Style="{StaticResource FontIcon}"
Grid.Row="4"
Grid.Column="3"
HorizontalOptions="Center"
VerticalOptions="Center"
Margin="3,0,10,0">
Style="{StaticResource FontIcon}"
Grid.Row="4"
Grid.Column="3"
HorizontalOptions="Center"
VerticalOptions="Center"
Margin="3,0,10,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="20"
Tablet="40"/>
Phone="20"
Tablet="40"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[1]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[1]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
</Grid>
......@@ -431,14 +370,14 @@
<!-- Título Cena -->
<Label Text="CENA"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="4"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
VerticalOptions="CenterAndExpand"
TextColor="#ffffffff"
BackgroundColor="{DynamicResource ComplementColor}">
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="4"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
VerticalOptions="CenterAndExpand"
TextColor="#ffffffff"
BackgroundColor="{DynamicResource ComplementColor}">
<Label.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
......@@ -475,13 +414,7 @@
<!-- Primero Cena -->
<Label Text="1º"
Grid.Row="1"
Grid.Column="0"
Grid.RowSpan="2"
VerticalOptions="Center"
Margin="10,0,0,0">
<Label Text="1º" Grid.Row="1" Grid.Column="0" Grid.RowSpan="2" VerticalOptions="Center" Margin="10,0,0,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="15"
......@@ -491,275 +424,211 @@
<!-- Primero Cena - Opc 1 -->
<Label HorizontalOptions="Fill"
VerticalOptions="Fill"
Grid.Row="1"
Grid.Column="1"
Grid.ColumnSpan="3">
<Label HorizontalOptions="Fill" VerticalOptions="Fill" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="18"
Tablet="20"/>
Phone="18"
Tablet="20"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Switch Grid.Row="1"
Grid.Column="1"
IsToggled="{Binding IsDinnerFirstOption1}"
VerticalOptions="Center"/>
<Switch Grid.Row="1" Grid.Column="1" IsToggled="{Binding IsDinnerFirstOption1}" VerticalOptions="Center"/>
<Label Text="{Binding CurrentDay.DinnerFirst[0].ShortName}"
Grid.Row="1"
Grid.Column="2"
VerticalOptions="Center"
HorizontalOptions="CenterAndExpand">
Grid.Row="1"
Grid.Column="2"
VerticalOptions="Center"
HorizontalOptions="CenterAndExpand">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="12"
Tablet="25"/>
Phone="12"
Tablet="25"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Label Text="{ x:Static app:IoniciconsFont.Search }"
Style="{StaticResource FontIcon}"
Grid.Row="1"
Grid.Column="3"
HorizontalOptions="Center"
VerticalOptions="Center"
Margin="3,0,10,0">
Style="{StaticResource FontIcon}"
Grid.Row="1"
Grid.Column="3"
HorizontalOptions="Center"
VerticalOptions="Center"
Margin="3,0,10,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="20"
Tablet="40"/>
Phone="20"
Tablet="40"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<!-- Primero Cena - Opc 2 -->
<Label HorizontalOptions="Fill"
VerticalOptions="Fill"
Grid.Row="2"
Grid.Column="1"
Grid.ColumnSpan="3">
<Label HorizontalOptions="Fill" VerticalOptions="Fill" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3">
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[1]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[1]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Switch Grid.Row="2"
Grid.Column="1"
IsToggled="{Binding IsDinnerFirstOption2}"
VerticalOptions="Center"/>
<Label Text="{Binding CurrentDay.DinnerFirst[1].ShortName}"
Grid.Row="2"
Grid.Column="2"
VerticalOptions="Center"
HorizontalOptions="CenterAndExpand">
<Switch Grid.Row="2" Grid.Column="1" IsToggled="{Binding IsDinnerFirstOption2}" VerticalOptions="Center"/>
<Label Text="{Binding CurrentDay.DinnerFirst[1].ShortName}" Grid.Row="2" Grid.Column="2" VerticalOptions="Center" HorizontalOptions="CenterAndExpand">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="12"
Tablet="25"/>
Phone="12"
Tablet="25"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[1]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[1]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Label Text="{ x:Static app:IoniciconsFont.Search }"
Style="{StaticResource FontIcon}"
Grid.Row="2"
Grid.Column="3"
HorizontalOptions="Center"
VerticalOptions="Center"
Margin="3,0,10,0">
Style="{StaticResource FontIcon}"
Grid.Row="2"
Grid.Column="3"
HorizontalOptions="Center"
VerticalOptions="Center"
Margin="3,0,10,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="20"
Tablet="40"/>
Phone="20"
Tablet="40"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[1]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[1]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<!-- Segundo Cena -->
<Label Text="2º"
Grid.Row="3"
Grid.Column="0"
Grid.RowSpan="2"
VerticalOptions="Center"
Margin="10,0,0,0">
<Label Text="2º" Grid.Row="3" Grid.Column="0" Grid.RowSpan="2" VerticalOptions="Center" Margin="10,0,0,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="15"
Tablet="25"/>
Phone="15"
Tablet="25"/>
</Label.FontSize>
</Label>
<!-- Segundo Cena - Opc 1 -->
<Label HorizontalOptions="Fill"
VerticalOptions="Fill"
Grid.Row="3"
Grid.Column="1"
Grid.ColumnSpan="3">
<Label HorizontalOptions="Fill" VerticalOptions="Fill" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3">
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Switch Grid.Row="3"
Grid.Column="1"
IsToggled="{Binding IsDinnerSecondOption1}"
VerticalOptions="Center"/>
<Label Text="{Binding CurrentDay.DinnerSecond[0].ShortName}"
Grid.Row="3"
Grid.Column="2"
VerticalOptions="Center"
HorizontalOptions="CenterAndExpand">
<Switch Grid.Row="3" Grid.Column="1" IsToggled="{Binding IsDinnerSecondOption1}" VerticalOptions="Center"/>
<Label Text="{Binding CurrentDay.DinnerSecond[0].ShortName}" Grid.Row="3" Grid.Column="2" VerticalOptions="Center" HorizontalOptions="CenterAndExpand">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="12"
Tablet="25"/>
Phone="12"
Tablet="25"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Label Text="{ x:Static app:IoniciconsFont.Search }"
Style="{StaticResource FontIcon}"
Grid.Row="3"
Grid.Column="3"
HorizontalOptions="Center"
VerticalOptions="Center"
Margin="3,0,10,0">
Style="{StaticResource FontIcon}"
Grid.Row="3"
Grid.Column="3"
HorizontalOptions="Center"
VerticalOptions="Center"
Margin="3,0,10,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="20"
Tablet="40"/>
Phone="20"
Tablet="40"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<!-- Segundo Cena - Opc 2 -->
<Label HorizontalOptions="Fill"
VerticalOptions="Fill"
Grid.Row="4"
Grid.Column="1"
Grid.ColumnSpan="3">
<Label HorizontalOptions="Fill" VerticalOptions="Fill" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3">
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[1]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[1]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Switch Grid.Row="4"
Grid.Column="1"
IsToggled="{Binding IsDinnerSecondOption2}"
VerticalOptions="Center"/>
<Label Text="{Binding CurrentDay.DinnerSecond[1].ShortName}"
Grid.Row="4"
Grid.Column="2"
VerticalOptions="Center"
HorizontalOptions="CenterAndExpand">
<Switch Grid.Row="4" Grid.Column="1" IsToggled="{Binding IsDinnerSecondOption2}" VerticalOptions="Center"/>
<Label Text="{Binding CurrentDay.DinnerSecond[1].ShortName}" Grid.Row="4" Grid.Column="2" VerticalOptions="Center" HorizontalOptions="CenterAndExpand">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="12"
Tablet="25"/>
Phone="12"
Tablet="25"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[1]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[1]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Label Text="{ x:Static app:IoniciconsFont.Search }"
Style="{StaticResource FontIcon}"
Grid.Row="4"
Grid.Column="3"
HorizontalOptions="Center"
VerticalOptions="Center"
Margin="3,0,10,0">
Style="{StaticResource FontIcon}"
Grid.Row="4"
Grid.Column="3"
HorizontalOptions="Center"
VerticalOptions="Center"
Margin="3,0,10,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="20"
Tablet="40"/>
Phone="20"
Tablet="40"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[1]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[1]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
</Grid>
......
using inutralia.Models;
using inutralia.ViewModels;
using inutralia.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace inutralia.Views
{
[XamlCompilation (XamlCompilationOptions.Compile)]
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class CustomMenuView : ContentPage
{
protected CustomMenuViewModel ViewModel => BindingContext as CustomMenuViewModel;
// Labels para los botónes de los días
private static readonly string [] DayNames = new []
private static readonly string[] DayNames = new[]
{
"L", "M", "X", "J", "V", "S", "D"
};
// Constructor. Añade los botones de los días
public CustomMenuView ()
public CustomMenuView()
{
InitializeComponent ();
BindingContext = new CustomMenuViewModel ();
InitializeComponent();
BindingContext = new CustomMenuViewModel();
for (int i = 0; i < 7; i++)
{
var b = new UXDivers.Artina.Shared.Button
{
Style = Application.Current.Resources ["SquaredButtonStyle"] as Style,
Style = Application.Current.Resources["SquaredButtonStyle"] as Style,
VerticalOptions = LayoutOptions.FillAndExpand,
HorizontalOptions = LayoutOptions.Fill,
FontSize = 22,
Text = DayNames [i],
Text = DayNames[i],
};
b.Clicked += OnDayClicked;
buttonList.Children.Add (b, i, 0);
buttonList.Children.Add(b, i, 0);
}
}
......@@ -50,9 +43,9 @@ namespace inutralia.Views
/// <summary>
/// Llamado cuando cambia el contexto asociado
/// </summary>
protected override void OnBindingContextChanged ()
protected override void OnBindingContextChanged()
{
base.OnBindingContextChanged ();
base.OnBindingContextChanged();
// Le decimos al ViewModel que queremos ser informados cuando cambie
// cualquiera de sus propiedades
......@@ -62,45 +55,45 @@ namespace inutralia.Views
/// <summary>
/// Llamado cuando cambia el valor de una propiedad del ViewModel
/// </summary>
private void OnViewModelPropertyChanged (object sender, System.ComponentModel.PropertyChangedEventArgs e)
private void OnViewModelPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
// Cuando cambia el índice del día seleccionado, cambiamos el color de los botones
if (e.PropertyName == "Index")
{
// Coger el botón seleccionado
View but = buttonList.Children [ViewModel.Index] as View;
View but = buttonList.Children[ViewModel.Index] as View;
// Poner el fondo del seleccionado a ComplementColor y el resto a AccentColor
foreach (var b in buttonList.Children)
b.BackgroundColor = (Color) Application.Current.Resources [b == but ? "ComplementColor" : "BaseTextColor"];
b.BackgroundColor = (Color)Application.Current.Resources[b == but ? "ComplementColor" : "BaseTextColor"];
} //endif
}
/// <summary>
/// Llamado cuando se pulsa un botón de día
/// </summary>
private void OnDayClicked (object sender, EventArgs e)
private void OnDayClicked(object sender, EventArgs e)
{
// Cambiar el índice del día seleccionado al del botón
ViewModel.Index = buttonList.Children.IndexOf (sender as View);
ViewModel.Index = buttonList.Children.IndexOf(sender as View);
}
/// <summary>
/// Llamado cuando esta vista se muestra
/// </summary>
protected override async void OnAppearing ()
protected override async void OnAppearing()
{
base.OnAppearing ();
base.OnAppearing();
// Decirle al ViewModel que refresque sus datos
await ViewModel.LoadData ();
await ViewModel.LoadData();
}
protected override async void OnDisappearing ()
protected override async void OnDisappearing()
{
base.OnDisappearing ();
base.OnDisappearing();
await ViewModel.UpdateShoppingListAsync ();
await ViewModel.UpdateShoppingListAsync();
}
}
}
......@@ -10,6 +10,7 @@
<StackLayout VerticalOptions="FillAndExpand">
<ActivityIndicator HorizontalOptions="FillAndExpand" IsRunning="{Binding IsBusy}" IsVisible="{Binding IsBusy}" />
<Label Text="Danos dos segundos estámos cargando tu menú personalizado..."
VerticalOptions="CenterAndExpand"
VerticalTextAlignment="Center"
......@@ -17,7 +18,6 @@
TextColor="{DynamicResource AccentColor}"
IsVisible="{Binding IsBusy}"/>
<!-- MAIN CONTAINER -->
<Grid IsVisible="{Binding IsNotBusy}" ColumnSpacing="0" RowSpacing="10" Padding="20,20,20,20" HorizontalOptions="Fill" VerticalOptions="FillAndExpand">
<Grid.RowDefinitions>
......@@ -74,28 +74,28 @@
<!-- Titulo Comida -->
<Label Text="COMIDA"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="3"
HorizontalTextAlignment="Center"
HorizontalOptions="FillAndExpand"
VerticalOptions="CenterAndExpand"
VerticalTextAlignment="Center"
TextColor="#ffffffff"
BackgroundColor="{DynamicResource ComplementColor}">
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="3"
HorizontalTextAlignment="Center"
HorizontalOptions="FillAndExpand"
VerticalOptions="CenterAndExpand"
VerticalTextAlignment="Center"
TextColor="#ffffffff"
BackgroundColor="{DynamicResource ComplementColor}">
<Label.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double"
iOS="30"
Android="30"/>
iOS="30"
Android="30"/>
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double"
iOS="60"
Android="60"/>
iOS="60"
Android="60"/>
</OnIdiom.Tablet>
</OnIdiom>
</Label.HeightRequest>
......@@ -104,14 +104,14 @@
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double"
iOS="18"
Android="18"/>
iOS="18"
Android="18"/>
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double"
iOS="27"
Android="27"/>
iOS="27"
Android="27"/>
</OnIdiom.Tablet>
</OnIdiom>
</Label.FontSize>
......@@ -119,136 +119,115 @@
<!-- Primero Comida -->
<Label
Text="1º"
Grid.Row="1"
Grid.Column="0"
VerticalOptions="Center"
HorizontalOptions="Start"
Margin="10,0,0,0">
<Label Text="1º" Grid.Row="1" Grid.Column="0" VerticalOptions="Center" HorizontalOptions="Start" Margin="10,0,0,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="23"
Tablet="40"/>
Phone="23"
Tablet="40"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Label Text="{Binding CurrentDay.LunchFirst[0].Name}"
Grid.Row="1"
Grid.Column="1"
VerticalOptions="Center"
HorizontalOptions="Center"
Margin="5,0,0,0">
Grid.Row="1"
Grid.Column="1"
VerticalOptions="Center"
HorizontalOptions="Center"
Margin="5,0,0,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="17"
Tablet="36"/>
Phone="17"
Tablet="36"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Label
Text="{ x:Static app:IoniciconsFont.Search }"
Style="{StaticResource FontIcon}"
Grid.Row="1"
Grid.Column="2"
HorizontalOptions="End"
VerticalOptions="Center"
Margin="5,0,10,0">
<Label Text="{ x:Static app:IoniciconsFont.Search }"
Style="{StaticResource FontIcon}"
Grid.Row="1"
Grid.Column="2"
HorizontalOptions="End"
VerticalOptions="Center"
Margin="5,0,10,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="30"
Tablet="50"/>
Phone="30"
Tablet="50"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchFirst[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<!-- Segundo Comida -->
<Label Text="2º"
Grid.Row="2"
Grid.Column="0"
VerticalOptions="Center"
HorizontalOptions="Start"
Margin="10,0,0,0">
<Label Text="2º" Grid.Row="2" Grid.Column="0" VerticalOptions="Center" HorizontalOptions="Start" Margin="10,0,0,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="23"
Tablet="40"/>
Phone="23"
Tablet="40"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Label Text="{Binding CurrentDay.LunchSecond[0].Name}"
Grid.Row="2"
Grid.Column="1"
VerticalOptions="Center"
HorizontalOptions="Center"
Margin="5,0,0,0">
Grid.Row="2"
Grid.Column="1"
VerticalOptions="Center"
HorizontalOptions="Center"
Margin="5,0,0,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="17"
Tablet="36"/>
Phone="17"
Tablet="36"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Label Text="{ x:Static app:IoniciconsFont.Search }"
Style="{StaticResource FontIcon}"
Grid.Row="2"
Grid.Column="2"
HorizontalOptions="End"
VerticalOptions="Center"
Margin="5,0,10,0">
Style="{StaticResource FontIcon}"
Grid.Row="2"
Grid.Column="2"
HorizontalOptions="End"
VerticalOptions="Center"
Margin="5,0,10,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="30"
Tablet="50"/>
Phone="30"
Tablet="50"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.LunchSecond[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
</Grid>
......@@ -276,14 +255,14 @@
<!-- Título Cena -->
<Label Text="CENA"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="3"
HorizontalTextAlignment="Center"
VerticalOptions="CenterAndExpand"
VerticalTextAlignment="Center"
TextColor="#ffffffff"
BackgroundColor="{DynamicResource ComplementColor}">
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="3"
HorizontalTextAlignment="Center"
VerticalOptions="CenterAndExpand"
VerticalTextAlignment="Center"
TextColor="#ffffffff"
BackgroundColor="{DynamicResource ComplementColor}">
<Label.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
......@@ -320,136 +299,115 @@
<!-- Primero Cena -->
<Label
Text="1º"
Grid.Row="1"
Grid.Column="0"
VerticalOptions="Center"
HorizontalOptions="Start"
Margin="10,0,0,0">
<Label Text="1º" Grid.Row="1" Grid.Column="0" VerticalOptions="Center" HorizontalOptions="Start" Margin="10,0,0,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="23"
Tablet="40"/>
Phone="23"
Tablet="40"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Label
Text="{Binding CurrentDay.DinnerFirst[0].Name}"
Grid.Row="1"
Grid.Column="1"
VerticalOptions="Center"
HorizontalOptions="Center"
Margin="5,0,0,0">
<Label Text="{Binding CurrentDay.DinnerFirst[0].Name}"
Grid.Row="1"
Grid.Column="1"
VerticalOptions="Center"
HorizontalOptions="Center"
Margin="5,0,0,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="17"
Tablet="36"/>
Phone="17"
Tablet="36"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Label
Text="{ x:Static app:IoniciconsFont.Search }"
Style="{StaticResource FontIcon}"
Grid.Row="1"
Grid.Column="2"
HorizontalOptions="End"
VerticalOptions="Center"
Margin="5,0,10,0">
<Label Text="{ x:Static app:IoniciconsFont.Search }"
Style="{StaticResource FontIcon}"
Grid.Row="1"
Grid.Column="2"
HorizontalOptions="End"
VerticalOptions="Center"
Margin="5,0,10,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="30"
Tablet="50"/>
Phone="30"
Tablet="50"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerFirst[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<!-- Segundo Cena -->
<Label Text="2º"
Grid.Row="2"
Grid.Column="0"
VerticalOptions="Center"
HorizontalOptions="Start"
Margin="10,0,0,0">
<Label Text="2º" Grid.Row="2" Grid.Column="0" VerticalOptions="Center" HorizontalOptions="Start" Margin="10,0,0,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="23"
Tablet="40"/>
Phone="23"
Tablet="40"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Label Text="{Binding CurrentDay.DinnerSecond[0].Name}"
Grid.Row="2"
Grid.Column="1"
VerticalOptions="Center"
HorizontalOptions="Center"
Margin="5,0,0,0">
Grid.Row="2"
Grid.Column="1"
VerticalOptions="Center"
HorizontalOptions="Center"
Margin="5,0,0,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="17"
Tablet="36"/>
Phone="17"
Tablet="36"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
<Label Text="{ x:Static app:IoniciconsFont.Search }"
Style="{StaticResource FontIcon}"
Grid.Row="2"
Grid.Column="2"
HorizontalOptions="End"
VerticalOptions="Center"
Margin="5,0,10,0">
Style="{StaticResource FontIcon}"
Grid.Row="2"
Grid.Column="2"
HorizontalOptions="End"
VerticalOptions="Center"
Margin="5,0,10,0">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double"
Phone="30"
Tablet="50"/>
Phone="30"
Tablet="50"/>
</Label.FontSize>
<Label.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[0]}"
NumberOfTapsRequired="1" />
<TapGestureRecognizer Command="{Binding ShowRecipeCommand}"
CommandParameter="{Binding CurrentDay.DinnerSecond[0]}"
NumberOfTapsRequired="1" />
</Label.GestureRecognizers>
</Label>
</Grid>
......
......@@ -2,47 +2,46 @@
using inutralia.ViewModels;
using Xamarin.Forms;
namespace inutralia.Views
{
public partial class GenericDetailView : ContentPage
{
protected GenericDetailViewModel ViewModel => BindingContext as GenericDetailViewModel;
public partial class GenericDetailView : ContentPage
{
protected GenericDetailViewModel ViewModel => BindingContext as GenericDetailViewModel;
// Labels para los botónes de los días
private static readonly string [] DayNames = new []
private static readonly string[] DayNames = new[]
{
"L", "M", "X", "J", "V", "S", "D"
};
// Constructor. Añade los botones de los días
public GenericDetailView ()
public GenericDetailView()
{
InitializeComponent ();
InitializeComponent();
for (int i = 0; i < 7; i++)
{
var b = new UXDivers.Artina.Shared.Button
{
Style = Application.Current.Resources ["SquaredButtonStyle"] as Style,
Style = Application.Current.Resources["SquaredButtonStyle"] as Style,
VerticalOptions = LayoutOptions.FillAndExpand,
HorizontalOptions = LayoutOptions.Fill,
FontSize = 22,
Text = DayNames [i],
Text = DayNames[i],
};
b.Clicked += OnDayClicked;
buttonList.Children.Add (b, i, 0);
buttonList.Children.Add(b, i, 0);
}
}
/// <summary>
/// Llamado cuando cambia el contexto asociado
/// </summary>
protected override void OnBindingContextChanged ()
protected override void OnBindingContextChanged()
{
base.OnBindingContextChanged ();
base.OnBindingContextChanged();
// Le decimos al ViewModel que queremos ser informados cuando cambie
// cualquiera de sus propiedades
......@@ -52,39 +51,38 @@ namespace inutralia.Views
/// <summary>
/// Llamado cuando cambia el valor de una propiedad del ViewModel
/// </summary>
private void OnViewModelPropertyChanged (object sender, System.ComponentModel.PropertyChangedEventArgs e)
private void OnViewModelPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
// Cuando cambia el índice del día seleccionado, cambiamos el color de los botones
if(e.PropertyName == "Index")
if (e.PropertyName == "Index")
{
// Coger el botón seleccionado
View but = buttonList.Children [ViewModel.Index] as View;
View but = buttonList.Children[ViewModel.Index] as View;
// Poner el fondo del seleccionado a ComplementColor y el resto a AccentColor
foreach (var b in buttonList.Children)
b.BackgroundColor = (Color) Application.Current.Resources [b == but ? "ComplementColor" : "BaseTextColor"];
b.BackgroundColor = (Color)Application.Current.Resources[b == but ? "ComplementColor" : "BaseTextColor"];
} //endif
}
/// <summary>
/// Llamado cuando se pulsa un botón de día
/// </summary>
private void OnDayClicked (object sender, EventArgs e)
private void OnDayClicked(object sender, EventArgs e)
{
// Cambiar el índice del día seleccionado al del botón
ViewModel.Index = buttonList.Children.IndexOf (sender as View);
ViewModel.Index = buttonList.Children.IndexOf(sender as View);
}
/// <summary>
/// Llamado cuando esta vista se muestra
/// </summary>
protected override async void OnAppearing()
{
base.OnAppearing();
{
base.OnAppearing();
// Decirle al ViewModel que refresque sus datos
await ViewModel.RefreshData();
}
await ViewModel.RefreshData();
}
}
}
......@@ -19,10 +19,9 @@
xmlns:artina="clr-namespace:UXDivers.Artina.Shared;assembly=UXDivers.Artina.Shared"
x:Class="inutralia.Views.GenericListView"
BackgroundColor="White"
Title="Menus Saludables"
>
Title="Menus Saludables">
<StackLayout VerticalOptions="FillAndExpand">
<StackLayout VerticalOptions="FillAndExpand">
<!-- Este es el componente para el listado. Primero configura de dónde obtiene los datos
y el método al que llamar cuando se hace tap en un elemento de la lista. Luego
......@@ -30,15 +29,13 @@
de memoria
-->
<ListView x:Name="ListView"
<ListView x:Name="ListView"
ItemsSource="{Binding Generics}"
ItemTapped="ItemTapped"
VerticalOptions="FillAndExpand"
SeparatorVisibility="None"
SeparatorColor="Transparent"
Footer=""
Footer=""
BackgroundColor="Transparent"
CachingStrategy="RecycleElement"
HasUnevenRows="false">
......@@ -47,14 +44,14 @@
<OnIdiom x:TypeArguments="x:Int32">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Int32"
iOS="115"
Android="105"/>
iOS="115"
Android="105"/>
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Int32"
iOS="163"
Android="195"/>
iOS="163"
Android="195"/>
</OnIdiom.Tablet>
</OnIdiom>
</ListView.RowHeight>
......@@ -63,37 +60,28 @@
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout
BackgroundColor="{Binding . , Converter={StaticResource ListBgConverter}, ConverterParameter={x:Reference ListView} }"
Spacing="20"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
Orientation="Horizontal" >
<Grid
BackgroundColor="#33000000"
WidthRequest="80"
HorizontalOptions="Start"
VerticalOptions="FillAndExpand">
<StackLayout BackgroundColor="{Binding . , Converter={StaticResource ListBgConverter}, ConverterParameter={x:Reference ListView} }"
Spacing="20"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
Orientation="Horizontal" >
<Grid BackgroundColor="#33000000" WidthRequest="80" HorizontalOptions="Start" VerticalOptions="FillAndExpand">
<Grid.WidthRequest>
<OnIdiom x:TypeArguments="x:Double"
Phone="80"
Tablet="100"/>
</Grid.WidthRequest>
<Label
Text="{ x:Static app:IoniciconsFont.IosListOutline }"
FontSize="40"
Style="{StaticResource FontIcon}"
HorizontalOptions="Center"
VerticalOptions="Center"
TextColor="White"
/>
<Label Text="{ x:Static app:IoniciconsFont.IosListOutline }"
FontSize="40"
Style="{StaticResource FontIcon}"
HorizontalOptions="Center"
VerticalOptions="Center"
TextColor="White" />
</Grid>
<StackLayout VerticalOptions="Center" Spacing="2" >
<Label Text="{Binding Title}"
FontSize="{artina:OnOrientationDouble
PortraitPhone=18,
......@@ -102,7 +90,6 @@
LandscapeTablet=30 }"
TextColor="{ DynamicResource InverseTextColor }" />
</StackLayout>
</StackLayout>
</ViewCell>
</DataTemplate>
......
......@@ -4,50 +4,47 @@ using Xamarin.Forms;
namespace inutralia.Views
{
public partial class GenericListView : ContentPage
{
// Accesor al ViewModel
protected GenericListViewModel ViewModel => BindingContext as GenericListViewModel;
public GenericListView()
{
InitializeComponent();
BindingContext = new GenericListViewModel ();
}
/// <summary>
/// Método llamado al hacer tap en un elemento de la lista. Navega a la página de detalle
/// de la notificación seleccionada
/// </summary>
/// <param name="sender">La ListView</param>
/// <param name="e">Argumentos del evento</param>
void ItemTapped(object sender, ItemTappedEventArgs e)
{
// e.Item apunta a la notificación seleccionada. A partir de ella se crea su ViewModel
// y con él se crea la página de detalle y se navega a ella
Navigation.PushAsync(
new GenericDetailView()
{
BindingContext = new GenericDetailViewModel((Generic)e.Item)
}
);
// Deselecciona el item para que no le cambie el color de fondo
((ListView)sender).SelectedItem = null;
}
/// <summary>
/// Método llamado cada vez que una página pasa a ser visible
/// </summary>
protected override async void OnAppearing()
{
base.OnAppearing();
// Le decimos al ViewModel que realice la primera carga del listado
await ViewModel.ExecuteLoadGenericsCommand();
}
}
public partial class GenericListView : ContentPage
{
// Accesor al ViewModel
protected GenericListViewModel ViewModel => BindingContext as GenericListViewModel;
public GenericListView()
{
InitializeComponent();
BindingContext = new GenericListViewModel();
}
/// <summary>
/// Método llamado al hacer tap en un elemento de la lista. Navega a la página de detalle
/// de la notificación seleccionada
/// </summary>
/// <param name="sender">La ListView</param>
/// <param name="e">Argumentos del evento</param>
void ItemTapped(object sender, ItemTappedEventArgs e)
{
// e.Item apunta a la notificación seleccionada. A partir de ella se crea su ViewModel
// y con él se crea la página de detalle y se navega a ella
Navigation.PushAsync(
new GenericDetailView()
{
BindingContext = new GenericDetailViewModel((Generic)e.Item)
}
);
// Deselecciona el item para que no le cambie el color de fondo
((ListView)sender).SelectedItem = null;
}
/// <summary>
/// Método llamado cada vez que una página pasa a ser visible
/// </summary>
protected override async void OnAppearing()
{
base.OnAppearing();
// Le decimos al ViewModel que realice la primera carga del listado
await ViewModel.ExecuteLoadGenericsCommand();
}
}
}
......@@ -4,13 +4,9 @@
x:Class="inutralia.Views.RecomendationView"
Title="Resto del día">
<WebView
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
x:Name="webview">
<WebView.Source>
<HtmlWebViewSource Html="{Binding resume}}" />
</WebView.Source>
</WebView>
<WebView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" x:Name="webview">
<WebView.Source>
<HtmlWebViewSource Html="{Binding resume}" />
</WebView.Source>
</WebView>
</ContentPage>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace inutralia.Views
{
[XamlCompilation (XamlCompilationOptions.Compile)]
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class RecomendationView : ContentPage
{
public RecomendationView ()
public RecomendationView()
{
InitializeComponent ();
InitializeComponent();
}
/// <summary>
......@@ -23,7 +17,6 @@ namespace inutralia.Views
protected override async void OnAppearing()
{
base.OnAppearing();
}
}
}
......@@ -262,9 +262,7 @@
<None Include="SampleData.json" />
<None Include="Gorilla.json" />
</ItemGroup>
<ItemGroup>
<Folder Include="Models\" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<EmbeddedResource Include="Views\Recipe\ItemList\RecipeItemTemplate.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment