Refactor subscription success popup handling and improve UI consistency across popups; add width request to buttons in Profile views.
This commit is contained in:
parent
7cfecb836f
commit
ddaf7e0e28
@ -33,6 +33,7 @@ namespace gehGassiApp.ViewModels.Subscriptions
|
||||
private readonly IDispatcher _dispatcher;
|
||||
private readonly IDialogService _dialogService;
|
||||
private readonly IPopupService _popupService;
|
||||
private bool _hasShownSuccessPopupThisSession;
|
||||
|
||||
/// <summary>
|
||||
/// ERstellt eine Instanz
|
||||
@ -209,15 +210,7 @@ namespace gehGassiApp.ViewModels.Subscriptions
|
||||
await LoadAsync();
|
||||
if (MySubscriptions != null && MySubscriptions.Any())
|
||||
{
|
||||
var popupResult = await _popupService.ShowPopupAsync<SubscriptionSuccessPopup, SubscriptionSuccessResult>(
|
||||
Shell.Current
|
||||
);
|
||||
|
||||
var result = popupResult.Result;
|
||||
if (result != null && result.HasOpenedStrayz)
|
||||
{
|
||||
// User hat STRAYZ geöffnet
|
||||
}
|
||||
await ShowSubscriptionSuccessPopupAsync(force: true);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -436,15 +429,27 @@ namespace gehGassiApp.ViewModels.Subscriptions
|
||||
IsBusy = false;
|
||||
if (MySubscriptions != null && MySubscriptions.Any())
|
||||
{
|
||||
var popupResult = await _popupService.ShowPopupAsync<SubscriptionSuccessPopup, SubscriptionSuccessResult>(
|
||||
Shell.Current
|
||||
);
|
||||
await ShowSubscriptionSuccessPopupAsync();
|
||||
}
|
||||
}
|
||||
|
||||
var result = popupResult.Result;
|
||||
if (result != null && result.HasOpenedStrayz)
|
||||
{
|
||||
// User hat STRAYZ geöffnet
|
||||
}
|
||||
private async Task ShowSubscriptionSuccessPopupAsync(bool force = false)
|
||||
{
|
||||
if (_hasShownSuccessPopupThisSession && !force)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var popupResult = await _popupService.ShowPopupAsync<SubscriptionSuccessPopup, SubscriptionSuccessResult>(
|
||||
Shell.Current
|
||||
);
|
||||
|
||||
_hasShownSuccessPopupThisSession = true;
|
||||
|
||||
var result = popupResult.Result;
|
||||
if (result != null && result.HasOpenedStrayz)
|
||||
{
|
||||
// User hat STRAYZ geöffnet
|
||||
}
|
||||
}
|
||||
|
||||
@ -889,6 +894,8 @@ namespace gehGassiApp.ViewModels.Subscriptions
|
||||
HasError = false;
|
||||
ErrorMessage = string.Empty;
|
||||
|
||||
_hasShownSuccessPopupThisSession = false;
|
||||
|
||||
await TrackPageViewAsync("Subscriptions");
|
||||
|
||||
ShowSubscriptions = false;
|
||||
@ -914,6 +921,8 @@ namespace gehGassiApp.ViewModels.Subscriptions
|
||||
HasError = false;
|
||||
ErrorMessage = string.Empty;
|
||||
|
||||
_hasShownSuccessPopupThisSession = false;
|
||||
|
||||
return base.DisappearingAsync(sender);
|
||||
}
|
||||
|
||||
|
||||
@ -7,81 +7,74 @@
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
xmlns:viewModels="clr-namespace:gehGassiApp.ViewModels.Popups"
|
||||
x:DataType="viewModels:AGBUpdatePopupViewModel"
|
||||
CanBeDismissedByTappingOutsideOfPopup="False">
|
||||
<!-- Popup Content -->
|
||||
<Border
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource Primary_White},
|
||||
Dark={StaticResource Primary_White_Dark}}"
|
||||
CanBeDismissedByTappingOutsideOfPopup="False"
|
||||
VerticalOptions="Center">
|
||||
<Grid
|
||||
Padding="0"
|
||||
BackgroundColor="White"
|
||||
StrokeShape="RoundRectangle 16"
|
||||
StrokeThickness="0"
|
||||
RowDefinitions="Auto,*,Auto"
|
||||
WidthRequest="350">
|
||||
<!-- Drop Shadow Effect -->
|
||||
<Border.Shadow>
|
||||
<Shadow
|
||||
Brush="{AppThemeBinding Light={StaticResource Grey_Dark},
|
||||
Dark={StaticResource Grey_Dark_Dark}}"
|
||||
Opacity="0.3"
|
||||
Radius="8"
|
||||
Offset="0,4" />
|
||||
</Border.Shadow>
|
||||
<Grid RowDefinitions="Auto,Auto,Auto">
|
||||
<!-- Header -->
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Padding="20,16"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}"
|
||||
StrokeShape="RoundRectangle 16,16,0,0"
|
||||
StrokeThickness="0">
|
||||
<!-- Header -->
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Padding="20,16"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}"
|
||||
StrokeShape="RoundRectangle 16,16,0,0"
|
||||
StrokeThickness="0">
|
||||
<Label
|
||||
Style="{StaticResource H4}"
|
||||
Text="{x:Static res:Text.AGB_Popup_Header}"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Primary_White},
|
||||
Dark={StaticResource Primary_White_Dark}}"
|
||||
VerticalOptions="Center" />
|
||||
</Border>
|
||||
|
||||
<!-- Content Bereich -->
|
||||
<VerticalStackLayout
|
||||
Grid.Row="1"
|
||||
Padding="20,16"
|
||||
Spacing="16">
|
||||
<Label
|
||||
LineHeight="1.4"
|
||||
Style="{StaticResource BodyS_GreyDark}"
|
||||
Text="{x:Static res:Text.AGB_Popup_Description}" />
|
||||
|
||||
<!-- Link zu den AGB -->
|
||||
<Label Style="{StaticResource LinkLabelStyle}" Text="{x:Static res:Text.AGB_Popup_LinkButton}">
|
||||
<Label.GestureRecognizers>
|
||||
<TapGestureRecognizer Command="{Binding OpenAGBCommand}" />
|
||||
</Label.GestureRecognizers>
|
||||
</Label>
|
||||
|
||||
<!-- Zustimmungs-Checkbox -->
|
||||
<HorizontalStackLayout Margin="0,8,0,0" Spacing="12">
|
||||
<CheckBox
|
||||
IsChecked="{Binding HasAccepted}"
|
||||
VerticalOptions="Center"
|
||||
Color="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}" />
|
||||
<Label
|
||||
Style="{StaticResource H4}"
|
||||
Text="{x:Static res:Text.AGB_Popup_Header}"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Primary_White},
|
||||
Dark={StaticResource Primary_White_Dark}}"
|
||||
LineHeight="1.3"
|
||||
MaximumWidthRequest="260"
|
||||
Style="{StaticResource BodyXs_GreyDark}"
|
||||
Text="{x:Static res:Text.AGB_Popup_CheckBoxText}"
|
||||
VerticalOptions="Center" />
|
||||
</Border>
|
||||
<!-- Content Bereich -->
|
||||
<VerticalStackLayout
|
||||
Grid.Row="1"
|
||||
Padding="20,16"
|
||||
Spacing="16">
|
||||
<Label
|
||||
LineHeight="1.4"
|
||||
Style="{StaticResource BodyS_GreyDark}"
|
||||
Text="{x:Static res:Text.AGB_Popup_Description}" />
|
||||
<!-- Link zu den AGB -->
|
||||
<Label Style="{StaticResource LinkLabelStyle}" Text="{x:Static res:Text.AGB_Popup_LinkButton}">
|
||||
<Label.GestureRecognizers>
|
||||
<TapGestureRecognizer Command="{Binding OpenAGBCommand}" />
|
||||
</Label.GestureRecognizers>
|
||||
</Label>
|
||||
<!-- Zustimmungs-Checkbox -->
|
||||
<HorizontalStackLayout Margin="0,8,0,0" Spacing="12">
|
||||
<CheckBox
|
||||
IsChecked="{Binding HasAccepted}"
|
||||
VerticalOptions="Center"
|
||||
Color="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}" />
|
||||
<Label
|
||||
LineHeight="1.3"
|
||||
MaximumWidthRequest="260"
|
||||
Style="{StaticResource BodyXs_GreyDark}"
|
||||
Text="{x:Static res:Text.AGB_Popup_CheckBoxText}"
|
||||
VerticalOptions="Center" />
|
||||
</HorizontalStackLayout>
|
||||
</VerticalStackLayout>
|
||||
<!-- Action Buttons -->
|
||||
<Button
|
||||
Grid.Row="2"
|
||||
Margin="10"
|
||||
BackgroundColor="{Binding AcceptButtonColor}"
|
||||
Command="{Binding AcceptCommand}"
|
||||
CornerRadius="12"
|
||||
FontAttributes="Bold"
|
||||
FontSize="{StaticResource FontLabelM}"
|
||||
IsEnabled="{Binding HasAccepted}"
|
||||
Text="{x:Static res:Text.AGB_Popup_Confirm}"
|
||||
TextColor="White" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</HorizontalStackLayout>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Action Buttons -->
|
||||
<Button
|
||||
Grid.Row="2"
|
||||
Margin="20"
|
||||
BackgroundColor="{Binding AcceptButtonColor}"
|
||||
Command="{Binding AcceptCommand}"
|
||||
CornerRadius="12"
|
||||
FontAttributes="Bold"
|
||||
FontSize="{StaticResource FontLabelM}"
|
||||
IsEnabled="{Binding HasAccepted}"
|
||||
Text="{x:Static res:Text.AGB_Popup_Confirm}"
|
||||
TextColor="White" />
|
||||
</Grid>
|
||||
</toolkit:Popup>
|
||||
@ -7,119 +7,101 @@
|
||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||
xmlns:viewModels="clr-namespace:gehGassiApp.ViewModels.Popups"
|
||||
x:DataType="viewModels:SubscriptionOfferPopupViewModel"
|
||||
CanBeDismissedByTappingOutsideOfPopup="True">
|
||||
BackgroundColor="{StaticResource Primary_LightBlue_Dark}"
|
||||
CanBeDismissedByTappingOutsideOfPopup="True"
|
||||
VerticalOptions="Center">
|
||||
|
||||
<!-- Popup Content -->
|
||||
<Border
|
||||
Padding="0"
|
||||
BackgroundColor="{StaticResource Primary_LightBlue_Dark}"
|
||||
HeightRequest="350"
|
||||
StrokeShape="RoundRectangle 20"
|
||||
StrokeThickness="0"
|
||||
WidthRequest="350">
|
||||
<Grid
|
||||
Padding="24"
|
||||
RowDefinitions="Auto,*,Auto">
|
||||
|
||||
<!-- Drop Shadow Effect -->
|
||||
<Border.Shadow>
|
||||
<Shadow
|
||||
Brush="{AppThemeBinding Light={StaticResource Grey_Dark},
|
||||
Dark={StaticResource Grey_Dark_Dark}}"
|
||||
Opacity="0.3"
|
||||
Radius="12"
|
||||
Offset="0,6" />
|
||||
</Border.Shadow>
|
||||
<!-- Close Button -->
|
||||
<Button
|
||||
Grid.Row="0"
|
||||
BackgroundColor="Transparent"
|
||||
Command="{Binding DeclineCommand}"
|
||||
FontAttributes="Bold"
|
||||
FontFamily="MaterialIconsRegular"
|
||||
FontSize="40"
|
||||
HorizontalOptions="End"
|
||||
Style="{StaticResource LinkButton}"
|
||||
Text="close"
|
||||
TextColor="White"
|
||||
VerticalOptions="Start" />
|
||||
|
||||
<Grid RowDefinitions="Auto,*,Auto">
|
||||
<!-- Content Bereich -->
|
||||
<VerticalStackLayout
|
||||
Grid.Row="1"
|
||||
Margin="0,12,0,0"
|
||||
HorizontalOptions="Center"
|
||||
Spacing="16"
|
||||
VerticalOptions="Center">
|
||||
|
||||
<!-- Close Button -->
|
||||
<Button
|
||||
Grid.Row="0"
|
||||
Margin="0,5,0,-20"
|
||||
Background="Transparent"
|
||||
Command="{Binding DeclineCommand}"
|
||||
FontAttributes="Bold"
|
||||
FontFamily="MaterialIconsRegular"
|
||||
FontSize="40"
|
||||
HorizontalOptions="End"
|
||||
Text="close"
|
||||
TextColor="White"
|
||||
VerticalOptions="Start" />
|
||||
|
||||
<!-- Content Bereich -->
|
||||
<VerticalStackLayout
|
||||
Grid.Row="1"
|
||||
Margin="0,-30,0,20"
|
||||
<!-- Icon - Gestapelte Napf-Icons -->
|
||||
<Image
|
||||
HeightRequest="120"
|
||||
HorizontalOptions="Center"
|
||||
Spacing="10"
|
||||
VerticalOptions="Center">
|
||||
Source="coins.png"
|
||||
VerticalOptions="Center"
|
||||
WidthRequest="120" />
|
||||
|
||||
<!-- Icon - Gestapelte Napf-Icons -->
|
||||
<Image
|
||||
Margin="0,0,0,-20"
|
||||
HeightRequest="120"
|
||||
HorizontalOptions="Center"
|
||||
Source="coins.png"
|
||||
VerticalOptions="Center"
|
||||
WidthRequest="120" />
|
||||
<!-- Titel -->
|
||||
<Label
|
||||
FontAttributes="Bold"
|
||||
HorizontalTextAlignment="Center"
|
||||
Style="{StaticResource H2_Blue}"
|
||||
Text="{x:Static res:Text.SubOffer_Popup_Title}"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}" />
|
||||
|
||||
|
||||
<!-- Titel -->
|
||||
<!-- Untertitel -->
|
||||
<VerticalStackLayout Spacing="4">
|
||||
<Label
|
||||
FontAttributes="Bold"
|
||||
HorizontalTextAlignment="Center"
|
||||
Style="{StaticResource H2_Blue}"
|
||||
Text="{x:Static res:Text.SubOffer_Popup_Title}"
|
||||
Style="{StaticResource BodyM}"
|
||||
Text="{x:Static res:Text.SubOffer_Popup_Description1}"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}" />
|
||||
|
||||
<!-- Untertitel -->
|
||||
<VerticalStackLayout Spacing="4">
|
||||
<Label
|
||||
HorizontalTextAlignment="Center"
|
||||
Style="{StaticResource BodyM}"
|
||||
Text="{x:Static res:Text.SubOffer_Popup_Description1}"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}" />
|
||||
|
||||
<HorizontalStackLayout HorizontalOptions="Center" Spacing="4">
|
||||
<Label
|
||||
FontAttributes="Bold"
|
||||
FontFamily="InterSemiBold"
|
||||
Style="{StaticResource BodyM}"
|
||||
Text="STRAYZ"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}" />
|
||||
<Label
|
||||
Style="{StaticResource BodyM}"
|
||||
Text="{x:Static res:Text.SubOffer_Popup_ProductType}"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}" />
|
||||
</HorizontalStackLayout>
|
||||
|
||||
<HorizontalStackLayout HorizontalOptions="Center" Spacing="4">
|
||||
<Label
|
||||
FontAttributes="Bold"
|
||||
FontFamily="InterSemiBold"
|
||||
HorizontalTextAlignment="Center"
|
||||
Style="{StaticResource BodyM}"
|
||||
Text="{x:Static res:Text.SubOffer_Popup_CallToAction}"
|
||||
Text="STRAYZ"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}" />
|
||||
</VerticalStackLayout>
|
||||
<Label
|
||||
Style="{StaticResource BodyM}"
|
||||
Text="{x:Static res:Text.SubOffer_Popup_ProductType}"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}" />
|
||||
</HorizontalStackLayout>
|
||||
|
||||
<Label
|
||||
FontAttributes="Bold"
|
||||
FontFamily="InterSemiBold"
|
||||
HorizontalTextAlignment="Center"
|
||||
Style="{StaticResource BodyM}"
|
||||
Text="{x:Static res:Text.SubOffer_Popup_CallToAction}"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}" />
|
||||
</VerticalStackLayout>
|
||||
|
||||
<!-- Action Button -->
|
||||
<Button
|
||||
Grid.Row="2"
|
||||
Margin="30,0,30,20"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}"
|
||||
Command="{Binding AcceptCommand}"
|
||||
CornerRadius="15"
|
||||
FontAttributes="Bold"
|
||||
HeightRequest="50"
|
||||
Text="{x:Static res:Text.SubOffer_Popup_ButtonText}"
|
||||
TextColor="White" />
|
||||
</VerticalStackLayout>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
<!-- Action Button -->
|
||||
<Button
|
||||
Grid.Row="2"
|
||||
Margin="0,20,0,0"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}"
|
||||
Command="{Binding AcceptCommand}"
|
||||
CornerRadius="15"
|
||||
FontAttributes="Bold"
|
||||
HeightRequest="50"
|
||||
Text="{x:Static res:Text.SubOffer_Popup_ButtonText}"
|
||||
TextColor="White" />
|
||||
|
||||
</Grid>
|
||||
</toolkit:Popup>
|
||||
@ -8,32 +8,16 @@
|
||||
xmlns:viewModels="clr-namespace:gehGassiApp.ViewModels.Popups"
|
||||
x:DataType="viewModels:SubscriptionSuccessPopupViewModel"
|
||||
CanBeDismissedByTappingOutsideOfPopup="True"
|
||||
BackgroundColor="{StaticResource Primary_LightBlue}"
|
||||
VerticalOptions="Center">
|
||||
|
||||
<!-- Popup Content -->
|
||||
<Border
|
||||
Padding="0"
|
||||
BackgroundColor="{StaticResource Primary_LightBlue}"
|
||||
StrokeShape="RoundRectangle 20"
|
||||
StrokeThickness="0"
|
||||
WidthRequest="350">
|
||||
|
||||
<!-- Drop Shadow Effect -->
|
||||
<Border.Shadow>
|
||||
<Shadow
|
||||
Brush="{AppThemeBinding Light={StaticResource Grey_Dark},
|
||||
Dark={StaticResource Grey_Dark_Dark}}"
|
||||
Opacity="0.3"
|
||||
Radius="12"
|
||||
Offset="0,6" />
|
||||
</Border.Shadow>
|
||||
|
||||
<Grid RowDefinitions="Auto,*,Auto">
|
||||
|
||||
<!-- Close Button -->
|
||||
<Button
|
||||
Grid.Row="0"
|
||||
Margin="0,20,20,-20"
|
||||
BackgroundColor="Transparent"
|
||||
Command="{Binding CloseCommand}"
|
||||
FontAttributes="Bold"
|
||||
@ -48,18 +32,18 @@
|
||||
<!-- Content Bereich -->
|
||||
<VerticalStackLayout
|
||||
Grid.Row="1"
|
||||
Padding="30,0,30,20"
|
||||
|
||||
Spacing="20"
|
||||
VerticalOptions="Center">
|
||||
|
||||
<!-- Herz Icon -->
|
||||
<Image
|
||||
Margin="-20"
|
||||
HeightRequest="120"
|
||||
Margin="-30"
|
||||
HeightRequest="100"
|
||||
HorizontalOptions="Center"
|
||||
Source="heart.png"
|
||||
VerticalOptions="Center"
|
||||
WidthRequest="120" />
|
||||
WidthRequest="100" />
|
||||
|
||||
<!-- Titel -->
|
||||
<Label
|
||||
@ -100,8 +84,9 @@
|
||||
|
||||
<!-- Action Button -->
|
||||
<Button
|
||||
Margin="0,20,0,0"
|
||||
Grid.Row="2"
|
||||
Margin="30,0,30,30"
|
||||
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource Primary_DarkBlue},
|
||||
Dark={StaticResource Primary_DarkBlue_Dark}}"
|
||||
Command="{Binding OpenStrayzCommand}"
|
||||
@ -111,5 +96,4 @@
|
||||
Text="{x:Static res:Text.SubSuccess_Popup_ButtonText}"
|
||||
TextColor="White" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</toolkit:Popup>
|
||||
@ -521,6 +521,7 @@
|
||||
AbsoluteLayout.LayoutFlags="PositionProportional"
|
||||
Command="{Binding SaveCommand}"
|
||||
HorizontalOptions="Center"
|
||||
WidthRequest="300"
|
||||
IsVisible="{Binding HasChanges}"
|
||||
Text="{x:Static res:Text.Button_Done}"
|
||||
VerticalOptions="End">
|
||||
|
||||
@ -1028,6 +1028,7 @@
|
||||
AbsoluteLayout.LayoutFlags="PositionProportional"
|
||||
Command="{Binding SaveCommand}"
|
||||
HorizontalOptions="Center"
|
||||
WidthRequest="300"
|
||||
IsVisible="{Binding HasChanges}"
|
||||
Text="{x:Static res:Text.Button_Done}"
|
||||
VerticalOptions="End">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user