From 1ac48b438d17ccb3f965c004b324288358c9bbfc Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 21 Nov 2016 17:41:14 +0100 Subject: [PATCH] WIP end of the day --- .../BookAStar.Droid/BookAStar.Droid.csproj | 2 +- .../Properties/AndroidManifest.xml | 6 +- .../Resources/Resource.Designer.cs | 53 +++-- .../Resources/values/strings.xml | 1 + BookAStar/BookAStar/App.xaml.cs | 56 +++-- BookAStar/BookAStar/BookAStar.csproj | 3 +- .../Pages/UserProfile/DashboardPage.xaml | 1 + .../Pages/UserProfile/UserProfilePage.xaml | 54 ++++- .../Pages/UserProfile/UserProfilePage.xaml.cs | 29 ++- .../UserProfile/UserProfileViewModel.cs | 219 ++++++++++++++++++ 10 files changed, 367 insertions(+), 57 deletions(-) create mode 100644 BookAStar/BookAStar/ViewModels/UserProfile/UserProfileViewModel.cs diff --git a/BookAStar/BookAStar.Droid/BookAStar.Droid.csproj b/BookAStar/BookAStar.Droid/BookAStar.Droid.csproj index 66be7693..7c1f681d 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 diff --git a/BookAStar/BookAStar.Droid/Properties/AndroidManifest.xml b/BookAStar/BookAStar.Droid/Properties/AndroidManifest.xml index fbc04fe9..6ece6f55 100644 --- a/BookAStar/BookAStar.Droid/Properties/AndroidManifest.xml +++ b/BookAStar/BookAStar.Droid/Properties/AndroidManifest.xml @@ -1,7 +1,7 @@  - + @@ -11,13 +11,13 @@ - + - + diff --git a/BookAStar/BookAStar.Droid/Resources/Resource.Designer.cs b/BookAStar/BookAStar.Droid/Resources/Resource.Designer.cs index 7be6d2f1..7c7f592d 100644 --- a/BookAStar/BookAStar.Droid/Resources/Resource.Designer.cs +++ b/BookAStar/BookAStar.Droid/Resources/Resource.Designer.cs @@ -5341,26 +5341,26 @@ namespace BookAStar.Droid // aapt resource value: 0x7f07004c public const int ApplicationName = 2131165260; - // aapt resource value: 0x7f070061 - public const int Date = 2131165281; + // aapt resource value: 0x7f070062 + public const int Date = 2131165282; - // aapt resource value: 0x7f070060 - public const int Description = 2131165280; + // aapt resource value: 0x7f070061 + public const int Description = 2131165281; // aapt resource value: 0x7f07004b public const int Hello = 2131165259; - // aapt resource value: 0x7f070062 - public const int Location = 2131165282; - // aapt resource value: 0x7f070063 - public const int Pricing = 2131165283; + public const int Location = 2131165283; - // aapt resource value: 0x7f07005e - public const int Settings = 2131165278; + // aapt resource value: 0x7f070064 + public const int Pricing = 2131165284; // aapt resource value: 0x7f07005f - public const int Title = 2131165279; + public const int Settings = 2131165279; + + // aapt resource value: 0x7f070060 + public const int Title = 2131165280; // aapt resource value: 0x7f070034 public const int abc_action_bar_home_description = 2131165236; @@ -5437,8 +5437,8 @@ namespace BookAStar.Droid // aapt resource value: 0x7f070049 public const int bottom_sheet_behavior = 2131165257; - // aapt resource value: 0x7f07005d - public const int cancel = 2131165277; + // aapt resource value: 0x7f07005e + public const int cancel = 2131165278; // aapt resource value: 0x7f07004a public const int character_counter_pattern = 2131165258; @@ -5548,8 +5548,8 @@ namespace BookAStar.Droid // aapt resource value: 0x7f070052 public const int fullscreen_button = 2131165266; - // aapt resource value: 0x7f070067 - public const int google_app_id = 2131165287; + // aapt resource value: 0x7f070068 + public const int google_app_id = 2131165288; // aapt resource value: 0x7f07004f public const int invalid_date = 2131165263; @@ -5614,8 +5614,8 @@ namespace BookAStar.Droid // aapt resource value: 0x7f070055 public const int pause = 2131165269; - // aapt resource value: 0x7f070066 - public const int picture = 2131165286; + // aapt resource value: 0x7f070067 + public const int picture = 2131165287; // aapt resource value: 0x7f070056 public const int seekbar = 2131165270; @@ -5623,6 +5623,9 @@ namespace BookAStar.Droid // aapt resource value: 0x7f070057 public const int select_an_action = 2131165271; + // aapt resource value: 0x7f07005b + public const int send_to_app_name = 2131165275; + // aapt resource value: 0x7f070047 public const int status_bar_notification_info_overflow = 2131165255; @@ -5638,17 +5641,17 @@ namespace BookAStar.Droid // aapt resource value: 0x7f070059 public const int time_duration = 2131165273; - // aapt resource value: 0x7f070064 - public const int url = 2131165284; - // aapt resource value: 0x7f070065 - public const int url_hint = 2131165285; + public const int url = 2131165285; - // aapt resource value: 0x7f07005c - public const int yavscAccountTypeName = 2131165276; + // aapt resource value: 0x7f070066 + public const int url_hint = 2131165286; - // aapt resource value: 0x7f07005b - public const int yavscIdentRemoved = 2131165275; + // aapt resource value: 0x7f07005d + public const int yavscAccountTypeName = 2131165277; + + // aapt resource value: 0x7f07005c + public const int yavscIdentRemoved = 2131165276; static String() { diff --git a/BookAStar/BookAStar.Droid/Resources/values/strings.xml b/BookAStar/BookAStar.Droid/Resources/values/strings.xml index 43cdc6cd..2eb87da7 100644 --- a/BookAStar/BookAStar.Droid/Resources/values/strings.xml +++ b/BookAStar/BookAStar.Droid/Resources/values/strings.xml @@ -1,6 +1,7 @@  Booking star + Vers les étoiles Identification supprimée Booking star Annuler diff --git a/BookAStar/BookAStar/App.xaml.cs b/BookAStar/BookAStar/App.xaml.cs index b5a00742..ed96d59b 100644 --- a/BookAStar/BookAStar/App.xaml.cs +++ b/BookAStar/BookAStar/App.xaml.cs @@ -1,4 +1,8 @@ using System; +using Microsoft.AspNet.SignalR.Client; +using System.Net; +using System.Linq; +using System.Threading.Tasks; using Xamarin.Forms; using XLabs.Forms.Mvvm; using XLabs.Forms.Pages; @@ -12,20 +16,17 @@ using XLabs.Enums; namespace BookAStar { - using System.Threading.Tasks; using Data; using Interfaces; using Model; using Model.UI; using Pages; using Plugin.Connectivity; - using Microsoft.AspNet.SignalR.Client; using Model.Social.Messaging; using ViewModels.Messaging; using ViewModels.UserProfile; using Pages.UserProfile; using ViewModels.EstimateAndBilling; - using System.Net; public partial class App : Application // superclass new in 1.3 { @@ -149,6 +150,7 @@ namespace BookAStar ViewFactory.Register(); ViewFactory.Register(); ViewFactory.Register(); + ViewFactory.Register(); ConfigManager = new GenericConfigSettingsMgr(s => MainSettings.AppSettings.GetValueOrDefault(s, MainSettings.SettingsDefault), null); } @@ -174,7 +176,20 @@ namespace BookAStar BookQueriesPage bQueriesPage; AccountChooserPage accChooserPage; - HomePage home; + HomePage homePage; + UserProfilePage userProfilePage; + ChatPage chatPage; + + private void ShowPage(Page page) + { + if (masterDetail.Detail.Navigation.NavigationStack.Contains(page)) + { + if (masterDetail.Detail.Navigation.NavigationStack.Last() == page) return; + masterDetail.Detail.Navigation.RemovePage(page); + page.Parent = null; + } + masterDetail.Detail.Navigation.PushAsync(page); + } private void BuildMainPage() { @@ -186,9 +201,15 @@ namespace BookAStar Icon = "icon.png", BindingContext = new BookQueriesViewModel() }; - - home = new HomePage() { Title = "Accueil", Icon = "icon.png" }; - + homePage = new HomePage() { Title = "Accueil", Icon = "icon.png" }; + userProfilePage = new UserProfilePage { Title = "Profile utilisateur", Icon = "ic_corp_icon.png", + BindingContext = new UserProfileViewModel() }; + chatPage = new ChatPage + { + Title = "Chat", + Icon = "", + BindingContext = new ChatViewModel() + }; // var mainPage = new NavigationPage(bQueriesPage); masterDetail = new ExtendedMasterDetailPage() @@ -202,17 +223,18 @@ namespace BookAStar BindingContext = new DashboardViewModel() }; - // masterDetail.Detail = home; - masterDetail.Detail = new NavigationPage(home); + masterDetail.Detail = new NavigationPage(homePage); ToolbarItem tiSetts = new ToolbarItem() { // FIXME what for? Priority = 0, Text = "Paramètres", Icon = "ic_corp_icon.png", Command = new Command( - () => { NavigationService.NavigateTo(); } - ) + () => + { + ShowPage(userProfilePage); + } ) }; ToolbarItem tiHome = new ToolbarItem() @@ -220,8 +242,9 @@ namespace BookAStar Text = "Accueil", Icon = "icon.png", Command = new Command( - () => { NavigationService.NavigateTo(); } - ) + () => { + ShowPage(homePage); + }) }; ToolbarItem tiPubChat= new ToolbarItem() @@ -229,7 +252,7 @@ namespace BookAStar Text = "Chat", Icon = "chat_icon_s.png", Command = new Command( - () => { NavigationService.NavigateTo(); } + () => { ShowPage(chatPage); } ) }; masterDetail.ToolbarItems.Add(tiHome); @@ -259,11 +282,6 @@ namespace BookAStar } - private void TiPubChat_Clicked(object sender, EventArgs e) - { - - } - public static INavigationService NavigationService { protected set; get; } public static bool isConnected; public static bool IsConnected { get { return isConnected; } diff --git a/BookAStar/BookAStar/BookAStar.csproj b/BookAStar/BookAStar/BookAStar.csproj index e8deb46c..ee39eae4 100644 --- a/BookAStar/BookAStar/BookAStar.csproj +++ b/BookAStar/BookAStar/BookAStar.csproj @@ -81,6 +81,7 @@ + @@ -249,7 +250,7 @@ True - ..\..\..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v6.0\Mono.Android.dll + ..\..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v7.0\Mono.Android.dll ..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll 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 @@