From 2b81ef5d68f37d3a534f8aeefe70ed8f08e3bdc9 Mon Sep 17 00:00:00 2001 From: JJamet Date: Thu, 20 Jul 2017 16:56:23 +0200 Subject: [PATCH] Add link for donation --- .../remembirthday/activity/AboutActivity.java | 11 ++++++++--- .../remembirthday/activity/BuddyActivity.java | 17 +++++++++++++++-- .../remembirthday/utility/Constants.java | 3 ++- .../src/main/res/values/strings.xml | 4 ++-- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/RememBirthday-UI/src/main/java/com/kunzisoft/remembirthday/activity/AboutActivity.java b/RememBirthday-UI/src/main/java/com/kunzisoft/remembirthday/activity/AboutActivity.java index e5c72a7..5f23660 100644 --- a/RememBirthday-UI/src/main/java/com/kunzisoft/remembirthday/activity/AboutActivity.java +++ b/RememBirthday-UI/src/main/java/com/kunzisoft/remembirthday/activity/AboutActivity.java @@ -11,6 +11,8 @@ import org.sufficientlysecure.htmltextview.HtmlTextView; +import static com.kunzisoft.remembirthday.utility.Constants.DEVELOPER; + /** * Show the about page */ @@ -35,11 +37,14 @@ public void onCreate(Bundle savedInstanceState) { HtmlTextView aboutTextView = (HtmlTextView) findViewById(R.id.activity_about_content); String htmlContent = - "

"+getString(R.string.powered_by)+" "+ Constants.WEB_SITE +"

"+ + "

"+getString(R.string.powered_by)+" "+ Constants.URL_WEB_SITE +"

"+ "

"+getString(R.string.html_text_purpose)+"

"+ + "

"+getString(R.string.participation_title)+"

"+ "

"+getString(R.string.html_text_free)+"

"+ "

"+getString(R.string.html_text_donation)+"

"+ + "

"+getString(R.string.html_see_participation_page)+"

"+ + "

"+getString(R.string.features_title)+"

"+ "

"+getString(R.string.html_text_integration)+"

"+ ""+ "

"+getString(R.string.contact_title)+"

"+ - "

"+getString(R.string.developer)+" : "+getString(R.string.developer_name)+"

"+ - ""+getString(R.string.html_text_bugs)+""; + "

"+getString(R.string.html_text_bugs)+"

"+ + "

"+getString(R.string.developer)+" : "+ DEVELOPER +"

"; aboutTextView.setHtml(htmlContent); } diff --git a/RememBirthday-UI/src/main/java/com/kunzisoft/remembirthday/activity/BuddyActivity.java b/RememBirthday-UI/src/main/java/com/kunzisoft/remembirthday/activity/BuddyActivity.java index b015d19..dd31ecd 100644 --- a/RememBirthday-UI/src/main/java/com/kunzisoft/remembirthday/activity/BuddyActivity.java +++ b/RememBirthday-UI/src/main/java/com/kunzisoft/remembirthday/activity/BuddyActivity.java @@ -4,6 +4,7 @@ import android.app.Activity; import android.content.DialogInterface; import android.content.Intent; +import android.net.Uri; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.design.widget.FloatingActionButton; @@ -16,6 +17,7 @@ import com.kunzisoft.remembirthday.R; import com.kunzisoft.remembirthday.element.DateUnknownYear; +import com.kunzisoft.remembirthday.utility.Constants; import com.kunzisoft.remembirthday.utility.Utility; import permissions.dispatcher.NeedsPermission; @@ -54,8 +56,19 @@ public void onClick(View view) { } }); - if (Utility.isFirstTime(this)) - new StartupDialogFragment().show(getSupportFragmentManager(), TAG_STARTUP_FRAGMENT); + if (Utility.isFirstTime(this)) { + StartupDialogFragment startupDialogFragment = + new StartupDialogFragment(); + startupDialogFragment.setOnPositiveButtonClickListener(new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(Constants.URL_PARTICIPATION)); + startActivity(intent); + } + }); + startupDialogFragment.show(getSupportFragmentManager(), TAG_STARTUP_FRAGMENT); + } //TODO BUG initDialogSelection(savedInstanceState); diff --git a/RememBirthday-UI/src/main/java/com/kunzisoft/remembirthday/utility/Constants.java b/RememBirthday-UI/src/main/java/com/kunzisoft/remembirthday/utility/Constants.java index 3b20e27..55b425f 100644 --- a/RememBirthday-UI/src/main/java/com/kunzisoft/remembirthday/utility/Constants.java +++ b/RememBirthday-UI/src/main/java/com/kunzisoft/remembirthday/utility/Constants.java @@ -13,7 +13,8 @@ public class Constants { public static final String DEVELOPER = "Jeremy JAMET"; public static final String EMAIL = "contact@kunzisoft.com"; - public static final String WEB_SITE = "http://kunzisoft.com"; + public static final String URL_WEB_SITE = "http://kunzisoft.com/"; + public static final String URL_PARTICIPATION = URL_WEB_SITE+"#contribute"; /** * Get the current package version. diff --git a/RememBirthday-UI/src/main/res/values/strings.xml b/RememBirthday-UI/src/main/res/values/strings.xml index 01f63f7..529a2db 100644 --- a/RememBirthday-UI/src/main/res/values/strings.xml +++ b/RememBirthday-UI/src/main/res/values/strings.xml @@ -1,6 +1,5 @@ RememBirthday - Jeremy JAMET Powered by Participation @@ -49,9 +48,10 @@ Download Thanks to download ! - Let me try + Cancel Donate + See the participation page This application is designed to <strong>easily manage the birthdays</strong> of contacts on phones and tablets. Unlike almost all of its competitors, it is <strong>without advertising</strong> even in its free version. In order to keep our freedom and to be always active, we count on your <strong>donations.</strong>