Resolve merge conflict: keep .NET 9 versions and add AppRating package

This commit is contained in:
Max Mannstein 2025-08-09 16:28:22 +02:00
commit 8d91ed7eb5
10 changed files with 252 additions and 46 deletions

View File

@ -1,4 +1,5 @@
using CommunityToolkit.Maui;
using Plugin.Maui.AppRating;
using CommunityToolkit.Maui;
using gehGassi.LocalNotifications;
using gehGassiApp.Constants;
using gehGassiApp.Core.Data;
@ -484,6 +485,7 @@ public static class MauiProgram
SetHandler();
builder.Services.AddSingleton<IAppRating>(AppRating.Default);
return builder.Build();
}

View File

@ -545,7 +545,12 @@ namespace gehGassiApp.ViewModels
request.Distance = Location.CalculateDistance(CurrentLocation.Lat.Value, CurrentLocation.Lng.Value, request.Lat, request.Lng, DistanceUnits.Kilometers);
}
Walkers = requests.Value.ToObservableCollection();
// Sortierung: Entfernung, dann mit Foto, dann mit Rating
Walkers = requests.Value
.OrderBy(x => x.Distance)
.ThenByDescending(x => !string.IsNullOrWhiteSpace(x.Photo))
.ThenByDescending(x => x.AverageRating > 0)
.ToObservableCollection();
// Set First10Walkers for the home screen display
First10Walkers = requests.Value.Take(10).ToObservableCollection();

View File

@ -1,4 +1,5 @@
using System.Text.Json;
using Plugin.Maui.AppRating;
using System.Text.Json;
using CommunityToolkit.Maui.Core;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
@ -31,6 +32,7 @@ namespace gehGassiApp.ViewModels.More
private readonly ISystemMessageService _systemMessageService;
private readonly IDispatcher _dispatcher;
private readonly IPushnotificationService _pushnotificationService;
private readonly IAppRating _appRating;
/// <summary>
/// Erstellt eine Instanz
@ -41,7 +43,7 @@ namespace gehGassiApp.ViewModels.More
/// <param name="dispatcher">Instanz eines IDispatcher</param>
/// <param name="pushnotificationService">Instanz eines IPushnotificationService</param>
public MoreViewModel(IAccountService accountService, IDialogService dialogService, ISystemMessageService systemMessageService, IDispatcher dispatcher,
IPushnotificationService pushnotificationService)
IPushnotificationService pushnotificationService, IAppRating appRating)
{
_accountService = accountService;
_dialogService = dialogService;
@ -50,6 +52,43 @@ namespace gehGassiApp.ViewModels.More
_pushnotificationService = pushnotificationService;
Title = Text.View_Title_More;
SelectedMenu = MenuSelected.More;
_appRating = appRating;
}
/// <summary>
/// Command für die Store-Bewertung
/// </summary>
[RelayCommand]
public async Task RateApp()
{
try
{
await _appRating.PerformRatingOnStoreAsync(
packageName: "com.gehgassi.gehgassi",
applicationId: "id1662116305"
);
}
catch (Exception ex)
{
await TrackErrorAsync(ex, true);
}
}
/// <summary>
/// Command für das Teilen der App
/// </summary>
[RelayCommand]
public async Task ShareApp()
{
string url = DeviceInfo.Platform == DevicePlatform.iOS
? "https://apps.apple.com/us/app/gehgassi/id1662116305"
: "https://play.google.com/store/apps/details?id=com.gehgassi.gehgassi";
string text = $"Schau dir die gehgassi App an! {url}";
await Share.Default.RequestAsync(new ShareTextRequest
{
Text = text,
Title = "App teilen"
});
}
/// <summary>

View File

@ -1,4 +1,5 @@
using System.Text.Json;
using Plugin.Maui.AppRating;
using System.Text.Json;
using CommunityToolkit.Maui.Core;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
@ -31,6 +32,7 @@ namespace gehGassiApp.ViewModels.More
private readonly ISystemMessageService _systemMessageService;
private readonly IDispatcher _dispatcher;
private readonly IPushnotificationService _pushnotificationService;
private readonly IAppRating _appRating;
/// <summary>
/// Erstellt eine Instanz
@ -42,7 +44,7 @@ namespace gehGassiApp.ViewModels.More
/// <param name="dispatcher">Instanz eines IDispatcher</param>
/// <param name="pushnotificationService">Instanz eines IPushnotificationService</param>
public MoreWalkerViewModel(IAccountService accountService, IDialogService dialogService, IUserService userService, ISystemMessageService systemMessageService, IDispatcher dispatcher,
IPushnotificationService pushnotificationService)
IPushnotificationService pushnotificationService, IAppRating appRating)
{
_accountService = accountService;
_dialogService = dialogService;
@ -52,8 +54,43 @@ namespace gehGassiApp.ViewModels.More
_pushnotificationService = pushnotificationService;
Title = Text.View_Title_More;
SelectedMenu = MenuSelected.More;
_appRating = appRating;
}
/// <summary>
/// Command für die Store-Bewertung
/// </summary>
[RelayCommand]
public async Task RateApp()
{
try
{
await _appRating.PerformRatingOnStoreAsync(
packageName: "com.gehgassi.gehgassi",
applicationId: "id1662116305"
);
}
catch (Exception ex)
{
await TrackErrorAsync(ex, true);
}
}
/// <summary>
/// Command für das Teilen der App
/// </summary>
[RelayCommand]
public async Task ShareApp()
{
string url = DeviceInfo.Platform == DevicePlatform.iOS
? "https://apps.apple.com/us/app/gehgassi/id1662116305"
: "https://play.google.com/store/apps/details?id=com.gehgassi.gehgassi";
string text = $"Schau dir die gehgassi App an! {url}";
await Share.Default.RequestAsync(new ShareTextRequest
{
Text = text,
Title = "App teilen"
});
}
/// <summary>
/// Gibt an ob Switch verfügbar ist
/// </summary>

View File

@ -526,7 +526,7 @@ namespace gehGassiApp.ViewModels.Walks
}
}
#endregion
#endregion
/// <summary>
/// Laden der initialen Daten
@ -597,6 +597,8 @@ namespace gehGassiApp.ViewModels.Walks
CheckSubscription(AppMode.DogOwner);
}
}
DogSelectionChanged();
}
/// <summary>
@ -615,10 +617,22 @@ namespace gehGassiApp.ViewModels.Walks
{
Dogs = dogs.ToObservableCollection();
SelectedDog = Dogs.FirstOrDefault();
// Ersten Hund automatisch zur Auswahl hinzufügen
if (Dogs.Count > 0)
{
SelectedDogs.Clear();
SelectedDogs.Add(Dogs.First());
DogsSelected = true;
// DogSelectionChanged Command manuell auslösen für UI-Update
}
}
else
{
Dogs?.Clear();
SelectedDogs?.Clear();
DogsSelected = false;
}
HasNoDog = Dogs.Count == 0;

View File

@ -294,7 +294,7 @@
<Label
Grid.Row="0"
Grid.Column="0"
IsEnabled="{Binding Dog.LikesAdults}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_LikesAdults}"
@ -308,7 +308,6 @@
<Label
Grid.Row="1"
Grid.Column="0"
IsEnabled="{Binding Dog.LikesConspecifics}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_LikesConspecifics}"
@ -322,7 +321,6 @@
<Label
Grid.Row="2"
Grid.Column="0"
IsEnabled="{Binding Dog.IsTrustful}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_IsTrustful}"
@ -336,7 +334,6 @@
<Label
Grid.Row="3"
Grid.Column="0"
IsEnabled="{Binding Dog.IsLoneGunner}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_IsLoneGunner}"
@ -350,7 +347,6 @@
<Label
Grid.Row="4"
Grid.Column="0"
IsEnabled="{Binding Dog.HouseTrained}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_HouseTrained}"
@ -364,7 +360,6 @@
<Label
Grid.Row="5"
Grid.Column="0"
IsEnabled="{Binding Dog.IsAggressiv}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_IsAggressiv}"
@ -422,7 +417,6 @@
<Label
Grid.Row="0"
Grid.Column="0"
IsEnabled="{Binding Dog.PullsTheLeash}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_PullsTheLeash}"
@ -436,7 +430,6 @@
<Label
Grid.Row="1"
Grid.Column="0"
IsEnabled="{Binding Dog.BasicCommands}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_BasicCommands}"
@ -450,7 +443,6 @@
<Label
Grid.Row="2"
Grid.Column="0"
IsEnabled="{Binding Dog.Hunter}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_Hunter}"
@ -464,7 +456,6 @@
<Label
Grid.Row="3"
Grid.Column="0"
IsEnabled="{Binding Dog.Eating}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_Eating}"
@ -478,7 +469,6 @@
<Label
Grid.Row="4"
Grid.Column="0"
IsEnabled="{Binding Dog.Jumper}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_Jumper}"
@ -505,7 +495,6 @@
<Label
Grid.Row="0"
Grid.Column="0"
IsEnabled="{Binding Dog.RushesOutside}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_RushesOutside}"
@ -519,7 +508,6 @@
<Label
Grid.Row="1"
Grid.Column="0"
IsEnabled="{Binding Dog.IsCalm}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_IsCalm}"
@ -533,7 +521,6 @@
<Label
Grid.Row="2"
Grid.Column="0"
IsEnabled="{Binding Dog.IsPeeing}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_IsPeeing}"
@ -547,7 +534,6 @@
<Label
Grid.Row="3"
Grid.Column="0"
IsEnabled="{Binding Dog.IsShy}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_IsShy}"
@ -561,7 +547,6 @@
<Label
Grid.Row="4"
Grid.Column="0"
IsEnabled="{Binding Dog.IsGuard}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_IsGuard}"

View File

@ -292,7 +292,6 @@
<Label
Grid.Row="0"
Grid.Column="0"
IsEnabled="{Binding Dog.LikesAdults}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_LikesAdults}"
@ -306,7 +305,6 @@
<Label
Grid.Row="1"
Grid.Column="0"
IsEnabled="{Binding Dog.LikesConspecifics}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_LikesConspecifics}"
@ -320,7 +318,6 @@
<Label
Grid.Row="2"
Grid.Column="0"
IsEnabled="{Binding Dog.IsTrustful}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_IsTrustful}"
@ -334,7 +331,6 @@
<Label
Grid.Row="3"
Grid.Column="0"
IsEnabled="{Binding Dog.IsLoneGunner}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_IsLoneGunner}"
@ -348,7 +344,6 @@
<Label
Grid.Row="4"
Grid.Column="0"
IsEnabled="{Binding Dog.HouseTrained}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_HouseTrained}"
@ -362,7 +357,6 @@
<Label
Grid.Row="5"
Grid.Column="0"
IsEnabled="{Binding Dog.IsAggressiv}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_IsAggressiv}"
@ -420,7 +414,6 @@
<Label
Grid.Row="0"
Grid.Column="0"
IsEnabled="{Binding Dog.PullsTheLeash}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_PullsTheLeash}"
@ -434,7 +427,6 @@
<Label
Grid.Row="1"
Grid.Column="0"
IsEnabled="{Binding Dog.BasicCommands}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_BasicCommands}"
@ -448,7 +440,6 @@
<Label
Grid.Row="2"
Grid.Column="0"
IsEnabled="{Binding Dog.Hunter}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_Hunter}"
@ -462,7 +453,6 @@
<Label
Grid.Row="3"
Grid.Column="0"
IsEnabled="{Binding Dog.Eating}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_Eating}"
@ -476,7 +466,6 @@
<Label
Grid.Row="4"
Grid.Column="0"
IsEnabled="{Binding Dog.Jumper}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_Jumper}"
@ -503,7 +492,6 @@
<Label
Grid.Row="0"
Grid.Column="0"
IsEnabled="{Binding Dog.RushesOutside}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_RushesOutside}"
@ -517,7 +505,6 @@
<Label
Grid.Row="1"
Grid.Column="0"
IsEnabled="{Binding Dog.IsCalm}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_IsCalm}"
@ -531,7 +518,6 @@
<Label
Grid.Row="2"
Grid.Column="0"
IsEnabled="{Binding Dog.IsPeeing}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_IsPeeing}"
@ -545,7 +531,6 @@
<Label
Grid.Row="3"
Grid.Column="0"
IsEnabled="{Binding Dog.IsShy}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_IsShy}"
@ -559,7 +544,6 @@
<Label
Grid.Row="4"
Grid.Column="0"
IsEnabled="{Binding Dog.IsGuard}"
LineBreakMode="TailTruncation"
Style="{StaticResource BodySMedium_Blue}"
Text="{x:Static res:Text.Dog_IsGuard}"

View File

@ -398,6 +398,76 @@
<Border Style="{StaticResource Separator}" />
<Grid
ColumnDefinitions="24,*,24"
ColumnSpacing="12"
HorizontalOptions="FillAndExpand"
VerticalOptions="StartAndExpand">
<Image Grid.Column="0" HeightRequest="24">
<Image.Source>
<FontImageSource
FontFamily="MaterialIconsRegular"
Glyph="thumb_up"
Color="{StaticResource Primary_DarkBlue}" />
</Image.Source>
</Image>
<Label
Grid.Column="1"
HorizontalOptions="StartAndExpand"
LineBreakMode="TailTruncation"
Style="{StaticResource H5_Blue}"
Text="App bewerten"
VerticalOptions="Center" />
<Image Grid.Column="2" HeightRequest="24">
<Image.Source>
<FontImageSource
FontFamily="IconMoon"
Glyph="{x:Static i:IconsMoon.Icon_Chevron_Right}"
Color="{StaticResource Primary_DarkBlue}" />
</Image.Source>
</Image>
<Grid.GestureRecognizers>
<TapGestureRecognizer Command="{Binding RateAppCommand}" />
</Grid.GestureRecognizers>
</Grid>
<Border Style="{StaticResource Separator}" />
<Grid
ColumnDefinitions="24,*,24"
ColumnSpacing="12"
HorizontalOptions="FillAndExpand"
VerticalOptions="StartAndExpand">
<Image Grid.Column="0" HeightRequest="24">
<Image.Source>
<FontImageSource
FontFamily="MaterialIconsRegular"
Glyph="share"
Color="{StaticResource Primary_DarkBlue}" />
</Image.Source>
</Image>
<Label
Grid.Column="1"
HorizontalOptions="StartAndExpand"
LineBreakMode="TailTruncation"
Style="{StaticResource H5_Blue}"
Text="App teilen"
VerticalOptions="Center" />
<Image Grid.Column="2" HeightRequest="24">
<Image.Source>
<FontImageSource
FontFamily="IconMoon"
Glyph="{x:Static i:IconsMoon.Icon_Chevron_Right}"
Color="{StaticResource Primary_DarkBlue}" />
</Image.Source>
</Image>
<Grid.GestureRecognizers>
<TapGestureRecognizer Command="{Binding ShareAppCommand}" />
</Grid.GestureRecognizers>
</Grid>
<Border Style="{StaticResource Separator}" />
<Grid
ColumnDefinitions="24,*,24"
ColumnSpacing="12"

View File

@ -221,8 +221,8 @@
</Grid.GestureRecognizers>
</Grid>
<Border Style="{StaticResource Separator}" />
<Border Style="{StaticResource Separator}" />
<Grid
ColumnDefinitions="24,*,24"
ColumnSpacing="12"
@ -256,8 +256,9 @@
</Grid.GestureRecognizers>
</Grid>
<Border Style="{StaticResource Separator}" />
<Border Style="{StaticResource Separator}" />
<Grid
ColumnDefinitions="24,*,24"
ColumnSpacing="12"
@ -360,6 +361,74 @@
<TapGestureRecognizer Command="{Binding FeedbackCommand}" />
</Grid.GestureRecognizers>
</Grid>
<Border Style="{StaticResource Separator}" />
<Grid
ColumnDefinitions="24,*,24"
ColumnSpacing="12"
HorizontalOptions="FillAndExpand"
VerticalOptions="StartAndExpand">
<Image Grid.Column="0" HeightRequest="24">
<Image.Source>
<FontImageSource
FontFamily="MaterialIconsRegular"
Glyph="thumb_up"
Color="{StaticResource Primary_DarkBlue}" />
</Image.Source>
</Image>
<Label
Grid.Column="1"
HorizontalOptions="StartAndExpand"
LineBreakMode="TailTruncation"
Style="{StaticResource H5_Blue}"
Text="App bewerten"
VerticalOptions="Center" />
<Image Grid.Column="2" HeightRequest="24">
<Image.Source>
<FontImageSource
FontFamily="IconMoon"
Glyph="{x:Static i:IconsMoon.Icon_Chevron_Right}"
Color="{StaticResource Primary_DarkBlue}" />
</Image.Source>
</Image>
<Grid.GestureRecognizers>
<TapGestureRecognizer Command="{Binding RateAppCommand}" />
</Grid.GestureRecognizers>
</Grid>
<Border Style="{StaticResource Separator}" />
<Grid
ColumnDefinitions="24,*,24"
ColumnSpacing="12"
HorizontalOptions="FillAndExpand"
VerticalOptions="StartAndExpand">
<Image Grid.Column="0" HeightRequest="24">
<Image.Source>
<FontImageSource
FontFamily="MaterialIconsRegular"
Glyph="share"
Color="{StaticResource Primary_DarkBlue}" />
</Image.Source>
</Image>
<Label
Grid.Column="1"
HorizontalOptions="StartAndExpand"
LineBreakMode="TailTruncation"
Style="{StaticResource H5_Blue}"
Text="App teilen"
VerticalOptions="Center" />
<Image Grid.Column="2" HeightRequest="24">
<Image.Source>
<FontImageSource
FontFamily="IconMoon"
Glyph="{x:Static i:IconsMoon.Icon_Chevron_Right}"
Color="{StaticResource Primary_DarkBlue}" />
</Image.Source>
</Image>
<Grid.GestureRecognizers>
<TapGestureRecognizer Command="{Binding ShareAppCommand}" />
</Grid.GestureRecognizers>
</Grid>
<Border Style="{StaticResource Separator}" />

View File

@ -205,6 +205,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.8" />
<PackageReference Include="Microsoft.Maui.Graphics.Skia" Version="9.0.90" />
<PackageReference Include="Plugin.InAppBilling" Version="9.1.0" />
<PackageReference Include="Plugin.Maui.AppRating" Version="1.2.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.1.2" />
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.90" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.90" />