Version 3.0.264

This commit is contained in:
Oliver Hauff 2021-12-08 18:08:58 +01:00
parent e5c09b9b8d
commit bf8e3fa73a
18 changed files with 199 additions and 100 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.TeilRad.LastenradBayern" android:versionName="3.0.263" android:versionCode="263">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.TeilRad.LastenradBayern" android:versionName="3.0.264" android:versionCode="264">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" />
<!-- Google Maps related permissions -->
<!-- Permission to receive remote notifications from Google Play Services -->

View file

@ -49,8 +49,8 @@
<key>CFBundleDisplayName</key>
<string>LastenradBayern</string>
<key>CFBundleVersion</key>
<string>263</string>
<string>264</string>
<key>CFBundleShortVersionString</key>
<string>3.0.263</string>
<string>3.0.264</string>
</dict>
</plist>

View file

@ -139,18 +139,11 @@ namespace TINK.View.Map
#if TRYNOTBACKSTYLE
MapPageViewModel = new MapPageViewModel();
#else
MapPageViewModel = new MapPageViewModel(
App.ModelRoot,
App.PermissionsService,
App.BluetoothService,
App.GeolocationServicesContainer.Active,
(mapspan) => MyMap.MoveToRegion(mapspan),
this,
Navigation);
MapPageViewModel = CreateMapPageViewModel();
#endif
} catch (Exception exception)
}
catch (Exception exception)
{
Log.ForContext<MapPage>().Error("Constructing map page view model failed. {Exception}", exception);
return;
}
@ -171,15 +164,7 @@ namespace TINK.View.Map
try
{
if (Device.RuntimePlatform == Device.iOS)
{
TINKButton.BackgroundColor = Color.LightGray;
TINKButton.BorderColor = Color.Black;
TINKButton.Margin = new Thickness(10, 10, 10, 10);
KonradButton.BackgroundColor = Color.LightGray;
KonradButton.BorderColor = Color.Black;
KonradButton.Margin = new Thickness(10, 10, 10, 10);
}
ApplyCustomiOSStyling();
}
catch (Exception exception)
{
@ -201,12 +186,9 @@ namespace TINK.View.Map
try
{
// Pre move and scanle maps to avoid initial display of map in Rome.
Log.ForContext<MapPage>().Verbose("Moving and scaling map.");
MapPageViewModel.MoveAndScale(
(mapSpan) => MyMap.MoveToRegion(mapSpan),
App.ModelRoot.MapSpan);
PremoveAndScaleMap();
}
catch(Exception exception)
catch (Exception exception)
{
// Continue because a map not beeing moved/ scaled is no reason for aborting startup.
Log.ForContext<MapPage>().Error("Moving and scaling map failed. {Exception}", exception);
@ -224,6 +206,49 @@ namespace TINK.View.Map
}
}
/// <summary>
/// Premoves the Map to a certain location.
/// </summary>
private void PremoveAndScaleMap()
{
Log.ForContext<MapPage>().Verbose("Moving and scaling map.");
MapPageViewModel.MoveAndScale(
(mapSpan) => MyMap.MoveToRegion(mapSpan),
App.ModelRoot.MapSpan);
}
/// <summary>
/// Creates the Map Page's view model.
/// </summary>
private MapPageViewModel CreateMapPageViewModel()
{
Log.ForContext<MapPage>().Verbose("Constructing map page view model.");
return new MapPageViewModel(
App.ModelRoot,
App.PermissionsService,
App.BluetoothService,
App.GeolocationServicesContainer.Active,
(mapspan) => MyMap.MoveToRegion(mapspan),
this,
Navigation);
}
/// <summary>
/// Applies iOS specific styling to branded Buttons.
/// </summary>
private void ApplyCustomiOSStyling()
{
if (Device.RuntimePlatform == Device.iOS)
{
TINKButton.BackgroundColor = Color.LightGray;
TINKButton.BorderColor = Color.Black;
TINKButton.Margin = new Thickness(10, 10, 10, 10);
KonradButton.BackgroundColor = Color.LightGray;
KonradButton.BorderColor = Color.Black;
KonradButton.Margin = new Thickness(10, 10, 10, 10);
}
}
/// <summary>
/// Invoked when pages is closed/ hidden.
/// Stops update process.

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.TeilRad.Meinkonrad" android:versionName="3.0.263" android:versionCode="263">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.TeilRad.Meinkonrad" android:versionName="3.0.264" android:versionCode="264">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" />
<!-- Google Maps related permissions -->
<!-- Permission to receive remote notifications from Google Play Services -->

View file

@ -49,8 +49,8 @@
<key>CFBundleDisplayName</key>
<string>Mein konrad</string>
<key>CFBundleVersion</key>
<string>263</string>
<string>264</string>
<key>CFBundleShortVersionString</key>
<string>3.0.263</string>
<string>3.0.264</string>
</dict>
</plist>

View file

@ -139,18 +139,11 @@ namespace TINK.View.Map
#if TRYNOTBACKSTYLE
MapPageViewModel = new MapPageViewModel();
#else
MapPageViewModel = new MapPageViewModel(
App.ModelRoot,
App.PermissionsService,
App.BluetoothService,
App.GeolocationServicesContainer.Active,
(mapspan) => MyMap.MoveToRegion(mapspan),
this,
Navigation);
MapPageViewModel = CreateMapPageViewModel();
#endif
} catch (Exception exception)
}
catch (Exception exception)
{
Log.ForContext<MapPage>().Error("Constructing map page view model failed. {Exception}", exception);
return;
}
@ -171,15 +164,7 @@ namespace TINK.View.Map
try
{
if (Device.RuntimePlatform == Device.iOS)
{
TINKButton.BackgroundColor = Color.LightGray;
TINKButton.BorderColor = Color.Black;
TINKButton.Margin = new Thickness(10, 10, 10, 10);
KonradButton.BackgroundColor = Color.LightGray;
KonradButton.BorderColor = Color.Black;
KonradButton.Margin = new Thickness(10, 10, 10, 10);
}
ApplyCustomiOSStyling();
}
catch (Exception exception)
{
@ -201,12 +186,9 @@ namespace TINK.View.Map
try
{
// Pre move and scanle maps to avoid initial display of map in Rome.
Log.ForContext<MapPage>().Verbose("Moving and scaling map.");
MapPageViewModel.MoveAndScale(
(mapSpan) => MyMap.MoveToRegion(mapSpan),
App.ModelRoot.MapSpan);
PremoveAndScaleMap();
}
catch(Exception exception)
catch (Exception exception)
{
// Continue because a map not beeing moved/ scaled is no reason for aborting startup.
Log.ForContext<MapPage>().Error("Moving and scaling map failed. {Exception}", exception);
@ -224,6 +206,49 @@ namespace TINK.View.Map
}
}
/// <summary>
/// Premoves the Map to a certain location.
/// </summary>
private void PremoveAndScaleMap()
{
Log.ForContext<MapPage>().Verbose("Moving and scaling map.");
MapPageViewModel.MoveAndScale(
(mapSpan) => MyMap.MoveToRegion(mapSpan),
App.ModelRoot.MapSpan);
}
/// <summary>
/// Creates the Map Page's view model.
/// </summary>
private MapPageViewModel CreateMapPageViewModel()
{
Log.ForContext<MapPage>().Verbose("Constructing map page view model.");
return new MapPageViewModel(
App.ModelRoot,
App.PermissionsService,
App.BluetoothService,
App.GeolocationServicesContainer.Active,
(mapspan) => MyMap.MoveToRegion(mapspan),
this,
Navigation);
}
/// <summary>
/// Applies iOS specific styling to branded Buttons.
/// </summary>
private void ApplyCustomiOSStyling()
{
if (Device.RuntimePlatform == Device.iOS)
{
TINKButton.BackgroundColor = Color.LightGray;
TINKButton.BorderColor = Color.Black;
TINKButton.Margin = new Thickness(10, 10, 10, 10);
KonradButton.BackgroundColor = Color.LightGray;
KonradButton.BorderColor = Color.Black;
KonradButton.Margin = new Thickness(10, 10, 10, 10);
}
}
/// <summary>
/// Invoked when pages is closed/ hidden.
/// Stops update process.

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="preferExternal" package="com.hauffware.sharee" android:versionName="3.0.263" android:versionCode="263">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.hauffware.sharee" android:versionName="3.0.264" android:versionCode="264">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" />
<!-- Google Maps related permissions -->
<!-- Permission to receive remote notifications from Google Play Services -->

View file

@ -49,8 +49,8 @@
<key>CFBundleDisplayName</key>
<string>sharee.bike</string>
<key>CFBundleVersion</key>
<string>263</string>
<string>264</string>
<key>CFBundleShortVersionString</key>
<string>3.0.263</string>
<string>3.0.264</string>
</dict>
</plist>

View file

@ -125,9 +125,8 @@ namespace TINK.View.Map
public INavigationMasterDetail NavigationMasterDetail { private get; set; }
#endif
/// <summary>
/// Invoked when page is shown.
/// Invoked when page is shown.
/// Starts update process.
/// </summary>
protected async override void OnAppearing()
@ -140,18 +139,11 @@ namespace TINK.View.Map
#if TRYNOTBACKSTYLE
MapPageViewModel = new MapPageViewModel();
#else
MapPageViewModel = new MapPageViewModel(
App.ModelRoot,
App.PermissionsService,
App.BluetoothService,
App.GeolocationServicesContainer.Active,
(mapspan) => MyMap.MoveToRegion(mapspan),
this,
Navigation);
MapPageViewModel = CreateMapPageViewModel();
#endif
} catch (Exception exception)
}
catch (Exception exception)
{
Log.ForContext<MapPage>().Error("Constructing map page view model failed. {Exception}", exception);
return;
}
@ -172,15 +164,7 @@ namespace TINK.View.Map
try
{
if (Device.RuntimePlatform == Device.iOS)
{
TINKButton.BackgroundColor = Color.LightGray;
TINKButton.BorderColor = Color.Black;
TINKButton.Margin = new Thickness(10, 10, 10, 10);
KonradButton.BackgroundColor = Color.LightGray;
KonradButton.BorderColor = Color.Black;
KonradButton.Margin = new Thickness(10, 10, 10, 10);
}
ApplyCustomiOSStyling();
}
catch (Exception exception)
{
@ -202,12 +186,9 @@ namespace TINK.View.Map
try
{
// Pre move and scanle maps to avoid initial display of map in Rome.
Log.ForContext<MapPage>().Verbose("Moving and scaling map.");
MapPageViewModel.MoveAndScale(
(mapSpan) => MyMap.MoveToRegion(mapSpan),
App.ModelRoot.MapSpan);
PremoveAndScaleMap();
}
catch(Exception exception)
catch (Exception exception)
{
// Continue because a map not beeing moved/ scaled is no reason for aborting startup.
Log.ForContext<MapPage>().Error("Moving and scaling map failed. {Exception}", exception);
@ -226,7 +207,50 @@ namespace TINK.View.Map
}
/// <summary>
/// Invoked when pages is closed/ hidden.
/// Premoves the Map to a certain location.
/// </summary>
private void PremoveAndScaleMap()
{
Log.ForContext<MapPage>().Verbose("Moving and scaling map.");
MapPageViewModel.MoveAndScale(
(mapSpan) => MyMap.MoveToRegion(mapSpan),
App.ModelRoot.MapSpan);
}
/// <summary>
/// Creates the Map Page's view model.
/// </summary>
private MapPageViewModel CreateMapPageViewModel()
{
Log.ForContext<MapPage>().Verbose("Constructing map page view model.");
return new MapPageViewModel(
App.ModelRoot,
App.PermissionsService,
App.BluetoothService,
App.GeolocationServicesContainer.Active,
(mapspan) => MyMap.MoveToRegion(mapspan),
this,
Navigation);
}
/// <summary>
/// Applies iOS specific styling to branded Buttons.
/// </summary>
private void ApplyCustomiOSStyling()
{
if (Device.RuntimePlatform == Device.iOS)
{
TINKButton.BackgroundColor = Color.LightGray;
TINKButton.BorderColor = Color.Black;
TINKButton.Margin = new Thickness(10, 10, 10, 10);
KonradButton.BackgroundColor = Color.LightGray;
KonradButton.BorderColor = Color.Black;
KonradButton.Margin = new Thickness(10, 10, 10, 10);
}
}
/// <summary>
/// Invoked when pages is closed/ hidden.
/// Stops update process.
/// </summary>
protected override async void OnDisappearing()
@ -236,6 +260,7 @@ namespace TINK.View.Map
// View model might be null.
await MapPageViewModel?.OnDisappearing();
}
base.OnDisappearing();
}
}

View file

@ -462,6 +462,10 @@ namespace TINK.Model
{
new Version(3, 0, 263),
AppResources.ChangeLog3_0_263
},
{
new Version(3, 0, 264),
AppResources.ChangeLog3_0_264
}
};

View file

@ -19,7 +19,7 @@ namespace TINK.MultilingualResources {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class AppResources {
@ -880,6 +880,15 @@ namespace TINK.MultilingualResources {
}
}
/// <summary>
/// Looks up a localized string similar to Bug &quot;object reference not set ....&quot; &lt;a href=&quot;https://dev.azure.com/TeilRad/sharee.bike%20App/_workitems/edit/186&quot;&gt;185&lt;/a&gt; fixed..
/// </summary>
public static string ChangeLog3_0_264 {
get {
return ResourceManager.GetString("ChangeLog3_0_264", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Lock of rented bike can not be found..
/// </summary>

View file

@ -713,4 +713,7 @@ Kleine Verbesserungen.</value>
<data name="ChangeLog3_0_263" xml:space="preserve">
<value>Bei Fahrrädern mit GPS-Schloss wird die CO2-Einsparung nach der Rückgabe des Fahrrads angezeigt.</value>
</data>
<data name="ChangeLog3_0_264" xml:space="preserve">
<value>Fehler "object reference not set ...." &lt;a href="https://dev.azure.com/TeilRad/sharee.bike%20App/_workitems/edit/186"&gt;185&lt;/a&gt; behoben.</value>
</data>
</root>

View file

@ -808,4 +808,7 @@ Minor improvements.</value>
<data name="ChangeLog3_0_263" xml:space="preserve">
<value>CO2 saving is displayed for bikes with GPS-lock after returning bike.</value>
</data>
<data name="ChangeLog3_0_264" xml:space="preserve">
<value>Bug "object reference not set ...." &lt;a href="https://dev.azure.com/TeilRad/sharee.bike%20App/_workitems/edit/186"&gt;185&lt;/a&gt; fixed.</value>
</data>
</root>

View file

@ -956,6 +956,10 @@ Kleine Verbesserungen.</target>
<source>CO2 saving is displayed for bikes with GPS-lock after returning bike.</source>
<target state="translated">Bei Fahrrädern mit GPS-Schloss wird die CO2-Einsparung nach der Rückgabe des Fahrrads angezeigt.</target>
</trans-unit>
<trans-unit id="ChangeLog3_0_264" translate="yes" xml:space="preserve">
<source>Bug "object reference not set ...." <bpt id="1">&lt;a href="https://dev.azure.com/TeilRad/sharee.bike%20App/_workitems/edit/186"&gt;</bpt>185<ept id="1">&lt;/a&gt;</ept> fixed.</source>
<target state="translated">Fehler "object reference not set ...." <bpt id="1">&lt;a href="https://dev.azure.com/TeilRad/sharee.bike%20App/_workitems/edit/186"&gt;</bpt>185<ept id="1">&lt;/a&gt;</ept> behoben.</target>
</trans-unit>
</group>
</body>
</file>

View file

@ -408,7 +408,7 @@ namespace TINK.ViewModel.Contact
}
catch (Exception l_oException)
{
Log.ForContext<SelectStationPageViewModel>().Error($"An error occurred switching view TINK/ Konrad.\r\n{l_oException.Message}");
Log.ForContext<SelectStationPageViewModel>().Error($"An error occurred opening select station page.\r\n{l_oException.Message}");
IsRunning = false;

View file

@ -97,7 +97,7 @@ namespace TINK.ViewModel.Map
/// <summary> False if user tabed on station marker to show bikes at a given station.</summary>
private bool isMapPageEnabled = false;
Model.Services.Geolocation.IGeolocation GeolocationService { get; }
IGeolocation GeolocationService { get; }
/// <summary> False if user tabed on station marker to show bikes at a given station.</summary>
public bool IsMapPageEnabled {
@ -431,11 +431,14 @@ namespace TINK.ViewModel.Map
Log.ForContext<MapPageViewModel>().Error("Getting location failed. {Exception}", ex);
}
TinkApp.MapSpan = MapSpan.FromCenterAndRadius(
new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude),
TinkApp.MapSpan.Radius);
if (currentLocation != null)
{
TinkApp.MapSpan = MapSpan.FromCenterAndRadius(
new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude),
TinkApp.MapSpan.Radius);
TinkApp.Save();
TinkApp.Save();
}
}
MoveAndScale(m_oMoveToRegionDelegate, TinkApp.MapSpan);
@ -461,7 +464,7 @@ namespace TINK.ViewModel.Map
}
catch (Exception l_oException)
{
Log.ForContext<MapPageViewModel>().Error($"An error occurred switching view TINK/ Konrad.\r\n{l_oException.Message}");
Log.ForContext<MapPageViewModel>().Error($"An error occurred showing bike stations page.\r\n{l_oException.Message}");
IsRunning = false;
@ -882,11 +885,14 @@ namespace TINK.ViewModel.Map
Log.ForContext<MapPageViewModel>().Error("Getting location failed. {Exception}", ex);
}
TinkApp.MapSpan = MapSpan.FromCenterAndRadius(
if (currentLocation != null)
{
TinkApp.MapSpan = MapSpan.FromCenterAndRadius(
new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude),
TinkApp.MapSpan.Radius);
TinkApp.Save();
TinkApp.Save();
}
}
// Update stations

View file

@ -16,11 +16,6 @@ namespace TestShareeLib.Model.MiniSurvey
new MiniSurveyModel().Questions.Count,
Is.EqualTo(0),
"Question collection must not be null");
Assert.That(
new MiniSurveyModel().Questions,
Is.EqualTo(0),
"Question collection must not be null");
}
}
}

View file

@ -80,7 +80,7 @@ namespace TestShareeLib.UseCases.Startup
Assert.AreEqual(21, viewModel.Pins.Count); // Were 8 pins when loading from CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)
Assert.That(
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Green")).Tag,
Is.EqualTo("FR105"),
Is.EqualTo("FR103"),
"Station FR105 must be marked green because there is are bike.");
Assert.That(
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Red")).Tag,