diff --git a/TINK.sln b/TINK.sln
index f0ba85d..8502e93 100644
--- a/TINK.sln
+++ b/TINK.sln
@@ -24,6 +24,11 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestLockItBLE", "TestLockItBLE\TestLockItBLE.csproj", "{2581E9AD-4F56-431A-AB87-1B6D80D546AA}"
EndProject
Global
+ GlobalSection(SharedMSBuildProjectFiles) = preSolution
+ TINK\TINK\TINK.projitems*{5297504f-603f-4e1a-98aa-57c4a0d9d833}*SharedItemsImports = 13
+ TINK\TINK\TINK.projitems*{62b8950a-70b8-4f9d-affc-0a1ebe7bc9e7}*SharedItemsImports = 4
+ TINK\TINK\TINK.projitems*{f2d8208f-a8bf-4403-b0ae-2a1d270e4dc9}*SharedItemsImports = 4
+ EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
Ad-Hoc|ARM = Ad-Hoc|ARM
diff --git a/TINK/TINK.Android/Model/Device/Device.cs b/TINK/TINK.Android/Model/Device/Device.cs
index 3ee8aaf..7a40528 100644
--- a/TINK/TINK.Android/Model/Device/Device.cs
+++ b/TINK/TINK.Android/Model/Device/Device.cs
@@ -18,6 +18,6 @@ namespace TINK.Droid.Model.Device
/// Gets unitque device identifier.
/// Gets the identifies specifying device.
public string Identifier
- => Android.Provider.Settings.Secure.GetString(Forms.Context.ContentResolver, Android.Provider.Settings.Secure.AndroidId);
+ => Android.Provider.Settings.Secure.GetString(Android.App.Application.Context.ContentResolver, Android.Provider.Settings.Secure.AndroidId);
}
}
\ No newline at end of file
diff --git a/TINK/TINK.Android/Model/Device/Gps.cs b/TINK/TINK.Android/Model/Device/Gps.cs
index 6766b44..dfa055f 100644
--- a/TINK/TINK.Android/Model/Device/Gps.cs
+++ b/TINK/TINK.Android/Model/Device/Gps.cs
@@ -22,7 +22,7 @@ namespace TINK.Droid.Model.Device
{
get
{
- LocationManager locationManager = (LocationManager)Forms.Context.GetSystemService(Context.LocationService);
+ LocationManager locationManager = (LocationManager)Android.App.Application.Context.GetSystemService(Context.LocationService);
return locationManager.IsProviderEnabled(LocationManager.GpsProvider);
}
}
diff --git a/TINK/TINK.Android/Properties/AndroidManifest.xml b/TINK/TINK.Android/Properties/AndroidManifest.xml
index 8b2af09..1fd5d5f 100644
--- a/TINK/TINK.Android/Properties/AndroidManifest.xml
+++ b/TINK/TINK.Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/TINK/TINK.iOS/Info.plist b/TINK/TINK.iOS/Info.plist
index 2323370..ff15e25 100644
--- a/TINK/TINK.iOS/Info.plist
+++ b/TINK/TINK.iOS/Info.plist
@@ -32,25 +32,27 @@
TINK
XSAppIconAssets
Media.xcassets/AppIcons.appiconset
- NSBluetoothAlwaysUsageDescription
- Communicate with Bluetooth lock.
- NSBluetoothPeripheralUsageDescription
- Communicate with Bluetooth lock.
- NSLocationAlwaysUsageDescription
- Show map at current positon and pass positon to server when returning bike.
+
+ NSBluetoothAlwaysUsageDescription
+ Is required to communicate with Bluetooth lock.
+
+ NSBluetoothPeripheralUsageDescription
+ Is required to communicate with Bluetooth lock.
+ NSLocationAlwaysUsageDescription
+ Is required to show map at current position and pass position to server when returning bike.
NSLocationAlwaysAndWhenInUseUsageDescription
- Show map at current positon and pass positon to server when returning bike.
+ Is required to show map at current position and pass position to server when returning bike.
CFBundleIdentifier
com.TeilRad.sharee.bike
MinimumOSVersion
9.0
NSLocationWhenInUseUsageDescription
- Show map at current positon and pass positon to server when returning bike.
+ Is required to show map at current position and pass position to server when returning bike.
CFBundleDisplayName
sharee.bike
CFBundleVersion
- 243
+ 244
CFBundleShortVersionString
- 3.0.241
+ 3.0.244
diff --git a/TINK/TINK/App.xaml.cs b/TINK/TINK/App.xaml.cs
index d5c1360..914da9a 100644
--- a/TINK/TINK/App.xaml.cs
+++ b/TINK/TINK/App.xaml.cs
@@ -127,21 +127,7 @@ namespace TINK
if (lastVersion > new Version(3, 0, 173))
GeolocationServicesContainer.SetActive(settings.ActiveGeolocationService);
- if (new Version(0, 0, 0) < lastVersion
- && lastVersion <= new Version(3, 0, 234))
- {
- // Version 3.0.245 and older used Xamarin.Auth.AccountStore to securely store data.
- // Later version s use Xamarin.Essentials Secure Storage.
- store = new StoreLegacy(settings.ActiveUri.GetHashCode().ToString());
- }
- else
- {
- // Either
- // - frist install or
- // - version whitch uses secure storage
- // detected.
- store = new Store();
- }
+ store = new Store();
Barrel.ApplicationId = "TINKApp";
@@ -184,12 +170,7 @@ namespace TINK
{
InitializeComponent();
-#if USEMASTERDETAIL
- // Use master detail page.
- MainPage = ModelRoot.WhatsNew.IsShowRequired
- ? new View.WhatsNew.WhatsNewPage(() => MainPage = new View.MainPage()) // Show whats new info.
- : (Page) new View.MainPage(); // Just use TINKApp
-#elif USEFLYOUT
+#if USEFLYOUT
// Use flyout page.
MainPage = ModelRoot.WhatsNew.IsShowRequired
? new View.WhatsNew.WhatsNewPage(() => MainPage = new View.Root.RootPage()) // Show whats new info.
diff --git a/TINK/TINK/BackdoorMethodHelpers.cs b/TINK/TINK/BackdoorMethodHelpers.cs
index 1ab4636..c151820 100644
--- a/TINK/TINK/BackdoorMethodHelpers.cs
+++ b/TINK/TINK/BackdoorMethodHelpers.cs
@@ -26,7 +26,12 @@ namespace TINK
///
static Page GetCurrentPage()
{
- return (Application.Current.MainPage as MasterDetailPage)?.Detail.Navigation.NavigationStack.LastOrDefault();
+
+#if USEFLYOUT
+ return (Application.Current.MainPage as FlyoutPage)?.Detail.Navigation.NavigationStack.LastOrDefault();
+#else
+ return (Application.Current.MainPage as AppShellViewModel)?.Detail.Navigation.NavigationStack.LastOrDefault();
+#endif
}
}
diff --git a/TINK/TINK/Model/User/Account/Store.cs b/TINK/TINK/Model/User/Account/Store.cs
deleted file mode 100644
index 9c63773..0000000
--- a/TINK/TINK/Model/User/Account/Store.cs
+++ /dev/null
@@ -1,116 +0,0 @@
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using TINK.Model.Connector;
-
-namespace TINK.Model.User.Account
-{
- public class StoreLegacy : IStore
- {
- ///
- /// Holds the name of the application.
- ///
- private const string M_STR_APPNAME = "TINKApp";
-
- /// Holds the id of the session.
- private const string KEY_SESSIONID = "SessionId";
-
- /// Holds the id of the session.
- private const string KEY_GROUP = "Group";
-
- /// Holds the id of the session.
- private const string KEY_DEBUGLEVEL = "DebugLevel";
-
- public StoreLegacy(string copriHostHash)
- {
- m_strCopriHostHash = copriHostHash
- ?? throw new ArgumentException("Can not construct account object. Copri hash must not be null.");
- }
-
- private string m_strCopriHostHash;
-
- ///
- /// Reads mail address and password from account store.
- ///
- ///
- public async Task Load()
- {
-#if !WINDOWS_UWP
-#if !__IOS__
- var xamAccountStore = Xamarin.Auth.AccountStore.Create("System.Char[]").FindAccountsForService($"{M_STR_APPNAME}_{m_strCopriHostHash}").FirstOrDefault();
-#else
- var xamAccountStore = Xamarin.Auth.AccountStore.Create().FindAccountsForService($"{M_STR_APPNAME}_{m_strCopriHostHash}").FirstOrDefault();
-#endif
- if (xamAccountStore == null)
- {
- // Nothing t do if account cannot be accessed.
- return new EmptyAccount();
- }
-
- return new Account(
- xamAccountStore.Username,
- string.Empty,
- xamAccountStore.Properties.ContainsKey(KEY_SESSIONID) ? xamAccountStore.Properties[KEY_SESSIONID] : null,
- xamAccountStore.Properties.ContainsKey(KEY_GROUP) && !string.IsNullOrEmpty(xamAccountStore.Properties[KEY_GROUP]) ? JsonConvert.DeserializeObject>(xamAccountStore.Properties[KEY_GROUP]) : new string[0],
- xamAccountStore.Properties.ContainsKey(KEY_DEBUGLEVEL) && !string.IsNullOrEmpty(xamAccountStore.Properties[KEY_DEBUGLEVEL]) ? Permissions.Parse(xamAccountStore.Properties[KEY_DEBUGLEVEL]) : Permissions.None);
-#else
- return new Account(
- string.Empty,
- string.Empty,
- string.Empty,
- new List(),
- null);
-
-#endif
- }
-
- ///
- /// Writes mail address and password to account store.
- ///
- ///
- public async Task Save(IAccount account)
- {
-#if !WINDOWS_UWP
- Xamarin.Auth.Account xamAccount = new Xamarin.Auth.Account
- {
- Username = account.Mail
- };
-
- xamAccount.Properties.Add(KEY_SESSIONID, account?.SessionCookie);
- xamAccount.Properties.Add(KEY_GROUP, JsonConvert.SerializeObject(account?.Group ?? new string[0]));
- xamAccount.Properties.Add(KEY_DEBUGLEVEL, account.DebugLevel.ToString());
-#if !__IOS__
- Xamarin.Auth.AccountStore.Create("System.Char[]").Save(xamAccount, $"{M_STR_APPNAME}_{m_strCopriHostHash}");
-#else
- Xamarin.Auth.AccountStore.Create().Save(xamAccount, $"{M_STR_APPNAME}_{m_strCopriHostHash}");
-#endif
-#endif
- }
-
- ///
- /// Deletes mail address and password from account store.
- ///
- public IAccount Delete(IAccount account)
- {
-#if !WINDOWS_UWP
-#if !__IOS__
- var xamAccountStore = Xamarin.Auth.AccountStore.Create("System.Char[]").FindAccountsForService($"{M_STR_APPNAME}_{m_strCopriHostHash}").FirstOrDefault();
-#else
- var xamAccountStore = Xamarin.Auth.AccountStore.Create().FindAccountsForService($"{M_STR_APPNAME}_{m_strCopriHostHash}").FirstOrDefault();
-#endif
- if (xamAccountStore == null)
- {
- return new EmptyAccount();
- }
-#if !__IOS__
- Xamarin.Auth.AccountStore.Create("System.Char[]").Delete(xamAccountStore, $"{M_STR_APPNAME}_{m_strCopriHostHash}");
-#else
- Xamarin.Auth.AccountStore.Create().Delete(xamAccountStore, $"{M_STR_APPNAME}_{m_strCopriHostHash}");
-#endif
-#endif
- return new EmptyAccount();
- }
- }
-}
diff --git a/TINK/TINK/TINK.projitems b/TINK/TINK/TINK.projitems
index 2ce4c27..c911b2f 100644
--- a/TINK/TINK/TINK.projitems
+++ b/TINK/TINK/TINK.projitems
@@ -99,10 +99,8 @@
WhatsNewPage.xaml
Code
-
-
BikesAtStationPage.xaml
Code
@@ -123,14 +121,6 @@
LoginPage.xaml
Code
-
- MainPage.xaml
- Code
-
-
- MasterPage.xaml
- Code
-
Code
@@ -181,18 +171,6 @@
MSBuild:UpdateDesignTimeXaml
-
-
- Designer
- MSBuild:UpdateDesignTimeXaml
-
-
-
-
- Designer
- MSBuild:UpdateDesignTimeXaml
-
-
Designer
diff --git a/TINK/TINK/View/Account/AccountPage.xaml.cs b/TINK/TINK/View/Account/AccountPage.xaml.cs
index 7f96747..9974c42 100644
--- a/TINK/TINK/View/Account/AccountPage.xaml.cs
+++ b/TINK/TINK/View/Account/AccountPage.xaml.cs
@@ -2,7 +2,7 @@
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using System.Threading.Tasks;
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
using TINK.View.MasterDetail;
#endif
using System;
@@ -12,7 +12,7 @@ using TINK.ViewModel.Account;
namespace TINK.View.Account
{
[XamlCompilation(XamlCompilationOptions.Compile)]
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
public partial class AccountPage : ContentPage, IViewService, IDetailPage
#else
public partial class AccountPage : ContentPage, IViewService
@@ -86,7 +86,7 @@ namespace TINK.View.Account
public new async Task DisplayActionSheet(String title, String cancel, String destruction, params String[] p_oButtons)
=> await base.DisplayActionSheet(title, cancel, destruction, p_oButtons);
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
///
/// Creates and a page an shows it.
///
@@ -108,7 +108,7 @@ namespace TINK.View.Account
public Task PopModalAsync()
=> throw new NotSupportedException();
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
/// Delegate to perform navigation.
private INavigationMasterDetail m_oNavigation;
diff --git a/TINK/TINK/View/BikesAtStation/BikesAtStationPage.xaml.cs b/TINK/TINK/View/BikesAtStation/BikesAtStationPage.xaml.cs
index 6a21237..74d357a 100644
--- a/TINK/TINK/View/BikesAtStation/BikesAtStationPage.xaml.cs
+++ b/TINK/TINK/View/BikesAtStation/BikesAtStationPage.xaml.cs
@@ -10,7 +10,7 @@ namespace TINK.View.BikesAtStation
using System.Threading;
using System.Threading.Tasks;
using TINK.Model.Device;
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
using TINK.View.MasterDetail;
#endif
using TINK.ViewModel;
@@ -25,7 +25,7 @@ using TINK.View.MasterDetail;
using Xamarin.CommunityToolkit.Extensions;
[XamlCompilation(XamlCompilationOptions.Compile)]
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
public partial class BikesAtStationPage : ContentPage, IViewService, IDetailPage
#else
public partial class BikesAtStationPage : ContentPage, IViewService
@@ -180,7 +180,7 @@ using TINK.View.MasterDetail;
=> await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", accept, cancel);
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
/// Creates and a page an shows it.
/// When user is not logged in navigation to Login page is supported.
/// Type of page to show.
@@ -209,7 +209,7 @@ using TINK.View.MasterDetail;
throw new NotImplementedException();
}
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
///
/// Delegate to perform navigation.
///
diff --git a/TINK/TINK/View/Contact/ContactPage.xaml.cs b/TINK/TINK/View/Contact/ContactPage.xaml.cs
index 54ae8b5..fe68c8a 100644
--- a/TINK/TINK/View/Contact/ContactPage.xaml.cs
+++ b/TINK/TINK/View/Contact/ContactPage.xaml.cs
@@ -47,8 +47,8 @@ namespace TINK.View.Contact
=> await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", accept, cancel);
#if USEMASTERDETAIL || USEFLYOUT
- public void ShowPage(ViewTypes p_oType, string title = null)
- => NavigationMasterDetail.ShowPage(p_oType.GetViewType(), title);
+ public void ShowPage(ViewTypes p_oType, string p_strTitle = null)
+ => throw new NotImplementedException();
#else
/// Shows a page.
/// Route of the page to show.
@@ -91,7 +91,7 @@ namespace TINK.View.Contact
public Task DisplayUserFeedbackPopup() => throw new NotSupportedException();
#endif
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
///
/// Delegate to perform navigation.
diff --git a/TINK/TINK/View/Contact/SelectStationPage.xaml.cs b/TINK/TINK/View/Contact/SelectStationPage.xaml.cs
index 2622290..ccc17fe 100644
--- a/TINK/TINK/View/Contact/SelectStationPage.xaml.cs
+++ b/TINK/TINK/View/Contact/SelectStationPage.xaml.cs
@@ -1,6 +1,6 @@
using System;
using System.Threading.Tasks;
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
using TINK.View.MasterDetail;
#endif
using Xamarin.Forms;
@@ -14,10 +14,10 @@ namespace TINK.View.Contact
using TINK.ViewModel.Contact;
[XamlCompilation(XamlCompilationOptions.Compile)]
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
public partial class SelectStationPage : ContentPage, IViewService, IDetailPage
#else
- public partial class MapPage : ContentPage, IViewService
+ public partial class SelectStationPage : ContentPage, IViewService
#endif
{
/// View model to notify about whether page appears or hides.
@@ -70,7 +70,7 @@ namespace TINK.View.Contact
public new async Task DisplayAlert(string title, string message, string accept, string cancel)
=> await App.Current.MainPage.DisplayAlert(title, message, accept, cancel);
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
///
/// Creates and a page an shows it.
///
@@ -96,17 +96,17 @@ namespace TINK.View.Contact
/// Page to display.
public async Task PushAsync(ViewTypes typeOfPage)
{
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
var page = Activator.CreateInstance(typeOfPage.GetViewType()) as IDetailPage;
#else
- var page = Activator.CreateInstance(p_oTypeOfPage.GetViewType());
+ var page = Activator.CreateInstance(typeOfPage.GetViewType());
#endif
if (page == null)
{
return;
}
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
page.NavigationMasterDetail = NavigationMasterDetail;
#endif
@@ -119,7 +119,7 @@ namespace TINK.View.Contact
public Task DisplayUserFeedbackPopup() => throw new NotSupportedException();
#endif
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
/// Delegate to perform navigation.
public INavigationMasterDetail NavigationMasterDetail { private get; set; }
@@ -159,7 +159,7 @@ namespace TINK.View.Contact
{
BindingContext = SelectStationPageViewModel;
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
SelectStationPageViewModel.NavigationMasterDetail = NavigationMasterDetail;
#endif
}
diff --git a/TINK/TINK/View/FindBike/FindBikePage.xaml.cs b/TINK/TINK/View/FindBike/FindBikePage.xaml.cs
index 786e030..44a86f0 100644
--- a/TINK/TINK/View/FindBike/FindBikePage.xaml.cs
+++ b/TINK/TINK/View/FindBike/FindBikePage.xaml.cs
@@ -114,7 +114,7 @@ namespace TINK.View.FindBike
public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strAccept, string p_strCancel)
=> await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strAccept, p_strCancel);
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
public void ShowPage(ViewTypes p_oType, string p_strTitle = null)
=> throw new NotImplementedException();
#else
diff --git a/TINK/TINK/View/Info/BikeInfo/BikeInfoCarouselPage.xaml.cs b/TINK/TINK/View/Info/BikeInfo/BikeInfoCarouselPage.xaml.cs
index 0505433..35c410e 100644
--- a/TINK/TINK/View/Info/BikeInfo/BikeInfoCarouselPage.xaml.cs
+++ b/TINK/TINK/View/Info/BikeInfo/BikeInfoCarouselPage.xaml.cs
@@ -1,6 +1,6 @@
using System;
using System.Threading.Tasks;
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
using TINK.View.MasterDetail;
#endif
using TINK.ViewModel;
@@ -11,7 +11,7 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.Info.BikeInfo
{
[XamlCompilation(XamlCompilationOptions.Compile)]
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
public partial class BikeInfoCarouselPage : CarouselPage, IViewService, IDetailPage
#else
public partial class BikeInfoCarouselPage : CarouselPage, IViewService
@@ -70,7 +70,7 @@ namespace TINK.View.Info.BikeInfo
return await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strAccept, p_strCancel);
}
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
///
/// Creates and a page an shows it.
///
@@ -104,7 +104,7 @@ namespace TINK.View.Info.BikeInfo
throw new NotImplementedException();
}
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
///
/// Delegate to perform navigation.
///
diff --git a/TINK/TINK/View/Login/LoginPage.xaml.cs b/TINK/TINK/View/Login/LoginPage.xaml.cs
index 169051b..427b1f4 100644
--- a/TINK/TINK/View/Login/LoginPage.xaml.cs
+++ b/TINK/TINK/View/Login/LoginPage.xaml.cs
@@ -1,7 +1,7 @@
using System;
using System.Threading.Tasks;
using TINK.Model.Device;
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
using TINK.View.MasterDetail;
#endif
using TINK.ViewModel;
@@ -11,7 +11,7 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.Login
{
[XamlCompilation(XamlCompilationOptions.Compile)]
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
public partial class LoginPage : ContentPage, IViewService, IDetailPage
#else
public partial class LoginPage : ContentPage, IViewService
@@ -65,7 +65,7 @@ namespace TINK.View.Login
public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
=> await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", accept, cancel);
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
///
/// Creates and a page an shows it.
///
@@ -98,7 +98,7 @@ namespace TINK.View.Login
await Navigation.PushAsync((Page)Activator.CreateInstance(p_oTypeOfPage.GetViewType()));
}
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
///
/// Delegate to perform navigation.
///
diff --git a/TINK/TINK/View/Map/MapPage.xaml.cs b/TINK/TINK/View/Map/MapPage.xaml.cs
index 1b9846c..f8907a1 100644
--- a/TINK/TINK/View/Map/MapPage.xaml.cs
+++ b/TINK/TINK/View/Map/MapPage.xaml.cs
@@ -1,6 +1,6 @@
using System;
using System.Threading.Tasks;
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
using TINK.View.MasterDetail;
#endif
using Xamarin.Forms;
@@ -12,7 +12,7 @@ namespace TINK.View.Map
using TINK.ViewModel.Map;
[XamlCompilation(XamlCompilationOptions.Compile)]
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
public partial class MapPage : ContentPage, IViewService, IDetailPage
#else
public partial class MapPage : ContentPage, IViewService
@@ -71,7 +71,7 @@ namespace TINK.View.Map
public new async Task DisplayAlert(string title, string message, string accept, string cancel)
=> await App.Current.MainPage.DisplayAlert(title, message, accept, cancel);
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
///
/// Creates and a page an shows it.
///
@@ -97,7 +97,7 @@ namespace TINK.View.Map
/// Page to display.
public async Task PushAsync(ViewTypes typeOfPage)
{
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
var page = Activator.CreateInstance(typeOfPage.GetViewType()) as IDetailPage;
#else
var page = Activator.CreateInstance(p_oTypeOfPage.GetViewType());
@@ -107,7 +107,7 @@ namespace TINK.View.Map
return;
}
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
page.NavigationMasterDetail = NavigationMasterDetail;
#endif
@@ -120,7 +120,7 @@ namespace TINK.View.Map
public Task DisplayUserFeedbackPopup() => throw new NotSupportedException();
#endif
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
/// Delegate to perform navigation.
public INavigationMasterDetail NavigationMasterDetail { private get; set; }
@@ -134,7 +134,7 @@ namespace TINK.View.Map
// Pass reference to member Navigation to show bikes at station x dialog.
try
{
- Log.ForContext().Verbose("Constructing map page view model.");
+ Log.ForContext().Verbose("Constructing map page view model.");
#if TRYNOTBACKSTYLE
MapPageViewModel = new MapPageViewModel();
@@ -151,7 +151,7 @@ namespace TINK.View.Map
} catch (Exception exception)
{
- Log.ForContext().Error("Constructing map page view model failed. {Exception}", exception);
+ Log.ForContext().Error("Constructing map page view model failed. {Exception}", exception);
return;
}
@@ -159,13 +159,13 @@ namespace TINK.View.Map
{
BindingContext = MapPageViewModel;
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
MapPageViewModel.NavigationMasterDetail = NavigationMasterDetail;
#endif
}
catch (Exception exception)
{
- Log.ForContext().Error("Setting binding/ navigaton on map page failed. {Exception}", exception);
+ Log.ForContext().Error("Setting binding/ navigaton on map page failed. {Exception}", exception);
return;
}
@@ -184,7 +184,7 @@ namespace TINK.View.Map
catch (Exception exception)
{
// Continue because styling is not essential.
- Log.ForContext().Error("IOS specific styling of map page failed. {Exception}", exception);
+ Log.ForContext().Error("IOS specific styling of map page failed. {Exception}", exception);
}
try
@@ -194,14 +194,14 @@ namespace TINK.View.Map
catch (Exception exception)
{
// Continue because styling is not essential.
- Log.ForContext().Error("Invoking OnAppearing of base failed. {Exception}", exception);
+ Log.ForContext().Error("Invoking OnAppearing of base failed. {Exception}", exception);
return;
}
try
{
// Pre move and scanle maps to avoid initial display of map in Rome.
- Log.ForContext().Verbose("Moving and scaling map.");
+ Log.ForContext().Verbose("Moving and scaling map.");
MapPageViewModel.MoveAndScale(
(mapSpan) => MyMap.MoveToRegion(mapSpan),
App.ModelRoot.Uris.ActiveUri,
@@ -210,17 +210,17 @@ namespace TINK.View.Map
catch(Exception exception)
{
// Continue because a map not beeing moved/ scaled is no reason for aborting startup.
- Log.ForContext().Error("Moving and scaling map failed. {Exception}", exception);
+ Log.ForContext().Error("Moving and scaling map failed. {Exception}", exception);
}
try
{
- Log.ForContext().Verbose("Invoking OnAppearing on map page view model.");
+ Log.ForContext().Verbose("Invoking OnAppearing on map page view model.");
await MapPageViewModel.OnAppearing();
}
catch (Exception exception)
{
- Log.ForContext().Error("Invoking OnAppearing on map page view model failed. {Exception}", exception);
+ Log.ForContext().Error("Invoking OnAppearing on map page view model failed. {Exception}", exception);
return;
}
}
diff --git a/TINK/TINK/View/MiniSurvey/MiniSurveyPage.xaml.cs b/TINK/TINK/View/MiniSurvey/MiniSurveyPage.xaml.cs
index 270797c..bb8fdb5 100644
--- a/TINK/TINK/View/MiniSurvey/MiniSurveyPage.xaml.cs
+++ b/TINK/TINK/View/MiniSurvey/MiniSurveyPage.xaml.cs
@@ -66,7 +66,7 @@ namespace TINK.View.MiniSurvey
public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strAccept, string p_strCancel)
=> await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strAccept, p_strCancel);
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
public void ShowPage(ViewTypes p_oType, string p_strTitle = null)
=> throw new NotImplementedException();
#else
diff --git a/TINK/TINK/View/MyBikes/MyBikesPage.xaml.cs b/TINK/TINK/View/MyBikes/MyBikesPage.xaml.cs
index eacd14c..e837768 100644
--- a/TINK/TINK/View/MyBikes/MyBikesPage.xaml.cs
+++ b/TINK/TINK/View/MyBikes/MyBikesPage.xaml.cs
@@ -2,7 +2,7 @@
using System;
using System.Threading;
using System.Threading.Tasks;
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
using TINK.View.MasterDetail;
#endif
using Xamarin.Forms;
@@ -138,7 +138,7 @@ namespace TINK.View.MyBikes
public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strAccept, string p_strCancel)
=> await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strAccept, p_strCancel);
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
public void ShowPage(ViewTypes p_oType, string p_strTitle = null)
=> throw new NotImplementedException();
#else
diff --git a/TINK/TINK/View/RootFlyout/RootPage.xaml.cs b/TINK/TINK/View/RootFlyout/RootPage.xaml.cs
index 92384ac..fda3c9f 100644
--- a/TINK/TINK/View/RootFlyout/RootPage.xaml.cs
+++ b/TINK/TINK/View/RootFlyout/RootPage.xaml.cs
@@ -1,6 +1,6 @@
using System;
using TINK.Model.Station;
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
using TINK.View.MasterDetail;
#endif
using Xamarin.Forms;
@@ -18,7 +18,7 @@ namespace TINK.View.Root
// - switch to login page form bikes at station page if not yet logged in
///
[XamlCompilation(XamlCompilationOptions.Compile)]
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
public partial class RootPage : FlyoutPage, INavigationMasterDetail
#else
public partial class RootPage : FlyoutPage
@@ -38,7 +38,7 @@ namespace TINK.View.Root
return;
}
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
var detailPage = navigationPage.RootPage as IDetailPage;
if (detailPage == null)
{
@@ -80,7 +80,7 @@ namespace TINK.View.Root
var page = (Page)Activator.CreateInstance(typeOfPage);
page.Title = title;
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
if (page is IDetailPage detailPage)
{
// Detail page needs reference to perform navigation.
diff --git a/TINK/TINK/View/RootFlyout/RootPageFlyout.xaml.cs b/TINK/TINK/View/RootFlyout/RootPageFlyout.xaml.cs
index 07b6781..5134fa0 100644
--- a/TINK/TINK/View/RootFlyout/RootPageFlyout.xaml.cs
+++ b/TINK/TINK/View/RootFlyout/RootPageFlyout.xaml.cs
@@ -8,7 +8,7 @@ using System.Text;
using System.Threading.Tasks;
using TINK.Model;
using TINK.Services;
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
using TINK.View.MasterDetail;
#endif
using TINK.View.Themes;
diff --git a/TINK/TINK/View/RootMasterDetail/MainPage.xaml b/TINK/TINK/View/RootMasterDetail/MainPage.xaml
deleted file mode 100644
index bf032bd..0000000
--- a/TINK/TINK/View/RootMasterDetail/MainPage.xaml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/TINK/TINK/View/RootMasterDetail/MainPage.xaml.cs b/TINK/TINK/View/RootMasterDetail/MainPage.xaml.cs
deleted file mode 100644
index d5bfb06..0000000
--- a/TINK/TINK/View/RootMasterDetail/MainPage.xaml.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-using System;
-using TINK.View.Info.BikeInfo;
-#if USEMASTERDETAIL || USEFLYOUT
-using TINK.View.MasterDetail;
-#endif
-using TINK.ViewModel.MasterDetail;
-using Xamarin.Forms;
-using Xamarin.Forms.Xaml;
-
-namespace TINK.View
-{
- ///
- /// Delegate to perform navigation.
- ///
- public delegate void ShowPageDelegate(Type p_oType, string p_strTitle = null);
-
- [XamlCompilation(XamlCompilationOptions.Compile)]
-#if USEMASTERDETAIL || USEFLYOUT
- public partial class MainPage : MasterDetailPage, INavigationMasterDetail
-#else
- public partial class MainPage : MasterDetailPage
-#endif
- {
- public MainPage()
- {
- InitializeComponent();
- MasterPage.ShowPageViewService = ShowPage;
-
- // Any type of split behaviour conflics with map shifting functionality.
- MasterBehavior = MasterBehavior.Popover;
-
- var navigationPage = Detail as NavigationPage;
- if (navigationPage == null)
- {
- return;
- }
-
-#if USEMASTERDETAIL || USEFLYOUT
- var detailPage = navigationPage.RootPage as IDetailPage;
- if (detailPage == null)
- {
- return;
- }
-
- detailPage.NavigationMasterDetail = this;
-#endif
- }
-
- /// Creates and a page an shows it.
- /// Type of page to show.
- public void ShowPage(
- Type p_oTypeOfPage,
- string p_strTitle = null)
- {
- if (p_oTypeOfPage == null)
- return;
-
- var page = (Page)Activator.CreateInstance(p_oTypeOfPage);
- page.Title = p_strTitle ?? Helper.GetCaption(p_oTypeOfPage);
-
-#if USEMASTERDETAIL || USEFLYOUT
- var l_oPage = page as IDetailPage;
- if (l_oPage != null)
- {
- l_oPage.NavigationMasterDetail = this;
- }
-#endif
-
-#if !BACKSTYLE
- // When bike info page is shown do not allow to close this carousel before all pages were displayed.
- IsGestureEnabled = p_oTypeOfPage != typeof(BikeInfoCarouselPage);
-
- Detail = new NavigationPage(page);
- IsPresented = false;
-#else
- Detail.Navigation.PushAsync(page);
- IsPresented = false;
-
- while (Detail.Navigation.NavigationStack.Count > 2)
- {
- // Ensure that stack does never contains more than 2 pages (root page + one child)
- // This can occure if from child via swipe onther child is opened.
- // Remove item after adding new one to avoid flickering.
- Detail.Navigation.RemovePage(Detail.Navigation.NavigationStack[1]);
- }
-#endif
-
- MasterPage.ListView.SelectedItem = null;
- }
- }
-}
\ No newline at end of file
diff --git a/TINK/TINK/View/RootMasterDetail/MasterPage.xaml b/TINK/TINK/View/RootMasterDetail/MasterPage.xaml
deleted file mode 100644
index 6b51ded..0000000
--- a/TINK/TINK/View/RootMasterDetail/MasterPage.xaml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/TINK/TINK/View/RootMasterDetail/MasterPage.xaml.cs b/TINK/TINK/View/RootMasterDetail/MasterPage.xaml.cs
deleted file mode 100644
index 5623e90..0000000
--- a/TINK/TINK/View/RootMasterDetail/MasterPage.xaml.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using TINK.ViewModel;
-using Xamarin.Forms;
-using Xamarin.Forms.Xaml;
-
-namespace TINK.View
-{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class MasterPage : ContentPage
- {
- public ListView ListView;
-
- ///
- /// Master page view model
- ///
- private MasterPageViewModel m_oMasterPageViewModel;
-
- /// Delegate to perform navigation between detail pages.
- public ShowPageDelegate ShowPageViewService { set => m_oMasterPageViewModel.ShowPageViewService = value; }
-
- public MasterPage()
- {
- InitializeComponent();
-
- m_oMasterPageViewModel = new MasterPageViewModel();
-
-
-
- BindingContext = m_oMasterPageViewModel;
- ListView = MenuItemsListView;
- }
- }
-}
\ No newline at end of file
diff --git a/TINK/TINK/View/Settings/SettingsPage.xaml.cs b/TINK/TINK/View/Settings/SettingsPage.xaml.cs
index e7f3907..050a8d9 100644
--- a/TINK/TINK/View/Settings/SettingsPage.xaml.cs
+++ b/TINK/TINK/View/Settings/SettingsPage.xaml.cs
@@ -2,7 +2,7 @@
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using System.Threading.Tasks;
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
using TINK.View.MasterDetail;
#endif
using System;
@@ -12,7 +12,7 @@ using Xamarin.CommunityToolkit.Extensions;
namespace TINK.View.Settings
{
[XamlCompilation(XamlCompilationOptions.Compile)]
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
public partial class SettingsPage : ContentPage, IViewService, IDetailPage
#else
public partial class SettingsPage : ContentPage, IViewService
@@ -88,7 +88,7 @@ namespace TINK.View.Settings
public new async Task DisplayActionSheet(String p_strTitle, String p_strCancel, String destruction, params String[] p_oButtons)
=> await base.DisplayActionSheet(p_strTitle, p_strCancel, destruction, p_oButtons);
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
///
/// Creates and a page an shows it.
///
@@ -110,7 +110,7 @@ namespace TINK.View.Settings
public Task PopModalAsync()
=> throw new NotSupportedException();
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
/// Delegate to perform navigation.
private INavigationMasterDetail m_oNavigation;
diff --git a/TINK/TINK/View/WhatsNew/Agb/AgbPage.xaml.cs b/TINK/TINK/View/WhatsNew/Agb/AgbPage.xaml.cs
index 4fbf17f..adbf981 100644
--- a/TINK/TINK/View/WhatsNew/Agb/AgbPage.xaml.cs
+++ b/TINK/TINK/View/WhatsNew/Agb/AgbPage.xaml.cs
@@ -63,7 +63,7 @@ namespace TINK.View.WhatsNew.Agb
public Task PushModalAsync(ViewTypes p_oTypeOfPage)
=> throw new NotImplementedException();
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
public void ShowPage(ViewTypes p_oType, string p_strTitle = null)
=> throw new NotImplementedException();
#else
diff --git a/TINK/TINK/View/WhatsNew/WhatsNewPage.xaml.cs b/TINK/TINK/View/WhatsNew/WhatsNewPage.xaml.cs
index 825ae8f..ade433a 100644
--- a/TINK/TINK/View/WhatsNew/WhatsNewPage.xaml.cs
+++ b/TINK/TINK/View/WhatsNew/WhatsNewPage.xaml.cs
@@ -67,7 +67,7 @@ namespace TINK.View.WhatsNew
await Navigation.PushModalAsync((Page)Activator.CreateInstance(p_oTypeOfPage.GetViewType()));
}
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
public void ShowPage(ViewTypes p_oType, string p_strTitle = null)
=> throw new NotImplementedException();
#else
diff --git a/TINK/TINK/ViewModel/RootFlyout/RootPageViewModel.cs b/TINK/TINK/ViewModel/RootFlyout/RootPageViewModel.cs
index a604d37..669132d 100644
--- a/TINK/TINK/ViewModel/RootFlyout/RootPageViewModel.cs
+++ b/TINK/TINK/ViewModel/RootFlyout/RootPageViewModel.cs
@@ -16,7 +16,7 @@ using TINK.View.Root;
using TINK.View.Settings;
using Xamarin.Forms;
using TINK.ViewModel.MasterDetail;
-#if USEMASTERDETAIL || USEFLYOUT
+#if USEFLYOUT
using TINK.View.MasterDetail;
#endif
using TINK.Services;
diff --git a/TINK/TINK/ViewModel/RootMasterDetail/MasterPageViewModel.cs b/TINK/TINK/ViewModel/RootMasterDetail/MasterPageViewModel.cs
deleted file mode 100644
index a82f5fc..0000000
--- a/TINK/TINK/ViewModel/RootMasterDetail/MasterPageViewModel.cs
+++ /dev/null
@@ -1,221 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Runtime.CompilerServices;
-using TINK.Services;
-using TINK.Services.CopriApi.ServerUris;
-using TINK.View;
-using TINK.View.Account;
-using TINK.View.Contact;
-using TINK.View.FindBike;
-using TINK.View.Info;
-using TINK.View.Login;
-using TINK.View.Map;
-using TINK.View.MyBikes;
-using TINK.View.Settings;
-using TINK.View.Themes;
-using Xamarin.Forms;
-
-namespace TINK.ViewModel
-{
- ///
- /// View model managing master detail menu.
- ///
- class MasterPageViewModel : INotifyPropertyChanged
- {
- ///
- /// Dictionary to manage collection of menu items.
- ///
- private Dictionary m_oEntryDictionary;
-
- /// Updates menu entries depending on state.
- private void UpdateMenuEntries()
- {
- var l_oSelectedMenuItem = SelectedMenuItem ?? new MainPageMenuItem(0, typeof(MapPage));
-
- for (int l_iIndex = MenuItems.Count - 1; l_iIndex >= 0; l_iIndex--)
- {
- MenuItems.Clear();
- m_oEntryDictionary.Clear();
- }
-
- CheckAddItem(typeof(MapPage));
-
- if (App.ModelRoot.ActiveUser.IsLoggedIn)
- {
- CheckAddItem(typeof(MyBikesPage));
- CheckAddItem(typeof(FindBikePage));
- CheckAddItem(typeof(AccountPage));
- }
- else
- {
- CheckAddItem(typeof(LoginPage));
- }
-
- if (App.ModelRoot.Uris.ActiveUri.Host.GetIsCopri()
- || App.ModelRoot.ActiveUser.IsLoggedIn)
- {
- CheckAddItem(typeof(SettingsPage));
- }
-
- CheckAddItem(typeof(FeesAndBikesPage)); // Fees and bikes
-
- CheckAddItem(typeof(ContactPage)); // Feedback and contact
-
- CheckAddItem(typeof(TabbedPageInfo)); // About sharee.bike
- }
-
- /// Adds a menu item to master detail menu.
- /// Type decribing entry to be added.
- private void CheckAddItem(Type p_oType)
- {
- if (m_oEntryDictionary.ContainsKey(p_oType))
- {
- // Nothing to do because has already been added.
- return;
- }
-
- m_oEntryDictionary.Add(
- p_oType,
- m_oEntryDictionary.Count);
-
- MenuItems.Add(
- new MainPageMenuItem(m_oEntryDictionary[p_oType],
- p_oType));
- }
-
- /// Removes a page from menu.
- ///
- private void RemoveItem(Type p_oType)
- {
- if (!m_oEntryDictionary.ContainsKey(p_oType))
- {
- // Nothing to do because item was never added/ already removed.
- return;
- }
-
- MenuItems.Remove(MenuItems[m_oEntryDictionary[p_oType]]);
- m_oEntryDictionary.Remove(p_oType);
- }
-
- public MasterPageViewModel()
- {
- MenuItems = new ObservableCollection();
- m_oEntryDictionary = new Dictionary();
-
- App.ModelRoot.ActiveUser.StateChanged += (sender, eventargs) => OnUpdateRequired();
-
- // Update flyout view model whenever theme is switched.
- App.ModelRoot.Themes.PropertyChanged += (sender, eventargs) =>
- {
- if (!(sender is ServicesContainerMutable