Version 3.0.346

This commit is contained in:
Oliver Hauff 2022-10-17 18:45:38 +02:00
parent 1ba809dd59
commit 47c03f43fb
43 changed files with 609 additions and 117 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.hauffware.sharee" android:versionName="3.0.345" android:versionCode="345">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.hauffware.sharee" android:versionName="3.0.346" android:versionCode="346">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" />
<!-- Google Maps related permissions -->
<!-- Permission to receive remote notifications from Google Play Services -->

View file

@ -55,8 +55,8 @@
<key>CFBundleDisplayName</key>
<string>sharee.bike</string>
<key>CFBundleVersion</key>
<string>345</string>
<string>346</string>
<key>CFBundleShortVersionString</key>
<string>3.0.345</string>
<string>3.0.346</string>
</dict>
</plist>

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
@ -19,6 +19,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
@ -83,6 +84,7 @@ namespace TINK
settings = new Model.Settings.Settings(
null, // Turn off filtering for sharee.bike- context
null, // Turn off filtering for sharee.bike- context
JsonSettingsDictionary.GetStartupSettings(settingsJSON) ?? new StartupSettings(),
JsonSettingsDictionary.GetCopriHostUri(settingsJSON),
JsonSettingsDictionary.GetPollingParameters(settingsJSON),
JsonSettingsDictionary.GetMinimumLoggingLevel(settingsJSON),
@ -196,10 +198,17 @@ 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.
// Check which page to show first.
var mainPage = new View.RootShell.AppShell();
var currentItem = Activator.CreateInstance(ModelRoot.StartupSettings.StartupPage.GetViewType()) as ContentPage;
if (currentItem != null && ModelRoot.ActiveUser.IsLoggedIn)
{
mainPage.CurrentItem = currentItem;
}
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
? new View.WhatsNew.WhatsNewPage(() => MainPage = mainPage) // Show whats new info.
: (Page)mainPage; // Just start sharee- app
#endif
}

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Threading;
using System.Threading.Tasks;
using Serilog;
@ -17,6 +17,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>
@ -69,12 +74,43 @@ namespace TINK.View.FindBike
InitializeComponent();
BindingContext = m_oViewModel;
FindBikeListView.ItemsSource = m_oViewModel;
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.
@ -148,4 +184,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
}
}
}

View file

@ -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();
}
}
}
}

View file

@ -59,10 +59,20 @@
</ListView>
</StackLayout>
</Frame>
<Frame
<!-- Picker to selct startup page -->
<Frame>
<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
IsVisible="{Binding DebugLevel, Converter={StaticResource SwitchTheme_Converter}}"
Text="Theme"/>
@ -235,4 +245,4 @@
</Frame>
</ScrollView>
</ContentPage.Content>
</ContentPage>
</ContentPage>

View file

@ -1,7 +1,8 @@
using System;
using System;
using TINK.View.BikesAtStation;
using TINK.View.Contact;
using TINK.View.CopriWebView;
using TINK.View.FindBike;
using TINK.View.Info;
using TINK.View.Info.BikeInfo;
using TINK.View.Login;
@ -69,6 +70,9 @@ namespace TINK.View
case ViewTypes.MiniSurvey:
return typeof(MiniSurveyPage);
case ViewTypes.FindBikePage:
return typeof(FindBikePage);
default:
return typeof(ContentPage);
}