diff --git a/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml b/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml index 296b0fd..ba09c9d 100644 --- a/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml +++ b/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@  - + diff --git a/LastenradBayern/TINK.iOS/Info.plist b/LastenradBayern/TINK.iOS/Info.plist index c55a260..e1d0af6 100644 --- a/LastenradBayern/TINK.iOS/Info.plist +++ b/LastenradBayern/TINK.iOS/Info.plist @@ -55,8 +55,8 @@ CFBundleDisplayName LastenradBayern CFBundleVersion - 345 + 346 CFBundleShortVersionString - 3.0.345 + 3.0.346 diff --git a/LastenradBayern/TINK/App.xaml.cs b/LastenradBayern/TINK/App.xaml.cs index a9dd07a..19ab9ee 100644 --- a/LastenradBayern/TINK/App.xaml.cs +++ b/LastenradBayern/TINK/App.xaml.cs @@ -20,6 +20,7 @@ using TINK.Services; using TINK.Services.BluetoothLock.Crypto; using TINK.Services.Geolocation; using TINK.Services.Permissions; +using TINK.View; using Xamarin.Forms; using Xamarin.Forms.Xaml; #if ARENDI @@ -84,6 +85,7 @@ namespace TINK settings = new Model.Settings.Settings( null, // Turn off filtering for LastenradBayern- context null, // Turn off filtering for LastenradBayern- context + JsonSettingsDictionary.GetStartupSettings(settingsJSON) ?? new StartupSettings(), JsonSettingsDictionary.GetCopriHostUri(settingsJSON), JsonSettingsDictionary.GetPollingParameters(settingsJSON), JsonSettingsDictionary.GetMinimumLoggingLevel(settingsJSON), @@ -197,11 +199,12 @@ namespace TINK ? new View.WhatsNew.WhatsNewPage(() => MainPage = new View.Root.RootPage()) // Show whats new info. : (Page)new View.Root.RootPage(); // Just start sharee- app #else - // Use shell. - MainPage = ModelRoot.WhatsNew.IsShowRequired - ? new View.WhatsNew.WhatsNewPage(() => MainPage = new View.RootShell.AppShell()) // Show whats new info. - : (Page)new View.RootShell.AppShell(); // Just start sharee- app + // Check which page to show first. + var mainPage = new View.RootShell.AppShell(); + MainPage = ModelRoot.WhatsNew.IsShowRequired + ? new View.WhatsNew.WhatsNewPage(() => MainPage = mainPage) // Show whats new info. + : (Page)mainPage; // Just start sharee- app #endif } diff --git a/LastenradBayern/TINK/View/FindBike/FindBikePage.xaml.cs b/LastenradBayern/TINK/View/FindBike/FindBikePage.xaml.cs index f6aa134..2d4db6c 100644 --- a/LastenradBayern/TINK/View/FindBike/FindBikePage.xaml.cs +++ b/LastenradBayern/TINK/View/FindBike/FindBikePage.xaml.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading; using System.Threading.Tasks; using Serilog; @@ -18,6 +18,11 @@ namespace TINK.View.FindBike /// Refernce to view model. FindBikePageViewModel m_oViewModel = null; + /// + /// Holds a value indicating whether page already subscribed to shell item changes or not. + /// + private bool _IsShellItemChangedReceived = false; + public FindBikePage() { } /// @@ -76,6 +81,35 @@ namespace TINK.View.FindBike await m_oViewModel.OnAppearing(); } + /// + /// Invoked when page is disappearing to + /// - stop the update process + /// - to subscribe to events. + /// + protected async override void OnDisappearing() + { + if (!_IsShellItemChangedReceived && Shell.Current != null) + { + // Subscribe to events. + // Do not do this on startup because Shell.Current is null, if FindeBikePage is startup page. + Shell.Current.Navigated += (sender, e) => + { + if (e.Source != ShellNavigationSource.ShellItemChanged) + { + // Nothing to do. + return; + } + + // Reset previous user input after switch of pages to allow user to select a differnt bike if one has been selected before. + m_oViewModel.BikeIdUserInput = String.Empty; + }; + + } + + _IsShellItemChangedReceived = true; + + await (m_oViewModel?.OnDisappearing() ?? Task.CompletedTask); + } /// /// Displays alert message. @@ -149,4 +183,4 @@ namespace TINK.View.FindBike public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync(new FeedbackPopup(battery, co2Saving)); #endif } -} \ No newline at end of file +} diff --git a/LastenradBayern/TINK/View/Map/MapPage.xaml.cs b/LastenradBayern/TINK/View/Map/MapPage.xaml.cs index 5f147bf..1663f17 100644 --- a/LastenradBayern/TINK/View/Map/MapPage.xaml.cs +++ b/LastenradBayern/TINK/View/Map/MapPage.xaml.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; #if USEFLYOUT using TINK.View.MasterDetail; @@ -267,7 +267,7 @@ namespace TINK.View.Map /// Invoked when pages is closed/ hidden. /// Stops update process. /// - protected override async void OnDisappearing() + protected async override void OnDisappearing() { if (MapPageViewModel != null) { @@ -278,4 +278,4 @@ namespace TINK.View.Map base.OnDisappearing(); } } -} \ No newline at end of file +} diff --git a/LastenradBayern/TINK/View/Settings/SettingsPage.xaml b/LastenradBayern/TINK/View/Settings/SettingsPage.xaml index 0bd9a2b..de8c8fd 100644 --- a/LastenradBayern/TINK/View/Settings/SettingsPage.xaml +++ b/LastenradBayern/TINK/View/Settings/SettingsPage.xaml @@ -59,11 +59,21 @@ - + + + + + + - - -