This commit is contained in:
Oliver Hauff 2022-01-22 18:32:22 +01:00
parent 6ed1579494
commit 3c97e2f4aa
34 changed files with 278 additions and 135 deletions

View file

@ -652,6 +652,24 @@
<Generator>MSBuild:UpdateGeneratedFiles</Generator>
</AndroidResource>
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\sharee_no_background.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-hdpi\sharee_no_background.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-mdpi\sharee_no_background.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xhdpi\sharee_no_background.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxhdpi\sharee_no_background.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxxhdpi\sharee_no_background.png" />
</ItemGroup>
<Import Project="..\TINK\LastenradBayern.projitems" Label="Shared" Condition="Exists('..\TINK\LastenradBayern.projitems')" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<ProjectExtensions>

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View file

@ -53,8 +53,8 @@
<key>CFBundleDisplayName</key>
<string>LastenradBayern</string>
<key>CFBundleVersion</key>
<string>276</string>
<string>277</string>
<key>CFBundleShortVersionString</key>
<string>3.0.276</string>
<string>3.0.277</string>
</dict>
</plist>

View file

@ -135,13 +135,13 @@ namespace TINK
store = new Store();
Barrel.ApplicationId = "TINKApp";
Barrel.ApplicationId = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
var context = SynchronizationContext.Current;
var appInfoService = DependencyService.Get<IAppInfo>();
const string MERCHANTID = "baei987w";
const string MERCHANTID = "23456789";
// Create new app instnace.
Log.Debug("Constructing main model...");

View file

@ -30,7 +30,7 @@ namespace TINK
#if USEFLYOUT
return (Application.Current.MainPage as FlyoutPage)?.Detail.Navigation.NavigationStack.LastOrDefault();
#else
return (Application.Current.MainPage as AppShellViewModel)?.Detail.Navigation.NavigationStack.LastOrDefault();
return Shell.Current.CurrentPage;
#endif
}

View file

@ -1,7 +1,9 @@
using System;
using System.Threading.Tasks;
using TINK.Model.Device;
#if USEFLYOUT
using TINK.View.MasterDetail;
#endif
using TINK.ViewModel.Info;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
@ -9,8 +11,11 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.Contact
{
[XamlCompilation(XamlCompilationOptions.Compile)]
#if USEFLYOUT
public partial class ContactPage : ContentPage, IViewService, IDetailPage
#else
public partial class ContactPage : ContentPage, IViewService
#endif
{
public ContactPage ()
{
@ -72,7 +77,7 @@ namespace TINK.View.Contact
/// <param name="typeOfPage">Page to display.</param>
public async Task PushAsync(ViewTypes typeOfPage)
{
#if USEFLYOUT
if (!(Activator.CreateInstance(typeOfPage.GetViewType()) is IDetailPage detailPage))
{
await Task.CompletedTask;
@ -83,6 +88,7 @@ namespace TINK.View.Contact
detailPage.NavigationMasterDetail = NavigationMasterDetail;
await Navigation.PushAsync((Page)detailPage);
#endif
}
#if USCSHARP9

View file

@ -103,7 +103,7 @@ namespace TINK.View.Map
#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)
{

View file

@ -7,6 +7,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="30" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Image
HeightRequest="140"
@ -17,5 +18,11 @@
FontSize="Large"
Grid.Row="1"
Text="{Binding MasterDetailMenuTitlte}"/>
<Label
HorizontalOptions="CenterAndExpand"
FontSize="Micro"
HorizontalTextAlignment="Center"
Grid.Row="2"
Text="gefördert vom Bayrischen Staatministerium für Wohnen, Bau und Verkehr"/>
</Grid>
</ContentView>

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

View file

@ -53,8 +53,8 @@
<key>CFBundleDisplayName</key>
<string>Mein konrad</string>
<key>CFBundleVersion</key>
<string>276</string>
<string>277</string>
<key>CFBundleShortVersionString</key>
<string>3.0.276</string>
<string>3.0.277</string>
</dict>
</plist>

View file

@ -134,13 +134,13 @@ namespace TINK
store = new Store();
Barrel.ApplicationId = "TINKApp";
Barrel.ApplicationId = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
var context = SynchronizationContext.Current;
var appInfoService = DependencyService.Get<IAppInfo>();
const string MERCHANTID = "mkef9BuN";
const string MERCHANTID = "23456789";
// Create new app instnace.
Log.Debug("Constructing main model...");

View file

@ -30,7 +30,7 @@ namespace TINK
#if USEFLYOUT
return (Application.Current.MainPage as FlyoutPage)?.Detail.Navigation.NavigationStack.LastOrDefault();
#else
return (Application.Current.MainPage as AppShellViewModel)?.Detail.Navigation.NavigationStack.LastOrDefault();
return Shell.Current.CurrentPage;
#endif
}

View file

@ -1,7 +1,9 @@
using System;
using System.Threading.Tasks;
using TINK.Model.Device;
#if USEFLYOUT
using TINK.View.MasterDetail;
#endif
using TINK.ViewModel.Info;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
@ -9,7 +11,11 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.Contact
{
[XamlCompilation(XamlCompilationOptions.Compile)]
#if USEFLYOUT
public partial class ContactPage : ContentPage, IViewService, IDetailPage
#else
public partial class ContactPage : ContentPage, IViewService
#endif
{
public ContactPage ()
@ -72,7 +78,7 @@ namespace TINK.View.Contact
/// <param name="typeOfPage">Page to display.</param>
public async Task PushAsync(ViewTypes typeOfPage)
{
#if USEFLYOUT
if (!(Activator.CreateInstance(typeOfPage.GetViewType()) is IDetailPage detailPage))
{
await Task.CompletedTask;
@ -83,6 +89,7 @@ namespace TINK.View.Contact
detailPage.NavigationMasterDetail = NavigationMasterDetail;
await Navigation.PushAsync((Page)detailPage);
#endif
}
#if USCSHARP9

View file

@ -103,7 +103,7 @@ namespace TINK.View.Map
#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)
{

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

View file

@ -53,8 +53,8 @@
<key>CFBundleDisplayName</key>
<string>sharee.bike</string>
<key>CFBundleVersion</key>
<string>276</string>
<string>277</string>
<key>CFBundleShortVersionString</key>
<string>3.0.276</string>
<string>3.0.277</string>
</dict>
</plist>

View file

@ -134,13 +134,13 @@ namespace TINK
store = new Store();
Barrel.ApplicationId = "TINKApp";
Barrel.ApplicationId = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
var context = SynchronizationContext.Current;
var appInfoService = DependencyService.Get<IAppInfo>();
const string MERCHANTID = "oiF2kahH";
const string MERCHANTID = "23456789";
// Create new app instnace.
Log.Debug("Constructing main model...");

View file

@ -30,7 +30,7 @@ namespace TINK
#if USEFLYOUT
return (Application.Current.MainPage as FlyoutPage)?.Detail.Navigation.NavigationStack.LastOrDefault();
#else
return (Application.Current.MainPage as AppShellViewModel)?.Detail.Navigation.NavigationStack.LastOrDefault();
return Shell.Current.CurrentPage;
#endif
}

View file

@ -1,7 +1,9 @@
using System;
using System.Threading.Tasks;
using TINK.Model.Device;
#if USEFLYOUT
using TINK.View.MasterDetail;
#endif
using TINK.ViewModel.Info;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
@ -9,7 +11,11 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.Contact
{
[XamlCompilation(XamlCompilationOptions.Compile)]
#if USEFLYOUT
public partial class ContactPage : ContentPage, IViewService, IDetailPage
#else
public partial class ContactPage : ContentPage, IViewService
#endif
{
public ContactPage ()
@ -72,7 +78,7 @@ namespace TINK.View.Contact
/// <param name="typeOfPage">Page to display.</param>
public async Task PushAsync(ViewTypes typeOfPage)
{
#if USEFLYOUT
if (!(Activator.CreateInstance(typeOfPage.GetViewType()) is IDetailPage detailPage))
{
await Task.CompletedTask;
@ -83,6 +89,7 @@ namespace TINK.View.Contact
detailPage.NavigationMasterDetail = NavigationMasterDetail;
await Navigation.PushAsync((Page)detailPage);
#endif
}
#if USCSHARP9

View file

@ -103,7 +103,7 @@ namespace TINK.View.Map
#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)
{

View file

@ -478,6 +478,10 @@ namespace TINK.Model
{
new Version(3, 0, 276),
AppResources.ChangeLog3_0_276
},
{
new Version(3, 0, 277),
AppResources.ChangeLog3_0_277
}
};

View file

@ -920,6 +920,15 @@ namespace TINK.MultilingualResources {
}
}
/// <summary>
/// Looks up a localized string similar to Bugfix: No more closing of app on Select Bike page..
/// </summary>
public static string ChangeLog3_0_277 {
get {
return ResourceManager.GetString("ChangeLog3_0_277", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Lock of rented bike can not be found..
/// </summary>
@ -1736,6 +1745,24 @@ namespace TINK.MultilingualResources {
}
}
/// <summary>
/// Looks up a localized string similar to No bike with id {0} found..
/// </summary>
public static string MessageErrorSelectBikeNoBikeFound {
get {
return ResourceManager.GetString("MessageErrorSelectBikeNoBikeFound", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Error Selecting Bike!.
/// </summary>
public static string MessageErrorSelectBikeTitle {
get {
return ResourceManager.GetString("MessageErrorSelectBikeTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Login cookie must not be empty. {0}.
/// </summary>

View file

@ -742,4 +742,13 @@ Fehlerbehebung: Supportmails können wieder verschickt werden.</value>
<value>Beim Umschalten zwischen Lasten-/ Stadträdern ist ein Fehler aufgetreten.
{0}</value>
</data>
<data name="MessageErrorSelectBikeNoBikeFound" xml:space="preserve">
<value>Kein Fahrrad mit Id {0} gefunden.</value>
</data>
<data name="MessageErrorSelectBikeTitle" xml:space="preserve">
<value>Fehler beim Rad Wählen!</value>
</data>
<data name="ChangeLog3_0_277" xml:space="preserve">
<value>Fehlerbehebung: App schließt sich nicht mehr auf Fahrrad Wählen-Seite.</value>
</data>
</root>

View file

@ -837,4 +837,13 @@ Bugfix: Sending support mails works again. </value>
<value>An error occurred switching from cargo bikes/ city bikes.
{0}</value>
</data>
<data name="MessageErrorSelectBikeNoBikeFound" xml:space="preserve">
<value>No bike with id {0} found.</value>
</data>
<data name="MessageErrorSelectBikeTitle" xml:space="preserve">
<value>Error Selecting Bike!</value>
</data>
<data name="ChangeLog3_0_277" xml:space="preserve">
<value>Bugfix: No more closing of app on Select Bike page.</value>
</data>
</root>

View file

@ -998,6 +998,18 @@ Fehlerbehebung: Supportmails können wieder verschickt werden.</target>
<target state="translated">Beim Umschalten zwischen Lasten-/ Stadträdern ist ein Fehler aufgetreten.
{0}</target>
</trans-unit>
<trans-unit id="MessageErrorSelectBikeNoBikeFound" translate="yes" xml:space="preserve">
<source>No bike with id {0} found.</source>
<target state="translated">Kein Fahrrad mit Id {0} gefunden.</target>
</trans-unit>
<trans-unit id="MessageErrorSelectBikeTitle" translate="yes" xml:space="preserve">
<source>Error Selecting Bike!</source>
<target state="translated">Fehler beim Rad Wählen!</target>
</trans-unit>
<trans-unit id="ChangeLog3_0_277" translate="yes" xml:space="preserve">
<source>Bugfix: No more closing of app on Select Bike page.</source>
<target state="translated">Fehlerbehebung: App schließt sich nicht mehr auf Fahrrad Wählen-Seite.</target>
</trans-unit>
</group>
</body>
</file>

View file

@ -2,6 +2,9 @@
using System;
using System.ComponentModel;
using System.Text.RegularExpressions;
#if !USEFLYOUT
using System.Threading.Tasks;
#endif
using TINK.Model.Connector;
using TINK.Model.Device;
using TINK.Model.State;
@ -323,7 +326,7 @@ namespace TINK.ViewModel.Bikes.Bike
#if USEFLYOUT
=> new Xamarin.Forms.Command(() => ShowAgbPageAsync());
#else
=> new Xamarin.Forms.Command(async () => await OpenLoginPageAsync());
=> new Xamarin.Forms.Command(async () => await ShowAgbPageAsync());
#endif
/// <summary> Opens login page. </summary>

View file

@ -462,9 +462,12 @@ namespace TINK.ViewModel.Contact
typeof(BikesAtStationPage),
p_strStationName);
#else
#if USEFLYOUT
// Show page.
ViewService.ShowPage(ViewTypes.ContactPage, AppResources.MarkingContactPageTitle);
#else
await ViewService.ShowPage("//ContactPage");
#endif
IsMapPageEnabled = true;
ActionText = "";
}

View file

@ -47,11 +47,28 @@ namespace TINK.ViewModel.FindBike
}
}
/// <summary>
/// True if any action can be performed (request and cancel request)
/// </summary>
public override bool IsIdle
{
get => base.IsIdle;
set
{
if (value == IsIdle)
return;
Log.ForContext<FindBikePageViewModel>().Debug($"Switch value of {nameof(IsIdle)} to {value}.");
base.IsIdle = value;
OnPropertyChanged(new PropertyChangedEventArgs(nameof(IsSelectBikeEnabled))); // Enable select bike button.
}
}
/// <summary> Holds all bikes available.</summary>
public BikeCollection Bikes { get; set; }
/// <summary> Do not allow to select bike if id is not set.</summary>
public bool IsSelectBikeEnabled => BikeIdUserInput != null && BikeIdUserInput.Length > 0;
public bool IsSelectBikeEnabled => IsIdle && BikeIdUserInput != null && BikeIdUserInput.Length > 0;
/// <summary> Hide id input fields as soon as bike is found.</summary>
public bool IsSelectBikeVisible => BikeCollection != null && BikeCollection.Count == 0;
@ -124,12 +141,17 @@ namespace TINK.ViewModel.FindBike
/// <summary> Select a bike by ID</summary>
public async Task SelectBike()
{
try
{
var selectedBike = Bikes.FirstOrDefault(x => x.Id.Equals(BikeIdUserInput.Trim(), StringComparison.OrdinalIgnoreCase));
if (selectedBike == null)
{
await ViewService.DisplayAlert("Fehler bei Radauswahl!", $"Kein Rad mit Id {BikeIdUserInput} gefunden.", "OK");
await ViewService.DisplayAlert(
AppResources.MessageTitleHint,
string.Format(AppResources.MessageErrorSelectBikeNoBikeFound, BikeIdUserInput),
AppResources.MessageAnswerOk);
return;
}
@ -241,7 +263,16 @@ namespace TINK.ViewModel.FindBike
ActionText = "";
IsIdle = true;
} catch (Exception exception)
{
await ViewService.DisplayAlert(
AppResources.MessageErrorSelectBikeTitle,
exception.Message,
AppResources.MessageAnswerOk);
Log.ForContext<FindBikePageViewModel>().Error("Running command to select bike failed. {Exception}", exception);
return;
}
}
/// <summary> Create task which updates my bike view model.</summary>