don't show donation notice in Changelog when using the app for one of the first times. Disable link to playstore with additional storage options as required by Google.
This commit is contained in:
@@ -9,6 +9,7 @@ using Android.Content.PM;
|
|||||||
using Android.Content.Res;
|
using Android.Content.Res;
|
||||||
using Android.Graphics;
|
using Android.Graphics;
|
||||||
using Android.OS;
|
using Android.OS;
|
||||||
|
using Android.Preferences;
|
||||||
using Android.Runtime;
|
using Android.Runtime;
|
||||||
using Android.Text;
|
using Android.Text;
|
||||||
using Android.Text.Method;
|
using Android.Text.Method;
|
||||||
@@ -147,17 +148,32 @@ namespace keepass2android
|
|||||||
bool title = true;
|
bool title = true;
|
||||||
if (isFirst)
|
if (isFirst)
|
||||||
{
|
{
|
||||||
if (versionLog2.EndsWith("\n") == false)
|
|
||||||
versionLog2 += "\n";
|
bool showDonateOption = true;
|
||||||
string donateUrl = ctx.GetString(Resource.String.donate_url,
|
ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(ctx);
|
||||||
new Java.Lang.Object[]{ctx.Resources.Configuration.Locale.Language,
|
if (prefs.GetBoolean(ctx.GetString(Resource.String.NoDonationReminder_key), false))
|
||||||
ctx.PackageName
|
showDonateOption = false;
|
||||||
});
|
|
||||||
versionLog2 += " * <a href=\"" + donateUrl
|
long usageCount = prefs.GetLong(ctx.GetString(Resource.String.UsageCount_key), 0);
|
||||||
+ "\">" +
|
|
||||||
ctx.GetString(Resource.String.ChangeLog_keptDonate)
|
if (usageCount <= 5)
|
||||||
+ "<a/>";
|
showDonateOption = false;
|
||||||
isFirst = false;
|
|
||||||
|
if (showDonateOption)
|
||||||
|
{
|
||||||
|
if (versionLog2.EndsWith("\n") == false)
|
||||||
|
versionLog2 += "\n";
|
||||||
|
string donateUrl = ctx.GetString(Resource.String.donate_url,
|
||||||
|
new Java.Lang.Object[]{ctx.Resources.Configuration.Locale.Language,
|
||||||
|
ctx.PackageName
|
||||||
|
});
|
||||||
|
|
||||||
|
versionLog2 += " * <a href=\"" + donateUrl
|
||||||
|
+ "\">" +
|
||||||
|
ctx.GetString(Resource.String.ChangeLog_keptDonate)
|
||||||
|
+ "<a/>";
|
||||||
|
}
|
||||||
|
isFirst = false;
|
||||||
}
|
}
|
||||||
foreach (string line in versionLog2.Split('\n'))
|
foreach (string line in versionLog2.Split('\n'))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -79,7 +79,8 @@ namespace keepass2android
|
|||||||
if (context.Intent.GetBooleanExtra(AllowThirdPartyAppSend, false))
|
if (context.Intent.GetBooleanExtra(AllowThirdPartyAppSend, false))
|
||||||
_displayedProtocolIds.Add("androidsend");
|
_displayedProtocolIds.Add("androidsend");
|
||||||
#if NoNet
|
#if NoNet
|
||||||
_displayedProtocolIds.Add("kp2a");
|
//don't display "get regular version", is classified as deceptive ad by Google. Haha.
|
||||||
|
//_displayedProtocolIds.Add("kp2a");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user