Xamarin-FiveStarsRate 4.1.0

Xamarin.Android Five Stars Library is a small library that helps developer add a "Rate My App" dialog to their applications. It's called "Five Stars" because the dialog has a different behaviour based on the rating given by the user. Based on Angelo Gallarello's version: https://github.com/Angtrim/Android-Five-Stars-Library

Install-Package Xamarin-FiveStarsRate -Version 4.1.0
dotnet add package Xamarin-FiveStarsRate --version 4.1.0
<PackageReference Include="Xamarin-FiveStarsRate" Version="4.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Xamarin-FiveStarsRate --version 4.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Xamarin-FiveStarsRate, 4.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Xamarin-FiveStarsRate as a Cake Addin
#addin nuget:?package=Xamarin-FiveStarsRate&version=4.1.0

// Install Xamarin-FiveStarsRate as a Cake Tool
#tool nuget:?package=Xamarin-FiveStarsRate&version=4.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

How to use

To use this library just add this snippet in the OnCreate of your activity.

The ShowAfter(int numbersOfAccess) method tells the library after how many access the dialog has to be shown.

Example:

FiveStarsDialog fiveStarsDialog = new FiveStarsDialog(this, "fede_example@noreply.com");
fiveStarsDialog.SetRateText("Your custom text")
		.SetTitle("Your custom title")
		.SetForceMode(false)
		.SetUpperBound(2)
		.SetNegativeReviewListener(new NegativeReview(this))
		.SetReviewListener(new PositiveReview(this))
		.ShowAfter(0);

public class NegativeReview : Java.Lang.Object, INegativeReviewListener
{
	readonly MainActivity MainActivity;

	public NegativeReview(MainActivity mainActivity)
	{
		MainActivity = mainActivity;
	}

	public void OnNegativeReview(int p0)
	{
		Toast.MakeText(MainActivity, $"Negative. Stars {p0}", ToastLength.Short);
	}
}

public class PositiveReview : Java.Lang.Object, IReviewListener
{
	readonly MainActivity MainActivity;

	public PositiveReview(MainActivity mainActivity)
	{
		MainActivity = mainActivity;
	}

	public void OnReview(int p0)
	{
		Toast.MakeText(MainActivity, $"Positive. Stars {p0}", ToastLength.Short);
	}
}

How to use

To use this library just add this snippet in the OnCreate of your activity.

The ShowAfter(int numbersOfAccess) method tells the library after how many access the dialog has to be shown.

Example:

FiveStarsDialog fiveStarsDialog = new FiveStarsDialog(this, "fede_example@noreply.com");
fiveStarsDialog.SetRateText("Your custom text")
		.SetTitle("Your custom title")
		.SetForceMode(false)
		.SetUpperBound(2)
		.SetNegativeReviewListener(new NegativeReview(this))
		.SetReviewListener(new PositiveReview(this))
		.ShowAfter(0);

public class NegativeReview : Java.Lang.Object, INegativeReviewListener
{
	readonly MainActivity MainActivity;

	public NegativeReview(MainActivity mainActivity)
	{
		MainActivity = mainActivity;
	}

	public void OnNegativeReview(int p0)
	{
		Toast.MakeText(MainActivity, $"Negative. Stars {p0}", ToastLength.Short);
	}
}

public class PositiveReview : Java.Lang.Object, IReviewListener
{
	readonly MainActivity MainActivity;

	public PositiveReview(MainActivity mainActivity)
	{
		MainActivity = mainActivity;
	}

	public void OnReview(int p0)
	{
		Toast.MakeText(MainActivity, $"Positive. Stars {p0}", ToastLength.Short);
	}
}

Release Notes

New modes: setAfterNDaysMode and setInAppReviewMode

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
4.1.0 177 8/31/2020
4.0.0 154 8/10/2020