mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-22 12:56:29 +02:00
Version 3.0.346
This commit is contained in:
parent
1ba809dd59
commit
47c03f43fb
43 changed files with 609 additions and 117 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
|||
/// <summary> Refernce to view model. </summary>
|
||||
FindBikePageViewModel m_oViewModel = null;
|
||||
|
||||
/// <summary>
|
||||
/// Holds a value indicating whether page already subscribed to shell item changes or not.
|
||||
/// </summary>
|
||||
private bool _IsShellItemChangedReceived = false;
|
||||
|
||||
public FindBikePage() { }
|
||||
|
||||
/// <summary>
|
||||
|
@ -76,6 +81,35 @@ namespace TINK.View.FindBike
|
|||
await m_oViewModel.OnAppearing();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when page is disappearing to
|
||||
/// - stop the update process
|
||||
/// - to subscribe to events.
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Displays alert message.
|
||||
|
@ -149,4 +183,4 @@ namespace TINK.View.FindBike
|
|||
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync<FeedbackPopup.Result>(new FeedbackPopup(battery, co2Saving));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
/// </summary>
|
||||
protected override async void OnDisappearing()
|
||||
protected async override void OnDisappearing()
|
||||
{
|
||||
if (MapPageViewModel != null)
|
||||
{
|
||||
|
@ -278,4 +278,4 @@ namespace TINK.View.Map
|
|||
base.OnDisappearing();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,11 +59,21 @@
|
|||
</ListView>
|
||||
</StackLayout>
|
||||
</Frame>
|
||||
<Frame
|
||||
<!-- Picker to selct startup page -->
|
||||
<Frame IsVisible="False">
|
||||
<StackLayout>
|
||||
<Label Text="{x:Static resources:AppResources.MarkingStartupPage}"/>
|
||||
<Picker
|
||||
ItemsSource="{Binding StartupSettings.ServicesTextList}"
|
||||
SelectedItem="{Binding StartupSettings.ActiveText}"/>
|
||||
</StackLayout>
|
||||
</Frame>
|
||||
<!-- Themes -->
|
||||
<Frame
|
||||
IsVisible="{Binding DebugLevel, Converter={StaticResource SwitchTheme_Converter}}">
|
||||
<StackLayout>
|
||||
<!-- Themes -->
|
||||
<Label
|
||||
<StackLayout>
|
||||
|
||||
<Label
|
||||
IsVisible="{Binding DebugLevel, Converter={StaticResource SwitchTheme_Converter}}"
|
||||
Text="Theme"/>
|
||||
<Picker
|
||||
|
@ -235,4 +245,4 @@
|
|||
</Frame>
|
||||
</ScrollView>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
||||
</ContentPage>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue