New Android Bar renderer
Integration with Order API Changes related with Auth
This commit is contained in:
parent
d292646f3c
commit
18299d40e0
@ -9,16 +9,27 @@ namespace eShopOnContainers
|
||||
{
|
||||
public partial class App : Application
|
||||
{
|
||||
public bool UseMockServices { get; set; }
|
||||
|
||||
public App()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
InitApp();
|
||||
|
||||
if (Device.OS == TargetPlatform.Windows)
|
||||
{
|
||||
InitNavigation();
|
||||
}
|
||||
}
|
||||
|
||||
private void InitApp()
|
||||
{
|
||||
UseMockServices = true;
|
||||
|
||||
ViewModelLocator.Instance.UpdateDependencies(UseMockServices);
|
||||
}
|
||||
|
||||
private Task InitNavigation()
|
||||
{
|
||||
var navigationService = ViewModelLocator.Instance.Resolve<INavigationService>();
|
||||
|
@ -6,7 +6,7 @@ namespace eShopOnContainers.Core.Converters
|
||||
{
|
||||
public class ItemsToHeightConverter : IValueConverter
|
||||
{
|
||||
private const int ItemHeight = 144;
|
||||
private const int ItemHeight = 156;
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
|
@ -6,6 +6,8 @@
|
||||
|
||||
public const string CatalogEndpoint = "http://104.40.62.65:5101/";
|
||||
|
||||
public const string OrdersEndpoint = "http://104.40.62.65:5102/";
|
||||
|
||||
public const string BasketEndpoint = "http://104.40.62.65:5103/";
|
||||
|
||||
public const string IdentityEndpoint = "http://104.40.62.65:5105/connect/authorize";
|
||||
|
@ -7,7 +7,7 @@ namespace eShopOnContainers.Core.Helpers
|
||||
public static ObservableCollection<int> GetNumericList(int count = 100)
|
||||
{
|
||||
var result = new ObservableCollection<int>();
|
||||
for (int i = 0; i < count; i++)
|
||||
for (int i = 1; i < count; i++)
|
||||
{
|
||||
result.Add(i);
|
||||
}
|
||||
|
@ -0,0 +1,41 @@
|
||||
using Plugin.Settings;
|
||||
using Plugin.Settings.Abstractions;
|
||||
|
||||
namespace eShopOnContainers.Core.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
|
||||
{
|
||||
get
|
||||
{
|
||||
return CrossSettings.Current;
|
||||
}
|
||||
}
|
||||
|
||||
#region Setting Constants
|
||||
|
||||
private const string AccessToken = "access_token";
|
||||
private static readonly string AccessTokenDefault = string.Empty;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public static string AuthAccessToken
|
||||
{
|
||||
get
|
||||
{
|
||||
return AppSettings.GetValueOrDefault<string>(AccessToken, AccessTokenDefault);
|
||||
}
|
||||
set
|
||||
{
|
||||
AppSettings.AddOrUpdateValue<string>(AccessToken, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
namespace eShopOnContainers.Core.Models.Orders
|
||||
{
|
||||
public class CardType
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
@ -19,30 +19,44 @@ namespace eShopOnContainers.Core.Services.Catalog
|
||||
|
||||
public async Task<ObservableCollection<CatalogItem>> FilterAsync(int catalogBrandId, int catalogTypeId)
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.CatalogEndpoint);
|
||||
try
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.CatalogEndpoint);
|
||||
|
||||
builder.Path = string.Format("api/v1/catalog/items/type/{0}/brand/{1}", catalogTypeId, catalogBrandId);
|
||||
builder.Path = string.Format("api/v1/catalog/items/type/{0}/brand/{1}", catalogTypeId, catalogBrandId);
|
||||
|
||||
string uri = builder.ToString();
|
||||
string uri = builder.ToString();
|
||||
|
||||
CatalogRoot catalog =
|
||||
await _requestProvider.GetAsync<CatalogRoot>(uri);
|
||||
CatalogRoot catalog =
|
||||
await _requestProvider.GetAsync<CatalogRoot>(uri);
|
||||
|
||||
return catalog?.Data?.ToObservableCollection();
|
||||
return catalog?.Data?.ToObservableCollection();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<CatalogItem>();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ObservableCollection<CatalogItem>> GetCatalogAsync()
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.CatalogEndpoint);
|
||||
try
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.CatalogEndpoint);
|
||||
|
||||
builder.Path = "api/v1/catalog/items";
|
||||
builder.Path = "api/v1/catalog/items";
|
||||
|
||||
string uri = builder.ToString();
|
||||
string uri = builder.ToString();
|
||||
|
||||
CatalogRoot catalog =
|
||||
await _requestProvider.GetAsync<CatalogRoot>(uri);
|
||||
CatalogRoot catalog =
|
||||
await _requestProvider.GetAsync<CatalogRoot>(uri);
|
||||
|
||||
return catalog?.Data?.ToObservableCollection();
|
||||
return catalog?.Data?.ToObservableCollection();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<CatalogItem>();
|
||||
}
|
||||
}
|
||||
|
||||
public Task<CatalogItem> GetCatalogItemAsync(string id)
|
||||
@ -52,30 +66,44 @@ namespace eShopOnContainers.Core.Services.Catalog
|
||||
|
||||
public async Task<ObservableCollection<CatalogBrand>> GetCatalogBrandAsync()
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.CatalogEndpoint);
|
||||
try
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.CatalogEndpoint);
|
||||
|
||||
builder.Path = "api/v1/catalog/catalogbrands";
|
||||
builder.Path = "api/v1/catalog/catalogbrands";
|
||||
|
||||
string uri = builder.ToString();
|
||||
string uri = builder.ToString();
|
||||
|
||||
IEnumerable<CatalogBrand> brands =
|
||||
await _requestProvider.GetAsync<IEnumerable<CatalogBrand>>(uri);
|
||||
IEnumerable<CatalogBrand> brands =
|
||||
await _requestProvider.GetAsync<IEnumerable<CatalogBrand>>(uri);
|
||||
|
||||
return brands?.ToObservableCollection();
|
||||
return brands?.ToObservableCollection();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<CatalogBrand>();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ObservableCollection<CatalogType>> GetCatalogTypeAsync()
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.CatalogEndpoint);
|
||||
try
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.CatalogEndpoint);
|
||||
|
||||
builder.Path = "api/v1/catalog/catalogtypes";
|
||||
builder.Path = "api/v1/catalog/catalogtypes";
|
||||
|
||||
string uri = builder.ToString();
|
||||
string uri = builder.ToString();
|
||||
|
||||
IEnumerable<CatalogType> types =
|
||||
await _requestProvider.GetAsync<IEnumerable<CatalogType>>(uri);
|
||||
IEnumerable<CatalogType> types =
|
||||
await _requestProvider.GetAsync<IEnumerable<CatalogType>>(uri);
|
||||
|
||||
return types?.ToObservableCollection();
|
||||
return types?.ToObservableCollection();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<CatalogType>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
public interface IIdentityService
|
||||
{
|
||||
string CreateAuthorizeRequest();
|
||||
string CreateLogoutRequest(string token);
|
||||
string DecodeToken(string token);
|
||||
}
|
||||
}
|
||||
}
|
@ -33,6 +33,14 @@ namespace eShopOnContainers.Core.Services.Identity
|
||||
return authorizeUri;
|
||||
}
|
||||
|
||||
public string CreateLogoutRequest(string token)
|
||||
{
|
||||
return string.Format("{0}?id_token_hint={1}&post_logout_redirect_uri={2}",
|
||||
GlobalSetting.LogoutEndpoint,
|
||||
token,
|
||||
GlobalSetting.IdentityCallback);
|
||||
}
|
||||
|
||||
public string DecodeToken(string token)
|
||||
{
|
||||
var parts = token.Split('.');
|
||||
|
@ -1,4 +1,5 @@
|
||||
using eShopOnContainers.Core.ViewModels;
|
||||
using eShopOnContainers.Core.Helpers;
|
||||
using eShopOnContainers.Core.ViewModels;
|
||||
using eShopOnContainers.Core.Views;
|
||||
using eShopOnContainers.ViewModels.Base;
|
||||
using System;
|
||||
@ -29,7 +30,10 @@ namespace eShopOnContainers.Services
|
||||
|
||||
public Task InitializeAsync()
|
||||
{
|
||||
return NavigateToAsync<LoginViewModel>();
|
||||
if(string.IsNullOrEmpty(Settings.AuthAccessToken))
|
||||
return NavigateToAsync<LoginViewModel>();
|
||||
else
|
||||
return NavigateToAsync<MainViewModel>();
|
||||
}
|
||||
|
||||
public Task NavigateToAsync<TViewModel>() where TViewModel : ViewModelBase
|
||||
@ -67,7 +71,7 @@ namespace eShopOnContainers.Services
|
||||
|
||||
public virtual Task RemoveLastFromBackStackAsync()
|
||||
{
|
||||
var mainPage = CurrentApplication.MainPage as CustomNavigationPage;
|
||||
var mainPage = CurrentApplication.MainPage as CustomNavigationView;
|
||||
|
||||
if (mainPage != null)
|
||||
{
|
||||
@ -80,7 +84,7 @@ namespace eShopOnContainers.Services
|
||||
|
||||
public virtual Task RemoveBackStackAsync()
|
||||
{
|
||||
var mainPage = CurrentApplication.MainPage as CustomNavigationPage;
|
||||
var mainPage = CurrentApplication.MainPage as CustomNavigationView;
|
||||
|
||||
if (mainPage != null)
|
||||
{
|
||||
@ -100,11 +104,11 @@ namespace eShopOnContainers.Services
|
||||
|
||||
if (page is LoginView)
|
||||
{
|
||||
CurrentApplication.MainPage = new CustomNavigationPage(page);
|
||||
CurrentApplication.MainPage = new CustomNavigationView(page);
|
||||
}
|
||||
else
|
||||
{
|
||||
var navigationPage = CurrentApplication.MainPage as CustomNavigationPage;
|
||||
var navigationPage = CurrentApplication.MainPage as CustomNavigationView;
|
||||
|
||||
if (navigationPage != null)
|
||||
{
|
||||
@ -112,7 +116,7 @@ namespace eShopOnContainers.Services
|
||||
}
|
||||
else
|
||||
{
|
||||
CurrentApplication.MainPage = new CustomNavigationPage(page);
|
||||
CurrentApplication.MainPage = new CustomNavigationView(page);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace eShopOnContainers.Core.Services.Order
|
||||
{
|
||||
public interface IOrderService
|
||||
{
|
||||
Task CreateOrderAsync(Models.Orders.Order newOrder);
|
||||
Task<ObservableCollection<Models.Orders.Order>> GetOrdersAsync();
|
||||
Task<Models.Orders.Order> GetOrderAsync(int orderId);
|
||||
Task<ObservableCollection<Models.Orders.CardType>> GetCardTypesAsync();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
using eShopOnContainers.Core.Extensions;
|
||||
using eShopOnContainers.Core.Models.Orders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace eShopOnContainers.Core.Services.Order
|
||||
{
|
||||
public class OrderMockService : IOrderService
|
||||
{
|
||||
private List<Models.Orders.Order> MockOrders = new List<Models.Orders.Order>()
|
||||
{
|
||||
new Models.Orders.Order { SequenceNumber = 123, Total = 56.40M, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = MockOrderItems },
|
||||
new Models.Orders.Order { SequenceNumber = 132, Total = 56.40M, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = MockOrderItems },
|
||||
new Models.Orders.Order { SequenceNumber = 231, Total = 56.40M, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = MockOrderItems },
|
||||
};
|
||||
|
||||
private static List<OrderItem> MockOrderItems = new List<OrderItem>()
|
||||
{
|
||||
new OrderItem { OrderId = Guid.NewGuid(), ProductId = "1", Discount = 15, ProductName = ".NET Bot Blue Sweatshirt (M)", Quantity = 1, UnitPrice = 16.50M },
|
||||
new OrderItem { OrderId = Guid.NewGuid(), ProductId = "3", Discount = 0, ProductName = ".NET Bot Black Sweatshirt (M)", Quantity = 2, UnitPrice = 19.95M }
|
||||
};
|
||||
|
||||
private static List<CardType> MockCardTypes = new List<CardType>()
|
||||
{
|
||||
new CardType { Id = 1, Name = "Amex" },
|
||||
new CardType { Id = 2, Name = "Visa" },
|
||||
new CardType { Id = 3, Name = "MasterCard" },
|
||||
};
|
||||
|
||||
public async Task CreateOrderAsync(Models.Orders.Order newOrder)
|
||||
{
|
||||
await Task.Delay(500);
|
||||
|
||||
MockOrders.Insert(0, newOrder);
|
||||
}
|
||||
|
||||
public async Task<ObservableCollection<Models.Orders.Order>> GetOrdersAsync()
|
||||
{
|
||||
await Task.Delay(500);
|
||||
|
||||
return MockOrders.ToObservableCollection();
|
||||
}
|
||||
|
||||
public async Task<Models.Orders.Order> GetOrderAsync(int orderId)
|
||||
{
|
||||
await Task.Delay(500);
|
||||
|
||||
return MockOrders.FirstOrDefault(o => o.SequenceNumber == orderId);
|
||||
}
|
||||
|
||||
public async Task<ObservableCollection<CardType>> GetCardTypesAsync()
|
||||
{
|
||||
await Task.Delay(500);
|
||||
|
||||
return MockCardTypes.ToObservableCollection();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
using eShopOnContainers.Core.Services.RequestProvider;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace eShopOnContainers.Core.Services.Order
|
||||
{
|
||||
public class OrderService : IOrderService
|
||||
{
|
||||
private readonly IRequestProvider _requestProvider;
|
||||
|
||||
public OrderService(IRequestProvider requestProvider)
|
||||
{
|
||||
_requestProvider = requestProvider;
|
||||
}
|
||||
|
||||
public async Task CreateOrderAsync(Models.Orders.Order newOrder)
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.OrdersEndpoint);
|
||||
|
||||
builder.Path = "api/v1/orders/new";
|
||||
|
||||
string uri = builder.ToString();
|
||||
|
||||
await _requestProvider.PostAsync(uri, newOrder);
|
||||
}
|
||||
|
||||
public async Task<ObservableCollection<Models.Orders.Order>> GetOrdersAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.OrdersEndpoint);
|
||||
|
||||
builder.Path = "api/v1/orders";
|
||||
|
||||
string uri = builder.ToString();
|
||||
|
||||
ObservableCollection<Models.Orders.Order> orders =
|
||||
await _requestProvider.GetAsync<ObservableCollection<Models.Orders.Order>>(uri);
|
||||
|
||||
return orders;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<Models.Orders.Order>();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<Models.Orders.Order> GetOrderAsync(int orderId)
|
||||
{
|
||||
try
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.OrdersEndpoint);
|
||||
|
||||
builder.Path = string.Format("api/v1/orders/{0}", orderId);
|
||||
|
||||
string uri = builder.ToString();
|
||||
|
||||
Models.Orders.Order order =
|
||||
await _requestProvider.GetAsync<Models.Orders.Order>(uri);
|
||||
|
||||
return order;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new Models.Orders.Order();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ObservableCollection<Models.Orders.CardType>> GetCardTypesAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
UriBuilder builder = new UriBuilder(GlobalSetting.OrdersEndpoint);
|
||||
|
||||
builder.Path = "api/v1/orders/cardtypes";
|
||||
|
||||
string uri = builder.ToString();
|
||||
|
||||
ObservableCollection<Models.Orders.CardType> cardTypes =
|
||||
await _requestProvider.GetAsync<ObservableCollection<Models.Orders.CardType>>(uri);
|
||||
|
||||
return cardTypes;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new ObservableCollection<Models.Orders.CardType>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,12 +1,9 @@
|
||||
using eShopOnContainers.Core.Models.Orders;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace eShopOnContainers.Core.Services.User
|
||||
{
|
||||
public interface IUserService
|
||||
{
|
||||
Task<Models.User.User> GetUserAsync();
|
||||
Task<List<Order>> GetOrdersAsync();
|
||||
}
|
||||
}
|
@ -1,7 +1,4 @@
|
||||
using eShopOnContainers.Core.Models.Orders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace eShopOnContainers.Core.Services.User
|
||||
{
|
||||
@ -18,31 +15,12 @@ namespace eShopOnContainers.Core.Services.User
|
||||
Country = "United States"
|
||||
};
|
||||
|
||||
private List<Order> MockOrders = new List<Order>()
|
||||
{
|
||||
new Order { SequenceNumber = 123, Total = 56.40M, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = MockOrderItems },
|
||||
new Order { SequenceNumber = 132, Total = 56.40M, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = MockOrderItems },
|
||||
new Order { SequenceNumber = 231, Total = 56.40M, OrderDate = DateTime.Now, Status = OrderStatus.Delivered, OrderItems = MockOrderItems },
|
||||
};
|
||||
|
||||
private static List<OrderItem> MockOrderItems = new List<OrderItem>()
|
||||
{
|
||||
new OrderItem { OrderId = Guid.NewGuid(), ProductId = "1", Discount = 15, ProductName = ".NET Bot Blue Sweatshirt (M)", Quantity = 1, UnitPrice = 16.50M },
|
||||
new OrderItem { OrderId = Guid.NewGuid(), ProductId = "3", Discount = 0, ProductName = ".NET Bot Black Sweatshirt (M)", Quantity = 2, UnitPrice = 19.95M }
|
||||
};
|
||||
|
||||
|
||||
public async Task<Models.User.User> GetUserAsync()
|
||||
{
|
||||
await Task.Delay(500);
|
||||
|
||||
return MockUser;
|
||||
}
|
||||
|
||||
public async Task<List<Order>> GetOrdersAsync()
|
||||
{
|
||||
await Task.Delay(500);
|
||||
|
||||
return MockOrders;
|
||||
}
|
||||
}
|
||||
}
|
@ -15,6 +15,9 @@
|
||||
public const string Filter = "Filter";
|
||||
|
||||
// Change selected Tab programmatically
|
||||
public const string ChangeTab = "ChangeTab";
|
||||
public const string ChangeTab = "ChangeTab";
|
||||
|
||||
// Logout
|
||||
public const string Logout = "Logout";
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ using eShopOnContainers.Core.Services.User;
|
||||
using eShopOnContainers.Core.Services.RequestProvider;
|
||||
using eShopOnContainers.Core.Services.Basket;
|
||||
using eShopOnContainers.Core.Services.Identity;
|
||||
using eShopOnContainers.Core.Services.Order;
|
||||
|
||||
namespace eShopOnContainers.ViewModels.Base
|
||||
{
|
||||
@ -55,28 +56,29 @@ namespace eShopOnContainers.ViewModels.Base
|
||||
_unityContainer.RegisterType<SettingsViewModel>();
|
||||
}
|
||||
|
||||
public void UpdateServices(bool useMockServices)
|
||||
public void UpdateDependencies(bool useMockServices)
|
||||
{
|
||||
if (!useMockServices)
|
||||
if (useMockServices)
|
||||
{
|
||||
_unityContainer.RegisterInstance<ICatalogService>(new CatalogMockService());
|
||||
_unityContainer.RegisterInstance<IBasketService>(new BasketMockService());
|
||||
_unityContainer.RegisterInstance<IOrderService>(new OrderMockService());
|
||||
_unityContainer.RegisterInstance<IUserService>(new UserMockService());
|
||||
|
||||
UseMockService = false;
|
||||
UseMockService = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
var requestProvider = Resolve<IRequestProvider>();
|
||||
_unityContainer.RegisterInstance<ICatalogService>(new CatalogService(requestProvider));
|
||||
_unityContainer.RegisterInstance<IBasketService>(new BasketService(requestProvider));
|
||||
_unityContainer.RegisterInstance<IOrderService>(new OrderService(requestProvider));
|
||||
_unityContainer.RegisterInstance<IUserService>(new UserMockService());
|
||||
|
||||
UseMockService = true;
|
||||
UseMockService = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public T Resolve<T>()
|
||||
{
|
||||
return _unityContainer.Resolve<T>();
|
||||
|
@ -12,6 +12,7 @@ using System.Linq;
|
||||
using eShopOnContainers.Core.Models.Basket;
|
||||
using System.Collections.Generic;
|
||||
using eShopOnContainers.Core.Services.Basket;
|
||||
using eShopOnContainers.Core.Services.Order;
|
||||
|
||||
namespace eShopOnContainers.Core.ViewModels
|
||||
{
|
||||
@ -23,12 +24,15 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
|
||||
private IUserService _userService;
|
||||
private IBasketService _basketService;
|
||||
private IOrderService _orderService;
|
||||
|
||||
public CheckoutViewModel(IUserService userService,
|
||||
IBasketService basketService)
|
||||
IBasketService basketService,
|
||||
IOrderService orderService)
|
||||
{
|
||||
_basketService = basketService;
|
||||
_userService = userService;
|
||||
_orderService = orderService;
|
||||
}
|
||||
|
||||
public ObservableCollection<BasketItem> OrderItems
|
||||
@ -90,6 +94,7 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
|
||||
private async void Checkout()
|
||||
{
|
||||
await _orderService.CreateOrderAsync(Order);
|
||||
await _basketService.ClearBasketAsync(User.GuidUser);
|
||||
|
||||
await NavigationService.NavigateToAsync<MainViewModel>(new TabParameter { TabIndex = 1 });
|
||||
|
@ -1,6 +1,8 @@
|
||||
using eShopOnContainers.Core.Services.Identity;
|
||||
using eShopOnContainers.Core.Helpers;
|
||||
using eShopOnContainers.Core.Services.Identity;
|
||||
using eShopOnContainers.Core.Services.OpenUrl;
|
||||
using eShopOnContainers.Core.Validations;
|
||||
using eShopOnContainers.Core.ViewModels.Base;
|
||||
using eShopOnContainers.ViewModels.Base;
|
||||
using IdentityModel.Client;
|
||||
using System;
|
||||
@ -17,7 +19,7 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
private ValidatableObject<string> _password;
|
||||
private bool _isMock;
|
||||
private bool _isValid;
|
||||
private string _loginUrl;
|
||||
private string _authUrl;
|
||||
|
||||
private IOpenUrlService _openUrlService;
|
||||
private IIdentityService _identityService;
|
||||
@ -31,6 +33,8 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
_userName = new ValidatableObject<string>();
|
||||
_password = new ValidatableObject<string>();
|
||||
|
||||
IsMock = ViewModelLocator.Instance.UseMockService;
|
||||
|
||||
AddValidations();
|
||||
}
|
||||
|
||||
@ -90,18 +94,18 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
{
|
||||
get
|
||||
{
|
||||
return _loginUrl;
|
||||
return _authUrl;
|
||||
}
|
||||
set
|
||||
{
|
||||
_loginUrl = value;
|
||||
_authUrl = value;
|
||||
RaisePropertyChanged(() => LoginUrl);
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand MockSignInCommand => new Command(MockSignInAsync);
|
||||
|
||||
public ICommand SignInCommand => new Command(SignInAsync);
|
||||
public ICommand SignInCommand => new Command(async () => await SignInAsync());
|
||||
|
||||
public ICommand RegisterCommand => new Command(Register);
|
||||
|
||||
@ -109,7 +113,10 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
|
||||
public override Task InitializeAsync(object navigationData)
|
||||
{
|
||||
LoginUrl = _identityService.CreateAuthorizeRequest();
|
||||
MessagingCenter.Subscribe<ProfileViewModel>(this, MessengerKeys.Logout, (sender) =>
|
||||
{
|
||||
Logout();
|
||||
});
|
||||
|
||||
return base.InitializeAsync(navigationData);
|
||||
}
|
||||
@ -148,12 +155,14 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
IsBusy = false;
|
||||
}
|
||||
|
||||
private async void SignInAsync()
|
||||
private async Task SignInAsync()
|
||||
{
|
||||
IsBusy = true;
|
||||
|
||||
await Task.Delay(500);
|
||||
|
||||
LoginUrl = _identityService.CreateAuthorizeRequest();
|
||||
|
||||
IsValid = true;
|
||||
|
||||
IsBusy = false;
|
||||
@ -164,6 +173,19 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
_openUrlService.OpenUrl(GlobalSetting.RegisterWebsite);
|
||||
}
|
||||
|
||||
private void Logout()
|
||||
{
|
||||
var token = Settings.AuthAccessToken;
|
||||
var logoutRequest = _identityService.CreateLogoutRequest(token);
|
||||
|
||||
if(string.IsNullOrEmpty(logoutRequest))
|
||||
{
|
||||
IsValid = false;
|
||||
LoginUrl = logoutRequest;
|
||||
Settings.AuthAccessToken = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
private async void NavigateAsync(string url)
|
||||
{
|
||||
if (url.Contains(GlobalSetting.IdentityCallback))
|
||||
@ -177,6 +199,8 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
|
||||
if(decodedTokens != null)
|
||||
{
|
||||
Settings.AuthAccessToken = decodedTokens;
|
||||
|
||||
await NavigationService.NavigateToAsync<MainViewModel>();
|
||||
await NavigationService.RemoveLastFromBackStackAsync();
|
||||
}
|
||||
@ -198,4 +222,4 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
_password.Validations.Add(new IsNotNullOrEmptyRule<string> { ValidationMessage = "Password should not be empty" });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
using eShopOnContainers.Core.Extensions;
|
||||
using eShopOnContainers.Core.Models.Orders;
|
||||
using eShopOnContainers.Core.Services.User;
|
||||
using eShopOnContainers.Core.Services.Order;
|
||||
using eShopOnContainers.Core.ViewModels.Base;
|
||||
using eShopOnContainers.ViewModels.Base;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Threading.Tasks;
|
||||
@ -13,11 +14,11 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
{
|
||||
private ObservableCollection<Order> _orders;
|
||||
|
||||
private IUserService _userService;
|
||||
private IOrderService _orderService;
|
||||
|
||||
public ProfileViewModel(IUserService userService)
|
||||
public ProfileViewModel(IOrderService orderService)
|
||||
{
|
||||
_userService = userService;
|
||||
_orderService = orderService;
|
||||
}
|
||||
|
||||
public ObservableCollection<Order> Orders
|
||||
@ -38,7 +39,7 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
{
|
||||
IsBusy = true;
|
||||
|
||||
var orders = await _userService.GetOrdersAsync();
|
||||
var orders = await _orderService.GetOrdersAsync();
|
||||
Orders = orders.ToObservableCollection();
|
||||
|
||||
IsBusy = false;
|
||||
@ -48,6 +49,7 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
{
|
||||
IsBusy = true;
|
||||
|
||||
MessagingCenter.Send(this, MessengerKeys.Logout);
|
||||
await NavigationService.NavigateToAsync<LoginViewModel>();
|
||||
await NavigationService.RemoveBackStackAsync();
|
||||
|
||||
|
@ -9,11 +9,11 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
{
|
||||
private string _title;
|
||||
private string _description;
|
||||
private bool _useMockServices;
|
||||
private bool _useAzureServices;
|
||||
|
||||
public SettingsViewModel()
|
||||
{
|
||||
UseMockServices = ViewModelLocator.Instance.UseMockService;
|
||||
UseAzureServices = !ViewModelLocator.Instance.UseMockService;
|
||||
}
|
||||
|
||||
public string Title
|
||||
@ -36,13 +36,13 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public bool UseMockServices
|
||||
public bool UseAzureServices
|
||||
{
|
||||
get { return _useMockServices; }
|
||||
get { return _useAzureServices; }
|
||||
set
|
||||
{
|
||||
_useMockServices = value;
|
||||
RaisePropertyChanged(() => UseMockServices);
|
||||
_useAzureServices = value;
|
||||
RaisePropertyChanged(() => UseAzureServices);
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
|
||||
private void MockServices()
|
||||
{
|
||||
ViewModelLocator.Instance.UpdateServices(UseMockServices);
|
||||
ViewModelLocator.Instance.UpdateDependencies(!UseAzureServices);
|
||||
UpdateInfo();
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ namespace eShopOnContainers.Core.ViewModels
|
||||
|
||||
private void UpdateInfo()
|
||||
{
|
||||
if (!UseMockServices)
|
||||
if (!UseAzureServices)
|
||||
{
|
||||
Title = "Use Mock Services";
|
||||
Description = "Mock Services are simulated objects that mimic the behavior of real services in controlled ways";
|
||||
|
@ -58,7 +58,8 @@
|
||||
</Grid.RowDefinitions>
|
||||
<!-- FILTERS -->
|
||||
<Grid
|
||||
BackgroundColor="{StaticResource LightGreenColor}">
|
||||
BackgroundColor="{StaticResource LightGreenColor}"
|
||||
IsEnabled="{Binding Products.Count, Converter={StaticResource CountToBoolConverter}}">
|
||||
<Label
|
||||
Text="FILTER"
|
||||
Style="{StaticResource FilterLabelStyle}"/>
|
||||
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<NavigationPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="eShopOnContainers.Core.Views.CustomNavigationPage"
|
||||
BarBackgroundColor="{StaticResource GreenColor}"
|
||||
BarTextColor="{StaticResource WhiteColor}"
|
||||
BackgroundColor="Transparent">
|
||||
</NavigationPage>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<NavigationPage
|
||||
xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="eShopOnContainers.Core.Views.CustomNavigationView"
|
||||
BarBackgroundColor="{StaticResource GreenColor}"
|
||||
BarTextColor="{StaticResource WhiteColor}"
|
||||
BackgroundColor="Transparent">
|
||||
</NavigationPage>
|
@ -2,14 +2,14 @@
|
||||
|
||||
namespace eShopOnContainers.Core.Views
|
||||
{
|
||||
public partial class CustomNavigationPage : NavigationPage
|
||||
public partial class CustomNavigationView : NavigationPage
|
||||
{
|
||||
public CustomNavigationPage() : base()
|
||||
public CustomNavigationView() : base()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public CustomNavigationPage(Page root) : base(root)
|
||||
public CustomNavigationView(Page root) : base(root)
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
@ -4,8 +4,13 @@
|
||||
x:Class="eShopOnContainers.Core.Views.LoginView"
|
||||
xmlns:animations="clr-namespace:eShopOnContainers.Core.Animations;assembly=eShopOnContainers.Core"
|
||||
xmlns:triggers="clr-namespace:eShopOnContainers.Core.Triggers;assembly=eShopOnContainers.Core"
|
||||
xmlns:behaviors="clr-namespace:eShopOnContainers.Core.Behaviors;assembly=eShopOnContainers.Core"
|
||||
Title="eShop on Containers">
|
||||
xmlns:behaviors="clr-namespace:eShopOnContainers.Core.Behaviors;assembly=eShopOnContainers.Core">
|
||||
<ContentPage.Title>
|
||||
<OnPlatform
|
||||
x:TypeArguments="x:String"
|
||||
iOS="eShop on Containers"
|
||||
WinPhone="eShop on Containers"/>
|
||||
</ContentPage.Title>
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
|
||||
@ -56,11 +61,16 @@
|
||||
<Setter Property="HorizontalOptions"
|
||||
Value="FillAndExpand" />
|
||||
<Setter Property="VerticalOptions"
|
||||
Value="Center" />
|
||||
<Setter Property="Margin"
|
||||
Value="12" />
|
||||
Value="FillAndExpand" />
|
||||
</Style>
|
||||
|
||||
|
||||
<Style x:Key="RegisterPanelStyle"
|
||||
TargetType="{x:Type Grid}"
|
||||
BasedOn="{StaticResource LoginPanelStyle}">
|
||||
<Setter Property="BackgroundColor"
|
||||
Value="{StaticResource BlackColor}" />
|
||||
</Style>
|
||||
|
||||
<animations:StoryBoard
|
||||
x:Key="LoginAnimation"
|
||||
Target="{x:Reference LoginPanel}">
|
||||
@ -68,7 +78,7 @@
|
||||
Direction="Up"
|
||||
Duration="1500" />
|
||||
</animations:StoryBoard>
|
||||
|
||||
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
<ContentPage.Triggers>
|
||||
@ -183,9 +193,42 @@
|
||||
</Grid>
|
||||
<!-- AUTH -->
|
||||
<Grid
|
||||
ColumnSpacing="0"
|
||||
RowSpacing="0"
|
||||
IsVisible="{Binding IsMock, Converter={StaticResource InverseBoolConverter}}">
|
||||
<!-- LOGIN BUTTON -->
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="60" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- BANNER -->
|
||||
<Image
|
||||
x:Name="Banner"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Aspect="AspectFill">
|
||||
<Image.Source>
|
||||
<OnPlatform
|
||||
x:TypeArguments="ImageSource"
|
||||
Android="banner.png"
|
||||
iOS="banner.png"
|
||||
WinPhone="Assets\banner.png"/>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
BackgroundColor="{StaticResource BlackColor}"
|
||||
Opacity="0.5"/>
|
||||
<!-- LOG IN BUTTON -->
|
||||
<Grid
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource LoginPanelStyle}">
|
||||
<Label
|
||||
Text="[ LOGIN ]"
|
||||
@ -196,11 +239,28 @@
|
||||
NumberOfTapsRequired="1" />
|
||||
</Grid.GestureRecognizers>
|
||||
</Grid>
|
||||
<!-- REGISTER BUTTON -->
|
||||
<Grid
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Style="{StaticResource RegisterPanelStyle}">
|
||||
<Label
|
||||
Text="[ REGISTER ]"
|
||||
Style="{StaticResource LoginButtonStyle}"/>
|
||||
<Grid.GestureRecognizers>
|
||||
<TapGestureRecognizer
|
||||
Command="{Binding RegisterCommand}"
|
||||
NumberOfTapsRequired="1" />
|
||||
</Grid.GestureRecognizers>
|
||||
</Grid>
|
||||
<!-- WEBVIEW -->
|
||||
<AbsoluteLayout
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
IsVisible="{Binding IsValid}">
|
||||
<WebView
|
||||
x:Name="AuthWebView"
|
||||
Source="{Binding LoginUrl}"
|
||||
AbsoluteLayout.LayoutBounds="0, 0, 1, 1"
|
||||
AbsoluteLayout.LayoutFlags="All">
|
||||
|
@ -1,31 +1,59 @@
|
||||
using Xamarin.Forms;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace eShopOnContainers.Core.Views
|
||||
{
|
||||
public partial class LoginView : ContentPage
|
||||
{
|
||||
private bool _animate;
|
||||
|
||||
public LoginView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnAppearing()
|
||||
protected override async void OnAppearing()
|
||||
{
|
||||
base.OnAppearing();
|
||||
var content = this.Content;
|
||||
this.Content = null;
|
||||
this.Content = content;
|
||||
|
||||
AuthWebView.Navigating += OnAuthWebViewNavigating;
|
||||
_animate = true;
|
||||
await AnimateIn();
|
||||
}
|
||||
|
||||
protected override void OnDisappearing()
|
||||
{
|
||||
base.OnDisappearing();
|
||||
|
||||
AuthWebView.Navigating -= OnAuthWebViewNavigating;
|
||||
_animate = false;
|
||||
}
|
||||
|
||||
private void OnAuthWebViewNavigating(object sender, WebNavigatingEventArgs e)
|
||||
public async Task AnimateIn()
|
||||
{
|
||||
await AnimateItem(Banner, 10500);
|
||||
}
|
||||
|
||||
private async Task AnimateItem(View uiElement, uint duration)
|
||||
{
|
||||
try
|
||||
{
|
||||
while (_animate)
|
||||
{
|
||||
await uiElement.ScaleTo(1.05, duration, Easing.SinInOut);
|
||||
|
||||
await Task.WhenAll(
|
||||
uiElement.FadeTo(1, duration, Easing.SinInOut),
|
||||
uiElement.LayoutTo(new Rectangle(new Point(0, 0), new Size(uiElement.Width, uiElement.Height))),
|
||||
uiElement.FadeTo(.9, duration, Easing.SinInOut),
|
||||
uiElement.ScaleTo(1.15, duration, Easing.SinInOut)
|
||||
);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -6,8 +6,13 @@
|
||||
xmlns:controls="clr-namespace:eShopOnContainers.Core.Controls;assembly=eShopOnContainers.Core"
|
||||
BarBackgroundColor="{StaticResource DarkGreenColor}"
|
||||
BackgroundColor="{StaticResource BackgroundColor}"
|
||||
BarTextColor="{StaticResource WhiteColor}"
|
||||
Title="eShop on Containers">
|
||||
BarTextColor="{StaticResource WhiteColor}">
|
||||
<TabbedPage.Title>
|
||||
<OnPlatform
|
||||
x:TypeArguments="x:String"
|
||||
iOS="eShop on Containers"
|
||||
WinPhone="eShop on Containers"/>
|
||||
</TabbedPage.Title>
|
||||
<ContentPage.ToolbarItems>
|
||||
<ToolbarItem
|
||||
Command="{Binding SettingsCommand}"
|
||||
|
@ -78,26 +78,36 @@
|
||||
Grid.Row="0"
|
||||
Text="MY ORDERS"
|
||||
Style="{StaticResource MyOrdersLabelStyle}"/>
|
||||
<ListView
|
||||
Grid.Row="1"
|
||||
ItemsSource="{Binding Orders}"
|
||||
HasUnevenRows="True"
|
||||
SeparatorVisibility="None"
|
||||
CachingStrategy="RecycleElement">
|
||||
<ListView.Behaviors>
|
||||
<behaviors:EventToCommandBehavior
|
||||
EventName="ItemTapped"
|
||||
Command="{Binding OrderDetailCommand}"
|
||||
EventArgsConverter="{StaticResource ItemTappedEventArgsConverter}" />
|
||||
</ListView.Behaviors>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<templates:OrderTemplate />
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
<Grid
|
||||
Grid.Row="1">
|
||||
<Grid
|
||||
IsVisible="{Binding IsBusy, Converter={StaticResource InverseBoolConverter}}">
|
||||
<Label
|
||||
Text="NO ORDERS"
|
||||
IsVisible="{Binding Orders.Count, Converter={StaticResource InverseCountToBoolConverter}}"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center"/>
|
||||
</Grid>
|
||||
<ListView
|
||||
ItemsSource="{Binding Orders}"
|
||||
HasUnevenRows="True"
|
||||
SeparatorVisibility="None"
|
||||
CachingStrategy="RecycleElement">
|
||||
<ListView.Behaviors>
|
||||
<behaviors:EventToCommandBehavior
|
||||
EventName="ItemTapped"
|
||||
Command="{Binding OrderDetailCommand}"
|
||||
EventArgsConverter="{StaticResource ItemTappedEventArgsConverter}" />
|
||||
</ListView.Behaviors>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<templates:OrderTemplate />
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ContentPage>
|
@ -105,7 +105,7 @@
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Animate="True"
|
||||
Checked="{Binding UseMockServices, Mode=TwoWay}"
|
||||
Checked="{Binding UseAzureServices, Mode=TwoWay}"
|
||||
Command="{Binding MockServicesCommand}"
|
||||
Style="{StaticResource SettingsToggleButtonStyle}">
|
||||
<controls:ToggleButton.CheckedImage>
|
||||
|
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace eShopOnContainers.Core.Views
|
||||
{
|
||||
|
@ -15,6 +15,8 @@
|
||||
Value="{StaticResource MediumSize}" />
|
||||
<Setter Property="TextColor"
|
||||
Value="{StaticResource BlackColor}" />
|
||||
<Setter Property="LineBreakMode"
|
||||
Value="HeadTruncation" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OrderItemUnitPriceStyle"
|
||||
@ -107,7 +109,8 @@
|
||||
<!-- NAME -->
|
||||
<Label
|
||||
Grid.Row="0"
|
||||
Text="{Binding ProductName, Converter={StaticResource ToUpperConverter}}"/>
|
||||
Text="{Binding ProductName, Converter={StaticResource ToUpperConverter}}"
|
||||
Style="{StaticResource OrderItemTitleStyle}"/>
|
||||
<Grid
|
||||
Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
|
@ -66,12 +66,14 @@
|
||||
<Compile Include="GlobalSettings.cs" />
|
||||
<Compile Include="Helpers\EasingHelper.cs" />
|
||||
<Compile Include="Helpers\NumericHelper.cs" />
|
||||
<Compile Include="Helpers\Settings.cs" />
|
||||
<Compile Include="Models\Basket\BasketItem.cs" />
|
||||
<Compile Include="Models\Catalog\CatalogBrand.cs" />
|
||||
<Compile Include="Models\Catalog\CatalogRoot.cs" />
|
||||
<Compile Include="Models\Catalog\CatalogType.cs" />
|
||||
<Compile Include="Models\Navigation\TabParameter.cs" />
|
||||
<Compile Include="Models\Basket\CustomerBasket.cs" />
|
||||
<Compile Include="Models\Orders\CardType.cs" />
|
||||
<Compile Include="Models\Orders\Order.cs" />
|
||||
<Compile Include="Models\Orders\OrderItem.cs" />
|
||||
<Compile Include="Models\Orders\OrderStatus.cs" />
|
||||
@ -92,6 +94,9 @@
|
||||
<Compile Include="Services\Catalog\CatalogMockService.cs" />
|
||||
<Compile Include="Services\Catalog\ICatalogService.cs" />
|
||||
<Compile Include="Services\Basket\BasketService.cs" />
|
||||
<Compile Include="Services\Order\IOrderService.cs" />
|
||||
<Compile Include="Services\Order\OrderMockService.cs" />
|
||||
<Compile Include="Services\Order\OrderService.cs" />
|
||||
<Compile Include="Services\RequestProvider\IRequestProvider.cs" />
|
||||
<Compile Include="Services\RequestProvider\RequestProvider.cs" />
|
||||
<Compile Include="Services\User\IUserService.cs" />
|
||||
@ -119,8 +124,8 @@
|
||||
<Compile Include="Views\CheckoutView.xaml.cs">
|
||||
<DependentUpon>CheckoutView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\CustomNavigationPage.xaml.cs">
|
||||
<DependentUpon>CustomNavigationPage.xaml</DependentUpon>
|
||||
<Compile Include="Views\CustomNavigationView.xaml.cs">
|
||||
<DependentUpon>CustomNavigationView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\FiltersView.xaml.cs">
|
||||
<DependentUpon>FiltersView.xaml</DependentUpon>
|
||||
@ -209,6 +214,14 @@
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Settings, Version=2.6.0.12, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.6.0.12-beta\lib\portable-net45+wp80+win8+wpa81\Plugin.Settings.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Settings.Abstractions, Version=2.6.0.12, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.6.0.12-beta\lib\portable-net45+wp80+win8+wpa81\Plugin.Settings.Abstractions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SlideOverKit, Version=1.0.6135.18790, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SlideOverKit.2.1.4\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SlideOverKit.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@ -289,7 +302,7 @@
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Views\CustomNavigationPage.xaml">
|
||||
<EmbeddedResource Include="Views\CustomNavigationView.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
|
@ -11,6 +11,7 @@
|
||||
<package id="SlideOverKit" version="2.1.4" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="Splat" version="1.6.2" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="Unity" version="4.0.1" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="Xam.Plugins.Settings" version="2.6.0.12-beta" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="Xamarin.FFImageLoading" version="2.2.6-pre-232" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="Xamarin.FFImageLoading.Forms" version="2.2.6-pre-232" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
<package id="Xamarin.Forms" version="2.3.2.127" targetFramework="portable45-net45+win8+wp8+wpa81" />
|
||||
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
// Helpers/Settings.cs This file was automatically added when you installed the Settings Plugin. If you are not using a PCL then comment this file back in to use it.
|
||||
using Plugin.Settings;
|
||||
using Plugin.Settings.Abstractions;
|
||||
|
||||
namespace eShopOnContainers.Droid.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
|
||||
{
|
||||
get
|
||||
{
|
||||
return CrossSettings.Current;
|
||||
}
|
||||
}
|
||||
|
||||
#region Setting Constants
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}*/
|
@ -0,0 +1,33 @@
|
||||
using Android.Widget;
|
||||
using eShopOnContainers.Droid.Renderers;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.Android.AppCompat;
|
||||
|
||||
[assembly: ExportRenderer(typeof(NavigationPage), typeof(CustomNavigationPageRenderer))]
|
||||
namespace eShopOnContainers.Droid.Renderers
|
||||
{
|
||||
public class CustomNavigationPageRenderer : NavigationPageRenderer
|
||||
{
|
||||
protected override void OnLayout(bool changed, int l, int t, int r, int b)
|
||||
{
|
||||
base.OnLayout(changed, l, t, r, b);
|
||||
|
||||
var toolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
|
||||
|
||||
if (toolbar != null)
|
||||
{
|
||||
var image = toolbar.FindViewById<ImageView>(Resource.Id.toolbar_image);
|
||||
|
||||
if (Element.CurrentPage == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Element.CurrentPage.Title))
|
||||
image.Visibility = Android.Views.ViewStates.Invisible;
|
||||
else
|
||||
image.Visibility = Android.Views.ViewStates.Visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -12,7 +12,6 @@ using eShopOnContainers.Core.Controls;
|
||||
using eShopOnContainers.Droid.Renderers;
|
||||
using Android.Support.V4.View;
|
||||
using Android.Graphics;
|
||||
using static Android.Widget.ImageView;
|
||||
|
||||
[assembly: ExportRenderer(typeof(TabbedPage), typeof(CustomTabbedPageRenderer))]
|
||||
namespace eShopOnContainers.Droid.Renderers
|
||||
|
@ -2027,319 +2027,325 @@ namespace eShopOnContainers.Droid
|
||||
public const int background = 2130837580;
|
||||
|
||||
// aapt resource value: 0x7f02004d
|
||||
public const int default_product = 2130837581;
|
||||
public const int banner = 2130837581;
|
||||
|
||||
// aapt resource value: 0x7f02004e
|
||||
public const int design_fab_background = 2130837582;
|
||||
public const int default_product = 2130837582;
|
||||
|
||||
// aapt resource value: 0x7f02004f
|
||||
public const int design_snackbar_background = 2130837583;
|
||||
public const int design_fab_background = 2130837583;
|
||||
|
||||
// aapt resource value: 0x7f020050
|
||||
public const int fake_product_01 = 2130837584;
|
||||
public const int design_snackbar_background = 2130837584;
|
||||
|
||||
// aapt resource value: 0x7f020051
|
||||
public const int fake_product_02 = 2130837585;
|
||||
public const int fake_product_01 = 2130837585;
|
||||
|
||||
// aapt resource value: 0x7f020052
|
||||
public const int fake_product_03 = 2130837586;
|
||||
public const int fake_product_02 = 2130837586;
|
||||
|
||||
// aapt resource value: 0x7f020053
|
||||
public const int fake_product_04 = 2130837587;
|
||||
public const int fake_product_03 = 2130837587;
|
||||
|
||||
// aapt resource value: 0x7f020054
|
||||
public const int fake_product_05 = 2130837588;
|
||||
public const int fake_product_04 = 2130837588;
|
||||
|
||||
// aapt resource value: 0x7f020055
|
||||
public const int ic_audiotrack = 2130837589;
|
||||
public const int fake_product_05 = 2130837589;
|
||||
|
||||
// aapt resource value: 0x7f020056
|
||||
public const int ic_audiotrack_light = 2130837590;
|
||||
public const int header_logo = 2130837590;
|
||||
|
||||
// aapt resource value: 0x7f020057
|
||||
public const int ic_bluetooth_grey = 2130837591;
|
||||
public const int ic_audiotrack = 2130837591;
|
||||
|
||||
// aapt resource value: 0x7f020058
|
||||
public const int ic_bluetooth_white = 2130837592;
|
||||
public const int ic_audiotrack_light = 2130837592;
|
||||
|
||||
// aapt resource value: 0x7f020059
|
||||
public const int ic_cast_dark = 2130837593;
|
||||
public const int ic_bluetooth_grey = 2130837593;
|
||||
|
||||
// aapt resource value: 0x7f02005a
|
||||
public const int ic_cast_disabled_light = 2130837594;
|
||||
public const int ic_bluetooth_white = 2130837594;
|
||||
|
||||
// aapt resource value: 0x7f02005b
|
||||
public const int ic_cast_grey = 2130837595;
|
||||
public const int ic_cast_dark = 2130837595;
|
||||
|
||||
// aapt resource value: 0x7f02005c
|
||||
public const int ic_cast_light = 2130837596;
|
||||
public const int ic_cast_disabled_light = 2130837596;
|
||||
|
||||
// aapt resource value: 0x7f02005d
|
||||
public const int ic_cast_off_light = 2130837597;
|
||||
public const int ic_cast_grey = 2130837597;
|
||||
|
||||
// aapt resource value: 0x7f02005e
|
||||
public const int ic_cast_on_0_light = 2130837598;
|
||||
public const int ic_cast_light = 2130837598;
|
||||
|
||||
// aapt resource value: 0x7f02005f
|
||||
public const int ic_cast_on_1_light = 2130837599;
|
||||
public const int ic_cast_off_light = 2130837599;
|
||||
|
||||
// aapt resource value: 0x7f020060
|
||||
public const int ic_cast_on_2_light = 2130837600;
|
||||
public const int ic_cast_on_0_light = 2130837600;
|
||||
|
||||
// aapt resource value: 0x7f020061
|
||||
public const int ic_cast_on_light = 2130837601;
|
||||
public const int ic_cast_on_1_light = 2130837601;
|
||||
|
||||
// aapt resource value: 0x7f020062
|
||||
public const int ic_cast_white = 2130837602;
|
||||
public const int ic_cast_on_2_light = 2130837602;
|
||||
|
||||
// aapt resource value: 0x7f020063
|
||||
public const int ic_close_dark = 2130837603;
|
||||
public const int ic_cast_on_light = 2130837603;
|
||||
|
||||
// aapt resource value: 0x7f020064
|
||||
public const int ic_close_light = 2130837604;
|
||||
public const int ic_cast_white = 2130837604;
|
||||
|
||||
// aapt resource value: 0x7f020065
|
||||
public const int ic_collapse = 2130837605;
|
||||
public const int ic_close_dark = 2130837605;
|
||||
|
||||
// aapt resource value: 0x7f020066
|
||||
public const int ic_collapse_00000 = 2130837606;
|
||||
public const int ic_close_light = 2130837606;
|
||||
|
||||
// aapt resource value: 0x7f020067
|
||||
public const int ic_collapse_00001 = 2130837607;
|
||||
public const int ic_collapse = 2130837607;
|
||||
|
||||
// aapt resource value: 0x7f020068
|
||||
public const int ic_collapse_00002 = 2130837608;
|
||||
public const int ic_collapse_00000 = 2130837608;
|
||||
|
||||
// aapt resource value: 0x7f020069
|
||||
public const int ic_collapse_00003 = 2130837609;
|
||||
public const int ic_collapse_00001 = 2130837609;
|
||||
|
||||
// aapt resource value: 0x7f02006a
|
||||
public const int ic_collapse_00004 = 2130837610;
|
||||
public const int ic_collapse_00002 = 2130837610;
|
||||
|
||||
// aapt resource value: 0x7f02006b
|
||||
public const int ic_collapse_00005 = 2130837611;
|
||||
public const int ic_collapse_00003 = 2130837611;
|
||||
|
||||
// aapt resource value: 0x7f02006c
|
||||
public const int ic_collapse_00006 = 2130837612;
|
||||
public const int ic_collapse_00004 = 2130837612;
|
||||
|
||||
// aapt resource value: 0x7f02006d
|
||||
public const int ic_collapse_00007 = 2130837613;
|
||||
public const int ic_collapse_00005 = 2130837613;
|
||||
|
||||
// aapt resource value: 0x7f02006e
|
||||
public const int ic_collapse_00008 = 2130837614;
|
||||
public const int ic_collapse_00006 = 2130837614;
|
||||
|
||||
// aapt resource value: 0x7f02006f
|
||||
public const int ic_collapse_00009 = 2130837615;
|
||||
public const int ic_collapse_00007 = 2130837615;
|
||||
|
||||
// aapt resource value: 0x7f020070
|
||||
public const int ic_collapse_00010 = 2130837616;
|
||||
public const int ic_collapse_00008 = 2130837616;
|
||||
|
||||
// aapt resource value: 0x7f020071
|
||||
public const int ic_collapse_00011 = 2130837617;
|
||||
public const int ic_collapse_00009 = 2130837617;
|
||||
|
||||
// aapt resource value: 0x7f020072
|
||||
public const int ic_collapse_00012 = 2130837618;
|
||||
public const int ic_collapse_00010 = 2130837618;
|
||||
|
||||
// aapt resource value: 0x7f020073
|
||||
public const int ic_collapse_00013 = 2130837619;
|
||||
public const int ic_collapse_00011 = 2130837619;
|
||||
|
||||
// aapt resource value: 0x7f020074
|
||||
public const int ic_collapse_00014 = 2130837620;
|
||||
public const int ic_collapse_00012 = 2130837620;
|
||||
|
||||
// aapt resource value: 0x7f020075
|
||||
public const int ic_collapse_00015 = 2130837621;
|
||||
public const int ic_collapse_00013 = 2130837621;
|
||||
|
||||
// aapt resource value: 0x7f020076
|
||||
public const int ic_errorstatus = 2130837622;
|
||||
public const int ic_collapse_00014 = 2130837622;
|
||||
|
||||
// aapt resource value: 0x7f020077
|
||||
public const int ic_expand = 2130837623;
|
||||
public const int ic_collapse_00015 = 2130837623;
|
||||
|
||||
// aapt resource value: 0x7f020078
|
||||
public const int ic_expand_00000 = 2130837624;
|
||||
public const int ic_errorstatus = 2130837624;
|
||||
|
||||
// aapt resource value: 0x7f020079
|
||||
public const int ic_expand_00001 = 2130837625;
|
||||
public const int ic_expand = 2130837625;
|
||||
|
||||
// aapt resource value: 0x7f02007a
|
||||
public const int ic_expand_00002 = 2130837626;
|
||||
public const int ic_expand_00000 = 2130837626;
|
||||
|
||||
// aapt resource value: 0x7f02007b
|
||||
public const int ic_expand_00003 = 2130837627;
|
||||
public const int ic_expand_00001 = 2130837627;
|
||||
|
||||
// aapt resource value: 0x7f02007c
|
||||
public const int ic_expand_00004 = 2130837628;
|
||||
public const int ic_expand_00002 = 2130837628;
|
||||
|
||||
// aapt resource value: 0x7f02007d
|
||||
public const int ic_expand_00005 = 2130837629;
|
||||
public const int ic_expand_00003 = 2130837629;
|
||||
|
||||
// aapt resource value: 0x7f02007e
|
||||
public const int ic_expand_00006 = 2130837630;
|
||||
public const int ic_expand_00004 = 2130837630;
|
||||
|
||||
// aapt resource value: 0x7f02007f
|
||||
public const int ic_expand_00007 = 2130837631;
|
||||
public const int ic_expand_00005 = 2130837631;
|
||||
|
||||
// aapt resource value: 0x7f020080
|
||||
public const int ic_expand_00008 = 2130837632;
|
||||
public const int ic_expand_00006 = 2130837632;
|
||||
|
||||
// aapt resource value: 0x7f020081
|
||||
public const int ic_expand_00009 = 2130837633;
|
||||
public const int ic_expand_00007 = 2130837633;
|
||||
|
||||
// aapt resource value: 0x7f020082
|
||||
public const int ic_expand_00010 = 2130837634;
|
||||
public const int ic_expand_00008 = 2130837634;
|
||||
|
||||
// aapt resource value: 0x7f020083
|
||||
public const int ic_expand_00011 = 2130837635;
|
||||
public const int ic_expand_00009 = 2130837635;
|
||||
|
||||
// aapt resource value: 0x7f020084
|
||||
public const int ic_expand_00012 = 2130837636;
|
||||
public const int ic_expand_00010 = 2130837636;
|
||||
|
||||
// aapt resource value: 0x7f020085
|
||||
public const int ic_expand_00013 = 2130837637;
|
||||
public const int ic_expand_00011 = 2130837637;
|
||||
|
||||
// aapt resource value: 0x7f020086
|
||||
public const int ic_expand_00014 = 2130837638;
|
||||
public const int ic_expand_00012 = 2130837638;
|
||||
|
||||
// aapt resource value: 0x7f020087
|
||||
public const int ic_expand_00015 = 2130837639;
|
||||
public const int ic_expand_00013 = 2130837639;
|
||||
|
||||
// aapt resource value: 0x7f020088
|
||||
public const int ic_media_pause = 2130837640;
|
||||
public const int ic_expand_00014 = 2130837640;
|
||||
|
||||
// aapt resource value: 0x7f020089
|
||||
public const int ic_media_play = 2130837641;
|
||||
public const int ic_expand_00015 = 2130837641;
|
||||
|
||||
// aapt resource value: 0x7f02008a
|
||||
public const int ic_media_route_disabled_mono_dark = 2130837642;
|
||||
public const int ic_media_pause = 2130837642;
|
||||
|
||||
// aapt resource value: 0x7f02008b
|
||||
public const int ic_media_route_off_mono_dark = 2130837643;
|
||||
public const int ic_media_play = 2130837643;
|
||||
|
||||
// aapt resource value: 0x7f02008c
|
||||
public const int ic_media_route_on_0_mono_dark = 2130837644;
|
||||
public const int ic_media_route_disabled_mono_dark = 2130837644;
|
||||
|
||||
// aapt resource value: 0x7f02008d
|
||||
public const int ic_media_route_on_1_mono_dark = 2130837645;
|
||||
public const int ic_media_route_off_mono_dark = 2130837645;
|
||||
|
||||
// aapt resource value: 0x7f02008e
|
||||
public const int ic_media_route_on_2_mono_dark = 2130837646;
|
||||
public const int ic_media_route_on_0_mono_dark = 2130837646;
|
||||
|
||||
// aapt resource value: 0x7f02008f
|
||||
public const int ic_media_route_on_mono_dark = 2130837647;
|
||||
public const int ic_media_route_on_1_mono_dark = 2130837647;
|
||||
|
||||
// aapt resource value: 0x7f020090
|
||||
public const int ic_pause_dark = 2130837648;
|
||||
public const int ic_media_route_on_2_mono_dark = 2130837648;
|
||||
|
||||
// aapt resource value: 0x7f020091
|
||||
public const int ic_pause_light = 2130837649;
|
||||
public const int ic_media_route_on_mono_dark = 2130837649;
|
||||
|
||||
// aapt resource value: 0x7f020092
|
||||
public const int ic_play_dark = 2130837650;
|
||||
public const int ic_pause_dark = 2130837650;
|
||||
|
||||
// aapt resource value: 0x7f020093
|
||||
public const int ic_play_light = 2130837651;
|
||||
public const int ic_pause_light = 2130837651;
|
||||
|
||||
// aapt resource value: 0x7f020094
|
||||
public const int ic_speaker_dark = 2130837652;
|
||||
public const int ic_play_dark = 2130837652;
|
||||
|
||||
// aapt resource value: 0x7f020095
|
||||
public const int ic_speaker_group_dark = 2130837653;
|
||||
public const int ic_play_light = 2130837653;
|
||||
|
||||
// aapt resource value: 0x7f020096
|
||||
public const int ic_speaker_group_light = 2130837654;
|
||||
public const int ic_speaker_dark = 2130837654;
|
||||
|
||||
// aapt resource value: 0x7f020097
|
||||
public const int ic_speaker_light = 2130837655;
|
||||
public const int ic_speaker_group_dark = 2130837655;
|
||||
|
||||
// aapt resource value: 0x7f020098
|
||||
public const int ic_successstatus = 2130837656;
|
||||
public const int ic_speaker_group_light = 2130837656;
|
||||
|
||||
// aapt resource value: 0x7f020099
|
||||
public const int ic_tv_dark = 2130837657;
|
||||
public const int ic_speaker_light = 2130837657;
|
||||
|
||||
// aapt resource value: 0x7f02009a
|
||||
public const int ic_tv_light = 2130837658;
|
||||
public const int ic_successstatus = 2130837658;
|
||||
|
||||
// aapt resource value: 0x7f02009b
|
||||
public const int icon = 2130837659;
|
||||
public const int ic_tv_dark = 2130837659;
|
||||
|
||||
// aapt resource value: 0x7f02009c
|
||||
public const int menu_cart = 2130837660;
|
||||
public const int ic_tv_light = 2130837660;
|
||||
|
||||
// aapt resource value: 0x7f02009d
|
||||
public const int menu_filter = 2130837661;
|
||||
public const int icon = 2130837661;
|
||||
|
||||
// aapt resource value: 0x7f02009e
|
||||
public const int menu_profile = 2130837662;
|
||||
public const int menu_cart = 2130837662;
|
||||
|
||||
// aapt resource value: 0x7f02009f
|
||||
public const int mr_dialog_material_background_dark = 2130837663;
|
||||
public const int menu_filter = 2130837663;
|
||||
|
||||
// aapt resource value: 0x7f0200a0
|
||||
public const int mr_dialog_material_background_light = 2130837664;
|
||||
public const int menu_profile = 2130837664;
|
||||
|
||||
// aapt resource value: 0x7f0200a1
|
||||
public const int mr_ic_audiotrack_light = 2130837665;
|
||||
public const int mr_dialog_material_background_dark = 2130837665;
|
||||
|
||||
// aapt resource value: 0x7f0200a2
|
||||
public const int mr_ic_cast_dark = 2130837666;
|
||||
public const int mr_dialog_material_background_light = 2130837666;
|
||||
|
||||
// aapt resource value: 0x7f0200a3
|
||||
public const int mr_ic_cast_light = 2130837667;
|
||||
public const int mr_ic_audiotrack_light = 2130837667;
|
||||
|
||||
// aapt resource value: 0x7f0200a4
|
||||
public const int mr_ic_close_dark = 2130837668;
|
||||
public const int mr_ic_cast_dark = 2130837668;
|
||||
|
||||
// aapt resource value: 0x7f0200a5
|
||||
public const int mr_ic_close_light = 2130837669;
|
||||
public const int mr_ic_cast_light = 2130837669;
|
||||
|
||||
// aapt resource value: 0x7f0200a6
|
||||
public const int mr_ic_media_route_connecting_mono_dark = 2130837670;
|
||||
public const int mr_ic_close_dark = 2130837670;
|
||||
|
||||
// aapt resource value: 0x7f0200a7
|
||||
public const int mr_ic_media_route_connecting_mono_light = 2130837671;
|
||||
public const int mr_ic_close_light = 2130837671;
|
||||
|
||||
// aapt resource value: 0x7f0200a8
|
||||
public const int mr_ic_media_route_mono_dark = 2130837672;
|
||||
public const int mr_ic_media_route_connecting_mono_dark = 2130837672;
|
||||
|
||||
// aapt resource value: 0x7f0200a9
|
||||
public const int mr_ic_media_route_mono_light = 2130837673;
|
||||
public const int mr_ic_media_route_connecting_mono_light = 2130837673;
|
||||
|
||||
// aapt resource value: 0x7f0200aa
|
||||
public const int mr_ic_pause_dark = 2130837674;
|
||||
public const int mr_ic_media_route_mono_dark = 2130837674;
|
||||
|
||||
// aapt resource value: 0x7f0200ab
|
||||
public const int mr_ic_pause_light = 2130837675;
|
||||
public const int mr_ic_media_route_mono_light = 2130837675;
|
||||
|
||||
// aapt resource value: 0x7f0200ac
|
||||
public const int mr_ic_play_dark = 2130837676;
|
||||
public const int mr_ic_pause_dark = 2130837676;
|
||||
|
||||
// aapt resource value: 0x7f0200ad
|
||||
public const int mr_ic_play_light = 2130837677;
|
||||
public const int mr_ic_pause_light = 2130837677;
|
||||
|
||||
// aapt resource value: 0x7f0200ae
|
||||
public const int noimage = 2130837678;
|
||||
|
||||
// aapt resource value: 0x7f0200b5
|
||||
public const int notification_template_icon_bg = 2130837685;
|
||||
public const int mr_ic_play_dark = 2130837678;
|
||||
|
||||
// aapt resource value: 0x7f0200af
|
||||
public const int product_add = 2130837679;
|
||||
public const int mr_ic_play_light = 2130837679;
|
||||
|
||||
// aapt resource value: 0x7f0200b0
|
||||
public const int roundedbg = 2130837680;
|
||||
public const int noimage = 2130837680;
|
||||
|
||||
// aapt resource value: 0x7f0200b7
|
||||
public const int notification_template_icon_bg = 2130837687;
|
||||
|
||||
// aapt resource value: 0x7f0200b1
|
||||
public const int roundedbgdark = 2130837681;
|
||||
public const int product_add = 2130837681;
|
||||
|
||||
// aapt resource value: 0x7f0200b2
|
||||
public const int splash_drawable = 2130837682;
|
||||
public const int roundedbg = 2130837682;
|
||||
|
||||
// aapt resource value: 0x7f0200b3
|
||||
public const int switch_off = 2130837683;
|
||||
public const int roundedbgdark = 2130837683;
|
||||
|
||||
// aapt resource value: 0x7f0200b4
|
||||
public const int switch_on = 2130837684;
|
||||
public const int splash_drawable = 2130837684;
|
||||
|
||||
// aapt resource value: 0x7f0200b5
|
||||
public const int switch_off = 2130837685;
|
||||
|
||||
// aapt resource value: 0x7f0200b6
|
||||
public const int switch_on = 2130837686;
|
||||
|
||||
static Drawable()
|
||||
{
|
||||
@ -2810,6 +2816,9 @@ namespace eShopOnContainers.Droid
|
||||
// aapt resource value: 0x7f0700a0
|
||||
public const int toolbar = 2131165344;
|
||||
|
||||
// aapt resource value: 0x7f0700a1
|
||||
public const int toolbar_image = 2131165345;
|
||||
|
||||
// aapt resource value: 0x7f070032
|
||||
public const int top = 2131165234;
|
||||
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 142 KiB |
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.Toolbar
|
||||
<android.support.v7.widget.Toolbar
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/toolbar"
|
||||
@ -9,4 +9,12 @@
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
app:layout_scrollFlags="scroll|enterAlways" />
|
||||
app:layout_scrollFlags="scroll|enterAlways">
|
||||
<ImageView
|
||||
android:id="@+id/toolbar_image"
|
||||
android:src="@drawable/header_logo"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_width="124dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center" />
|
||||
</android.support.v7.widget.Toolbar>
|
@ -116,6 +116,14 @@
|
||||
<HintPath>..\..\packages\modernhttpclient.2.4.2\lib\MonoAndroid\OkHttp.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Settings, Version=2.6.0.12, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.6.0.12-beta\lib\MonoAndroid10\Plugin.Settings.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Settings.Abstractions, Version=2.6.0.12, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.6.0.12-beta\lib\MonoAndroid10\Plugin.Settings.Abstractions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SlideOverKit, Version=1.0.6135.18790, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SlideOverKit.2.1.4\lib\MonoAndroid10\SlideOverKit.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@ -203,7 +211,9 @@
|
||||
<Compile Include="Activities\SplashActivity.cs" />
|
||||
<Compile Include="Effects\EntryLineColorEffect.cs" />
|
||||
<Compile Include="Extensions\ViewExtensions.cs" />
|
||||
<Compile Include="Helpers\Settings.cs" />
|
||||
<Compile Include="Renderers\BadgeView.cs" />
|
||||
<Compile Include="Renderers\CustomNavigationPageRenderer.cs" />
|
||||
<Compile Include="Renderers\CustomTabbedPageRenderer.cs" />
|
||||
<Compile Include="Renderers\SlideDownMenuPageRenderer.cs" />
|
||||
<Compile Include="Resources\Resource.Designer.cs" />
|
||||
@ -346,6 +356,18 @@
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\default_product.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\banner.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-hdpi\header_logo.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\header_logo.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable-xxhdpi\header_logo.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
<Import Project="..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets" Condition="Exists('..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\build\Xamarin.Android.Support.Vector.Drawable.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
|
@ -32,6 +32,7 @@
|
||||
<package id="System.Xml.ReaderWriter" version="4.0.11" targetFramework="monoandroid70" />
|
||||
<package id="System.Xml.XDocument" version="4.0.11" targetFramework="monoandroid70" />
|
||||
<package id="Unity" version="4.0.1" targetFramework="monoandroid70" />
|
||||
<package id="Xam.Plugins.Settings" version="2.6.0.12-beta" targetFramework="monoandroid70" />
|
||||
<package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="23.3.0" targetFramework="monoandroid70" />
|
||||
<package id="Xamarin.Android.Support.Design" version="23.3.0" targetFramework="monoandroid70" />
|
||||
<package id="Xamarin.Android.Support.v4" version="23.3.0" targetFramework="monoandroid70" />
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 856 KiB |
@ -129,6 +129,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Assets\app_settings.png" />
|
||||
<Content Include="Assets\banner.png" />
|
||||
<Content Include="Assets\circle_button_background.png" />
|
||||
<Content Include="Assets\default_product.png" />
|
||||
<Content Include="Assets\fake_product_01.png" />
|
||||
|
@ -5,6 +5,7 @@
|
||||
"Newtonsoft.Json": "9.0.1",
|
||||
"SlideOverKit": "2.1.4",
|
||||
"Unity": "4.0.1",
|
||||
"Xam.Plugins.Settings": "2.6.0.12-beta",
|
||||
"Xamarin.FFImageLoading": "2.2.6-pre-232",
|
||||
"Xamarin.FFImageLoading.Forms": "2.2.6-pre-232",
|
||||
"Xamarin.Forms": "2.3.2.127",
|
||||
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
// Helpers/Settings.cs This file was automatically added when you installed the Settings Plugin. If you are not using a PCL then comment this file back in to use it.
|
||||
using Plugin.Settings;
|
||||
using Plugin.Settings.Abstractions;
|
||||
|
||||
namespace eShopOnContainers.iOS.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
|
||||
{
|
||||
get
|
||||
{
|
||||
return CrossSettings.Current;
|
||||
}
|
||||
}
|
||||
|
||||
#region Setting Constants
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}*/
|
Binary file not shown.
After Width: | Height: | Size: 142 KiB |
@ -101,6 +101,7 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Effects\EntryLineColorEffect.cs" />
|
||||
<Compile Include="Helpers\Settings.cs" />
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<BundleResource Include="..\CommonResources\Fonts\Montserrat-Bold.ttf">
|
||||
@ -173,6 +174,14 @@
|
||||
<HintPath>..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Settings, Version=2.6.0.12, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.6.0.12-beta\lib\Xamarin.iOS10\Plugin.Settings.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Plugin.Settings.Abstractions, Version=2.6.0.12, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xam.Plugins.Settings.2.6.0.12-beta\lib\Xamarin.iOS10\Plugin.Settings.Abstractions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SlideOverKit, Version=1.0.6135.18790, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\SlideOverKit.2.1.4\lib\Xamarin.iOS10\SlideOverKit.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@ -372,6 +381,9 @@
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\default_product.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\banner.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
|
@ -9,6 +9,7 @@
|
||||
<package id="Splat" version="1.6.2" targetFramework="xamarinios10" />
|
||||
<package id="Unity" version="4.0.1" targetFramework="xamarinios10" />
|
||||
<package id="WebP.Touch" version="1.0.2" targetFramework="xamarinios10" />
|
||||
<package id="Xam.Plugins.Settings" version="2.6.0.12-beta" targetFramework="xamarinios10" />
|
||||
<package id="Xamarin.FFImageLoading" version="2.2.6-pre-232" targetFramework="xamarinios10" />
|
||||
<package id="Xamarin.FFImageLoading.Forms" version="2.2.6-pre-232" targetFramework="xamarinios10" />
|
||||
<package id="Xamarin.Forms" version="2.3.2.127" targetFramework="xamarinios10" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user