Skip to content

Commit

Permalink
Added rating dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaulino committed Jul 29, 2021
1 parent ebc0dd1 commit 59815d0
Show file tree
Hide file tree
Showing 24 changed files with 240 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,14 @@
<source>Support development!</source>
<target state="new">Support development!</target>
</trans-unit>
<trans-unit id="HelloAgain" translate="yes" xml:space="preserve">
<source>Hello again 👋🏽</source>
<target state="new">Hello again 👋🏽</target>
</trans-unit>
<trans-unit id="RateUsMessage" translate="yes" xml:space="preserve">
<source>Enjoying Ambie? Please consider rating us!</source>
<target state="new">Enjoying Ambie? Please consider rating us!</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,14 @@
<source>Support development!</source>
<target state="translated">Podpořte vývoj!</target>
</trans-unit>
<trans-unit id="HelloAgain" translate="yes" xml:space="preserve">
<source>Hello again 👋🏽</source>
<target state="new">Hello again 👋🏽</target>
</trans-unit>
<trans-unit id="RateUsMessage" translate="yes" xml:space="preserve">
<source>Enjoying Ambie? Please consider rating us!</source>
<target state="new">Enjoying Ambie? Please consider rating us!</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,14 @@
<source>Support development!</source>
<target state="new">Support development!</target>
</trans-unit>
<trans-unit id="HelloAgain" translate="yes" xml:space="preserve">
<source>Hello again 👋🏽</source>
<target state="new">Hello again 👋🏽</target>
</trans-unit>
<trans-unit id="RateUsMessage" translate="yes" xml:space="preserve">
<source>Enjoying Ambie? Please consider rating us!</source>
<target state="new">Enjoying Ambie? Please consider rating us!</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,14 @@
<source>Support development!</source>
<target state="new">Support development!</target>
</trans-unit>
<trans-unit id="HelloAgain" translate="yes" xml:space="preserve">
<source>Hello again 👋🏽</source>
<target state="new">Hello again 👋🏽</target>
</trans-unit>
<trans-unit id="RateUsMessage" translate="yes" xml:space="preserve">
<source>Enjoying Ambie? Please consider rating us!</source>
<target state="new">Enjoying Ambie? Please consider rating us!</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,14 @@
<source>Support development!</source>
<target state="translated">¡Apóyanos!</target>
</trans-unit>
<trans-unit id="HelloAgain" translate="yes" xml:space="preserve">
<source>Hello again 👋🏽</source>
<target state="translated">Hola de nuevo 👋🏽</target>
</trans-unit>
<trans-unit id="RateUsMessage" translate="yes" xml:space="preserve">
<source>Enjoying Ambie? Please consider rating us!</source>
<target state="translated">¿Disfrutando de Ambie? ¡Considere calificarnos!</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,14 @@
<source>Support development!</source>
<target state="new">Support development!</target>
</trans-unit>
<trans-unit id="HelloAgain" translate="yes" xml:space="preserve">
<source>Hello again 👋🏽</source>
<target state="new">Hello again 👋🏽</target>
</trans-unit>
<trans-unit id="RateUsMessage" translate="yes" xml:space="preserve">
<source>Enjoying Ambie? Please consider rating us!</source>
<target state="new">Enjoying Ambie? Please consider rating us!</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,14 @@
<target state="translated">Hvala vam na pretplati!</target>
<note from="MultilingualBuild" annotates="source" priority="2">Thank you message shown after user purchases a subscription.</note>
</trans-unit>
<trans-unit id="HelloAgain" translate="yes" xml:space="preserve">
<source>Hello again 👋🏽</source>
<target state="new">Hello again 👋🏽</target>
</trans-unit>
<trans-unit id="RateUsMessage" translate="yes" xml:space="preserve">
<source>Enjoying Ambie? Please consider rating us!</source>
<target state="new">Enjoying Ambie? Please consider rating us!</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,14 @@
<source>Support development!</source>
<target state="translated">Fejlesztés támogatása!</target>
</trans-unit>
<trans-unit id="HelloAgain" translate="yes" xml:space="preserve">
<source>Hello again 👋🏽</source>
<target state="new">Hello again 👋🏽</target>
</trans-unit>
<trans-unit id="RateUsMessage" translate="yes" xml:space="preserve">
<source>Enjoying Ambie? Please consider rating us!</source>
<target state="new">Enjoying Ambie? Please consider rating us!</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,14 @@
<source>Support development!</source>
<target state="translated">Supporta lo sviluppo!</target>
</trans-unit>
<trans-unit id="HelloAgain" translate="yes" xml:space="preserve">
<source>Hello again 👋🏽</source>
<target state="new">Hello again 👋🏽</target>
</trans-unit>
<trans-unit id="RateUsMessage" translate="yes" xml:space="preserve">
<source>Enjoying Ambie? Please consider rating us!</source>
<target state="new">Enjoying Ambie? Please consider rating us!</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,14 @@
<source>Support development!</source>
<target state="new">Support development!</target>
</trans-unit>
<trans-unit id="HelloAgain" translate="yes" xml:space="preserve">
<source>Hello again 👋🏽</source>
<target state="new">Hello again 👋🏽</target>
</trans-unit>
<trans-unit id="RateUsMessage" translate="yes" xml:space="preserve">
<source>Enjoying Ambie? Please consider rating us!</source>
<target state="new">Enjoying Ambie? Please consider rating us!</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,14 @@
<source>Support development!</source>
<target state="new">Support development!</target>
</trans-unit>
<trans-unit id="HelloAgain" translate="yes" xml:space="preserve">
<source>Hello again 👋🏽</source>
<target state="new">Hello again 👋🏽</target>
</trans-unit>
<trans-unit id="RateUsMessage" translate="yes" xml:space="preserve">
<source>Enjoying Ambie? Please consider rating us!</source>
<target state="new">Enjoying Ambie? Please consider rating us!</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,14 @@
<source>Support development!</source>
<target state="new">Support development!</target>
</trans-unit>
<trans-unit id="HelloAgain" translate="yes" xml:space="preserve">
<source>Hello again 👋🏽</source>
<target state="new">Hello again 👋🏽</target>
</trans-unit>
<trans-unit id="RateUsMessage" translate="yes" xml:space="preserve">
<source>Enjoying Ambie? Please consider rating us!</source>
<target state="new">Enjoying Ambie? Please consider rating us!</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,14 @@
<source>Support development!</source>
<target state="translated">Apoie o desenvolvimento!</target>
</trans-unit>
<trans-unit id="HelloAgain" translate="yes" xml:space="preserve">
<source>Hello again 👋🏽</source>
<target state="new">Hello again 👋🏽</target>
</trans-unit>
<trans-unit id="RateUsMessage" translate="yes" xml:space="preserve">
<source>Enjoying Ambie? Please consider rating us!</source>
<target state="new">Enjoying Ambie? Please consider rating us!</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,14 @@
<source>Support development!</source>
<target state="new">Support development!</target>
</trans-unit>
<trans-unit id="HelloAgain" translate="yes" xml:space="preserve">
<source>Hello again 👋🏽</source>
<target state="new">Hello again 👋🏽</target>
</trans-unit>
<trans-unit id="RateUsMessage" translate="yes" xml:space="preserve">
<source>Enjoying Ambie? Please consider rating us!</source>
<target state="new">Enjoying Ambie? Please consider rating us!</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,14 @@
<target state="translated">சந்தாசேர்ந்ததற்கு நன்றி!</target>
<note from="MultilingualBuild" annotates="source" priority="2">Thank you message shown after user purchases a subscription.</note>
</trans-unit>
<trans-unit id="HelloAgain" translate="yes" xml:space="preserve">
<source>Hello again 👋🏽</source>
<target state="new">Hello again 👋🏽</target>
</trans-unit>
<trans-unit id="RateUsMessage" translate="yes" xml:space="preserve">
<source>Enjoying Ambie? Please consider rating us!</source>
<target state="new">Enjoying Ambie? Please consider rating us!</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,14 @@
<source>Support development!</source>
<target state="new">Support development!</target>
</trans-unit>
<trans-unit id="HelloAgain" translate="yes" xml:space="preserve">
<source>Hello again 👋🏽</source>
<target state="new">Hello again 👋🏽</target>
</trans-unit>
<trans-unit id="RateUsMessage" translate="yes" xml:space="preserve">
<source>Enjoying Ambie? Please consider rating us!</source>
<target state="new">Enjoying Ambie? Please consider rating us!</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,14 @@
<source>Support development!</source>
<target state="translated">支持我们的开发!</target>
</trans-unit>
<trans-unit id="HelloAgain" translate="yes" xml:space="preserve">
<source>Hello again 👋🏽</source>
<target state="new">Hello again 👋🏽</target>
</trans-unit>
<trans-unit id="RateUsMessage" translate="yes" xml:space="preserve">
<source>Enjoying Ambie? Please consider rating us!</source>
<target state="new">Enjoying Ambie? Please consider rating us!</target>
</trans-unit>
</group>
</body>
</file>
Expand Down
28 changes: 28 additions & 0 deletions src/AmbientSounds.Uwp/Strings/en-US/Resources.generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,32 @@ public static string ThankYouForSub
}
}
#endregion

#region HelloAgain
/// <summary>
/// Looks up a localized string similar to: Hello again 👋🏽
/// </summary>
public static string HelloAgain
{
get
{
return _resourceLoader.GetString("HelloAgain");
}
}
#endregion

#region RateUsMessage
/// <summary>
/// Looks up a localized string similar to: Enjoying Ambie? Please consider rating us!
/// </summary>
public static string RateUsMessage
{
get
{
return _resourceLoader.GetString("RateUsMessage");
}
}
#endregion
}

[global::System.CodeDom.Compiler.GeneratedCodeAttribute("DotNetPlus.ReswPlus", "2.1.3")]
Expand Down Expand Up @@ -1061,6 +1087,8 @@ public enum KeyEnum
SubscriptionText2,
SubscriptionText3,
ThankYouForSub,
HelloAgain,
RateUsMessage,
}

private static ResourceLoader _resourceLoader;
Expand Down
6 changes: 6 additions & 0 deletions src/AmbientSounds.Uwp/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -610,4 +610,10 @@
<value>Thank you for subscribing!</value>
<comment>Thank you message shown after user purchases a subscription.</comment>
</data>
<data name="HelloAgain" xml:space="preserve">
<value>Hello again 👋🏽</value>
</data>
<data name="RateUsMessage" xml:space="preserve">
<value>Enjoying Ambie? Please consider rating us!</value>
</data>
</root>
6 changes: 6 additions & 0 deletions src/AmbientSounds.Uwp/Strings/es-ES/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -423,4 +423,10 @@
<data name="SubscriptionText3" xml:space="preserve">
<value>¡Apóyanos!</value>
</data>
<data name="HelloAgain" xml:space="preserve">
<value>Hola de nuevo 👋🏽</value>
</data>
<data name="RateUsMessage" xml:space="preserve">
<value>¿Disfrutando de Ambie? ¡Considere calificarnos!</value>
</data>
</root>
11 changes: 11 additions & 0 deletions src/AmbientSounds.Uwp/Views/ShellPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:AmbientSounds.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:strings="using:AmbientSounds.Strings"
xmlns:toolkit="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:winui="using:Microsoft.UI.Xaml.Controls"
x:Name="RootPage"
Background="{ThemeResource ContentBackgroundBrush}"
mc:Ignorable="d">
Expand All @@ -32,5 +34,14 @@
FontSize="12"
Text="Ambie" />
</StackPanel>

<winui:TeachingTip
Title="{x:Bind strings:Resources.HelloAgain}"
ActionButtonClick="TeachingTip_ActionButtonClick"
ActionButtonContent="{x:Bind RateUs}"
CloseButtonContent="{x:Bind strings:Resources.Dismiss}"
IsOpen="{x:Bind ViewModel.IsRatingMessageVisible, Mode=OneWay}"
PreferredPlacement="BottomRight"
Subtitle="{x:Bind strings:Resources.RateUsMessage}" />
</Grid>
</Page>
17 changes: 16 additions & 1 deletion src/AmbientSounds.Uwp/Views/ShellPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
using AmbientSounds.Services;
using System;
using AmbientSounds.Constants;
using AmbientSounds.Services;
using AmbientSounds.ViewModels;
using Microsoft.Extensions.DependencyInjection;
using Windows.ApplicationModel.Resources;
using Windows.Services.Store;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
Expand All @@ -27,12 +31,23 @@ public ShellPage()

public ShellPageViewModel ViewModel => (ShellPageViewModel)this.DataContext;

private string RateUs => ResourceLoader.GetForCurrentView().GetString("MoreButtonRate/Label");

protected override void OnNavigatedTo(NavigationEventArgs e)
{
var navigator = App.Services.GetRequiredService<INavigator>();
navigator.Frame = MainFrame;

MainFrame.Navigate(typeof(MainPage));
}

private async void TeachingTip_ActionButtonClick(Microsoft.UI.Xaml.Controls.TeachingTip sender, object args)
{
var storeContext = StoreContext.GetDefault();
await storeContext.RequestRateAndReviewAppAsync();
App.Services.GetRequiredService<IUserSettings>().Set(
UserSettingsConstants.HasRated,
true);
}
}
}
Loading

0 comments on commit 59815d0

Please sign in to comment.