diff --git a/BookAStar/BookAStar.Droid/BookAStar.Droid.csproj b/BookAStar/BookAStar.Droid/BookAStar.Droid.csproj index 66be7693..07016d17 100644 --- a/BookAStar/BookAStar.Droid/BookAStar.Droid.csproj +++ b/BookAStar/BookAStar.Droid/BookAStar.Droid.csproj @@ -88,7 +88,7 @@ False ..\..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v7.0\Mono.Android.dll - + False ..\..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v7.0\Mono.Android.Export.dll @@ -343,6 +343,7 @@ + diff --git a/BookAStar/BookAStar.Droid/Helpers/SimpleJsonPostMethod.cs b/BookAStar/BookAStar.Droid/Helpers/SimpleJsonPostMethod.cs index 11b3ca6c..edf98951 100644 --- a/BookAStar/BookAStar.Droid/Helpers/SimpleJsonPostMethod.cs +++ b/BookAStar/BookAStar.Droid/Helpers/SimpleJsonPostMethod.cs @@ -85,6 +85,7 @@ namespace Yavsc.Helpers public async Task InvokeJson(object query) { JsonValue jsonDoc = null; + try { using (Stream streamQuery = request.GetRequestStream()) @@ -109,7 +110,12 @@ namespace Yavsc.Helpers // TODO err logging Debug.Print($"Web request failed: {request.ToString()}\n" + ex.ToString()); } - return jsonDoc; + catch (Exception ex) + { + Debug.Print($"Web request failed: {request.ToString()}\n" + ex.ToString()); + } + + return jsonDoc; } } } diff --git a/BookAStar/BookAStar.Droid/Properties/AndroidManifest.xml b/BookAStar/BookAStar.Droid/Properties/AndroidManifest.xml index fbc04fe9..5f09cf21 100644 --- a/BookAStar/BookAStar.Droid/Properties/AndroidManifest.xml +++ b/BookAStar/BookAStar.Droid/Properties/AndroidManifest.xml @@ -1,7 +1,7 @@  - + @@ -11,13 +11,13 @@ - + - + @@ -63,4 +63,8 @@ + + + + \ No newline at end of file diff --git a/BookAStar/BookAStar.Droid/Rendering/ImageButtonRenderer.cs b/BookAStar/BookAStar.Droid/Rendering/ImageButtonRenderer.cs new file mode 100644 index 00000000..38705672 --- /dev/null +++ b/BookAStar/BookAStar.Droid/Rendering/ImageButtonRenderer.cs @@ -0,0 +1,296 @@ +// *********************************************************************** +// Assembly : XLabs.Forms.Droid +// Author : XLabs Team +// Created : 12-27-2015 +// +// Last Modified By : XLabs Team +// Last Modified On : 01-04-2016 +// *********************************************************************** +// +// Copyright (c) XLabs Team. All rights reserved. +// +// +// This project is licensed under the Apache 2.0 license +// https://github.com/XLabs/Xamarin-Forms-Labs/blob/master/LICENSE +// +// XLabs is a open source project that aims to provide a powerfull and cross +// platform set of controls tailored to work with Xamarin Forms. +// +// *********************************************************************** +// + +using System; +using System.ComponentModel; +using System.Threading.Tasks; +using Android.Graphics; +using Android.Graphics.Drawables; +using Android.Views; +using XLabs.Enums; +using XLabs.Forms.Extensions; +using Color = Xamarin.Forms.Color; +using View = Android.Views.View; +using BookAStar.Rendering; +using BookAStar.Views; +using Xamarin.Forms.Platform.Android.AppCompat; +using Xamarin.Forms; +using Xamarin.Forms.Platform.Android; +using System.IO; +using BookAStar.Helpers; +using System.Reflection; +using System.Threading; + +[assembly: ExportRenderer(typeof(ImageButton), typeof(ImageButtonRenderer))] +namespace BookAStar.Rendering +{ + /// + /// Draws a button on the Android platform with the image shown in the right + /// position with the right size. + /// + public partial class ImageButtonRenderer : Xamarin.Forms.Platform.Android.AppCompat.ButtonRenderer + { + private static float _density = float.MinValue; + + + /// + /// Sets up the button including the image. + /// + /// The event arguments. + private ImageButton ImageButton + { + get { return (ImageButton)Element; } + } + + protected override async void OnElementChanged(ElementChangedEventArgs + diff --git a/BookAStar/BookAStar/Pages/Estimate/EditBillingLinePage.xaml.cs b/BookAStar/BookAStar/Pages/EstimatePages/EditBillingLinePage.xaml.cs similarity index 100% rename from BookAStar/BookAStar/Pages/Estimate/EditBillingLinePage.xaml.cs rename to BookAStar/BookAStar/Pages/EstimatePages/EditBillingLinePage.xaml.cs diff --git a/BookAStar/BookAStar/Pages/Estimate/EditEstimatePage.xaml b/BookAStar/BookAStar/Pages/EstimatePages/EditEstimatePage.xaml similarity index 98% rename from BookAStar/BookAStar/Pages/Estimate/EditEstimatePage.xaml rename to BookAStar/BookAStar/Pages/EstimatePages/EditEstimatePage.xaml index 28b6604c..4dbb56b3 100644 --- a/BookAStar/BookAStar/Pages/Estimate/EditEstimatePage.xaml +++ b/BookAStar/BookAStar/Pages/EstimatePages/EditEstimatePage.xaml @@ -15,6 +15,7 @@ + @@ -77,4 +78,5 @@ + \ No newline at end of file diff --git a/BookAStar/BookAStar/Pages/Estimate/EditEstimatePage.xaml.cs b/BookAStar/BookAStar/Pages/EstimatePages/EditEstimatePage.xaml.cs similarity index 94% rename from BookAStar/BookAStar/Pages/Estimate/EditEstimatePage.xaml.cs rename to BookAStar/BookAStar/Pages/EstimatePages/EditEstimatePage.xaml.cs index 8c1e2392..89e96add 100644 --- a/BookAStar/BookAStar/Pages/Estimate/EditEstimatePage.xaml.cs +++ b/BookAStar/BookAStar/Pages/EstimatePages/EditEstimatePage.xaml.cs @@ -49,9 +49,9 @@ namespace BookAStar.Pages bill.Add(com); DataManager.Current.EstimationCache.SaveEntity(); })}; + lineView.PropertyChanged += LineView_PropertyChanged; App.NavigationService.NavigateTo( - true, - new object[] { lineView } ); + true, lineView ); } protected void OnEditLine(object sender, ItemTappedEventArgs e) { @@ -63,12 +63,14 @@ namespace BookAStar.Pages DataManager.Current.EstimationCache.SaveEntity(); }) }; + lineView.PropertyChanged += LineView_PropertyChanged; + lineView.PropertyChanged += LineView_PropertyChanged; App.NavigationService.NavigateTo( - true, - new object[] { lineView }); + true, lineView ); } + private void LineView_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { DataManager.Current.EstimationCache.SaveEntity(); diff --git a/BookAStar/BookAStar/Pages/EstimatePages/EstimatesClientPage.xaml b/BookAStar/BookAStar/Pages/EstimatePages/EstimatesClientPage.xaml new file mode 100644 index 00000000..3bd2519d --- /dev/null +++ b/BookAStar/BookAStar/Pages/EstimatePages/EstimatesClientPage.xaml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/BookAStar/BookAStar/Pages/EstimatePages/EstimatesClientPage.xaml.cs b/BookAStar/BookAStar/Pages/EstimatePages/EstimatesClientPage.xaml.cs new file mode 100644 index 00000000..9a77ff7e --- /dev/null +++ b/BookAStar/BookAStar/Pages/EstimatePages/EstimatesClientPage.xaml.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Xamarin.Forms; + +namespace BookAStar.Pages +{ + public partial class EstimatesClientPage : ContentPage + { + public EstimatesClientPage() + { + InitializeComponent(); + } + } +} diff --git a/BookAStar/BookAStar/Pages/EstimatePages/EstimatesProviderPage.xaml b/BookAStar/BookAStar/Pages/EstimatePages/EstimatesProviderPage.xaml new file mode 100644 index 00000000..c16bd7ea --- /dev/null +++ b/BookAStar/BookAStar/Pages/EstimatePages/EstimatesProviderPage.xaml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BookAStar/BookAStar/Pages/EstimatePages/EstimatesProviderPage.xaml.cs b/BookAStar/BookAStar/Pages/EstimatePages/EstimatesProviderPage.xaml.cs new file mode 100644 index 00000000..713499bd --- /dev/null +++ b/BookAStar/BookAStar/Pages/EstimatePages/EstimatesProviderPage.xaml.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Xamarin.Forms; + +namespace BookAStar.Pages +{ + using Model.Workflow; + using ViewModels.EstimateAndBilling; + + public partial class EstimatesProviderPage : ContentPage + { + public EstimatesProviderPage() + { + InitializeComponent(); + } + + private void OnViewDetail(object sender, ItemTappedEventArgs e) + { + Estimate data = e.Item as Estimate; + App.NavigationService.NavigateTo( + true, + new EditEstimateViewModel(data)); + } + } +} diff --git a/BookAStar/BookAStar/Pages/EstimatePages/ViewEstimatePage.xaml b/BookAStar/BookAStar/Pages/EstimatePages/ViewEstimatePage.xaml new file mode 100644 index 00000000..60989c24 --- /dev/null +++ b/BookAStar/BookAStar/Pages/EstimatePages/ViewEstimatePage.xaml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BookAStar/BookAStar/Pages/EstimatePages/ViewEstimatePage.xaml.cs b/BookAStar/BookAStar/Pages/EstimatePages/ViewEstimatePage.xaml.cs new file mode 100644 index 00000000..75a2f117 --- /dev/null +++ b/BookAStar/BookAStar/Pages/EstimatePages/ViewEstimatePage.xaml.cs @@ -0,0 +1,25 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Xamarin.Forms; + +namespace BookAStar.Pages.EstimatePages +{ + using ViewModels.EstimateAndBilling; + + public partial class ViewEstimatePage : ContentPage + { + public ViewEstimatePage(EditEstimateViewModel model) + { + InitializeComponent(); + billListView.ItemSelected += (sender, e) => { + ((ListView)sender).SelectedItem = null; + }; + BindingContext = model; + } + } +} diff --git a/BookAStar/BookAStar/Pages/UserProfile/DashboardPage.xaml b/BookAStar/BookAStar/Pages/UserProfile/DashboardPage.xaml index 2ef86a72..d0b929ff 100644 --- a/BookAStar/BookAStar/Pages/UserProfile/DashboardPage.xaml +++ b/BookAStar/BookAStar/Pages/UserProfile/DashboardPage.xaml @@ -34,6 +34,7 @@