Skip to content

Commit

Permalink
Merge pull request #124 from physphil/feature/GH-123_link_to_privacy_…
Browse files Browse the repository at this point in the history
…policy

Feature/gh 123 link to privacy policy
  • Loading branch information
physphil authored Sep 23, 2018
2 parents 4aacf27 + 1836899 commit 99ffc4b
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 16 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ android {
applicationId "com.physphil.android.unitconverterultimate"
minSdkVersion 14
targetSdkVersion 27
versionCode 50301
versionName '5.3.1'
versionCode 50303
versionName '5.3.3'
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 Phil Shadlyn
* Copyright 2018 Phil Shadlyn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,6 +42,7 @@
public class PreferencesFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {

private static final String GITHUB_ISSUE = "https://github.com/physphil/UnitConverterUltimate/issues";
private static final String PRIVACY_POLICY = "https://privacypolicies.com/privacy/view/f7a41d67f1b0081f249c2ff0a3123136";

public static PreferencesFragment newInstance() {
return new PreferencesFragment();
Expand Down Expand Up @@ -89,6 +90,15 @@ public boolean onPreferenceClick(Preference preference) {
}
});

Preference privacy = findPreference("privacy_policy");
privacy.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
openPrivacyPolicy();
return true;
}
});

Preference donate = findPreference("donate");
if (BuildConfig.FLAVOR.equals(UnitConverterApplication.BUILD_FLAVOUR_GOOGLE)) {
donate.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
Expand Down Expand Up @@ -155,6 +165,15 @@ private void openIssue() {
}
}

private void openPrivacyPolicy() {
try {
startActivity(IntentFactory.getOpenUrlIntent(PRIVACY_POLICY));
}
catch (ActivityNotFoundException ex) {
Toast.makeText(getActivity(), R.string.toast_error_no_browser, Toast.LENGTH_SHORT).show();
}
}

private void sortLanguageOptions(final ListPreference preference) {
// Sort language options so they're always alphabetical, no matter what language the user has chosen
final Language[] languages = Language.values();
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2017 Phil Shadlyn
~ Copyright 2018 Phil Shadlyn
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,6 +65,8 @@
<string name="prefs_summary_donate">Unterstütze die Entwicklung und mach mir eine Freude :)</string>
<string name="prefs_title_open_issue">Fehler gefunden?</string>
<string name="prefs_summary_open_issue">Melde das Problem auf GitHub</string>
<string name="prefs_title_privacy_policy">Datenschutz-Bestimmungen</string>
<string name="prefs_summary_privacy_policy">Ihre Privatsphäre ist wichtig.</string>

<string name="dialog_btn_got_it">Verstanden</string>
<string name="dialog_title_help">Hilfe</string>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2017 Phil Shadlyn
~ Copyright 2018 Phil Shadlyn
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,6 +65,8 @@
<string name="prefs_summary_donate">Apoye el desarrollo y hacedme sonreír :)</string>
<string name="prefs_title_open_issue">¿Encontró un Error?</string>
<string name="prefs_summary_open_issue">Abra un problema en GitHub.</string>
<string name="prefs_title_privacy_policy">Política de privacidad</string>
<string name="prefs_summary_privacy_policy">Tu privacidad es importante.</string>

<string name="dialog_btn_got_it">Lo tengo</string>
<string name="dialog_title_help">Ayuda</string>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values-fa/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2017 Phil Shadlyn
~ Copyright 2018 Phil Shadlyn
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,6 +65,8 @@
<string name="prefs_summary_donate">از توسعه دهنده حمایت کنید </string>
<string name="prefs_title_open_issue"> یک مشکل یافتید ؟</string>
<string name="prefs_summary_open_issue">بازکردن یک مشکل در گیت هاب</string>
<string name="prefs_title_privacy_policy">سیاست حفظ حریم خصوصی</string>
<string name="prefs_summary_privacy_policy">حریم خصوصی شما مهم است</string>

<string name="dialog_btn_got_it">متوجه شدم</string>
<string name="dialog_title_help">راهنمایی</string>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2017 Phil Shadlyn
~ Copyright 2018 Phil Shadlyn
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,6 +65,8 @@
<string name="prefs_summary_donate">Soutenez le développement et faites moi sourire :)</string>
<string name="prefs_title_open_issue">Vous avez trouvé un bug?</string>
<string name="prefs_summary_open_issue">Ouvrez une nouvelle Issue sur GitHub.</string>
<string name="prefs_title_privacy_policy">Politique de confidentialité</string>
<string name="prefs_summary_privacy_policy">Votre vie privée est importante.</string>

<string name="dialog_btn_got_it">Compris</string>
<string name="dialog_title_help">Aide</string>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values-hr/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2017 Phil Shadlyn
~ Copyright 2018 Phil Shadlyn
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,6 +65,8 @@
<string name="prefs_summary_donate">Podržite razvoj i nasmiješite me :)</string>
<string name="prefs_title_open_issue">Pronašli ste pogrešku?</string>
<string name="prefs_summary_open_issue">Prijavite ju na GitHubu.</string>
<string name="prefs_title_privacy_policy">Pravila o privatnosti</string>
<string name="prefs_summary_privacy_policy">Vaša je privatnost važna.</string>

<string name="dialog_btn_got_it">Shvaćam</string>
<string name="dialog_title_help">Pomoć</string>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values-hu/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2017 Phil Shadlyn
~ Copyright 2018 Phil Shadlyn
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,6 +65,8 @@
<string name="prefs_summary_donate">Támogasd a fejlesztést és varázsolj mosolyt az arcomra :)</string>
<string name="prefs_title_open_issue">Hibát találtál?</string>
<string name="prefs_summary_open_issue">Nyiss egy hibajelentést a GitHubon.</string>
<string name="prefs_title_privacy_policy">Adatvédelmi irányelvek</string>
<string name="prefs_summary_privacy_policy">Az adatvédelem fontos.</string>

<string name="dialog_btn_got_it">Rendben</string>
<string name="dialog_title_help">Súgó</string>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2017 Phil Shadlyn
~ Copyright 2018 Phil Shadlyn
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,6 +65,8 @@
<string name="prefs_summary_donate">Regalaci un sorriso sostenendo il team di sviluppo :)</string>
<string name="prefs_title_open_issue">Trovato un Bug?</string>
<string name="prefs_summary_open_issue">Inviaci una segnalazione su GitHub.</string>
<string name="prefs_title_privacy_policy">politica sulla riservatezza</string>
<string name="prefs_summary_privacy_policy">La tua privacy è importante.</string>

<string name="dialog_btn_got_it">OK</string>
<string name="dialog_title_help">Aiuto</string>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2017 Phil Shadlyn
~ Copyright 2018 Phil Shadlyn
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,6 +65,8 @@
<string name="prefs_summary_donate">開発をご支援ください :)</string>
<string name="prefs_title_open_issue">バグを見つけましたか?</string>
<string name="prefs_summary_open_issue">GitHub でイシューを開いてください。</string>
<string name="prefs_title_privacy_policy">個人情報保護方針</string>
<string name="prefs_summary_privacy_policy">あなたのプライバシーは重要です。</string>

<string name="dialog_btn_got_it">了解</string>
<string name="dialog_title_help">ヘルプ</string>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2017 Phil Shadlyn
~ Copyright 2018 Phil Shadlyn
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -62,6 +62,8 @@
<string name="prefs_summary_donate">Apoiar o desenvolvimento e me fazer sorrir :)</string>
<string name="prefs_title_open_issue">Encontrou um erro?</string>
<string name="prefs_summary_open_issue">Abrir um problema no GitHub.</string>
<string name="prefs_title_privacy_policy">Política de Privacidade</string>
<string name="prefs_summary_privacy_policy">Sua privacidade é importante.</string>

<string name="dialog_btn_got_it">Entendi</string>
<string name="dialog_title_help">Ajuda</string>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2017 Phil Shadlyn
~ Copyright 2018 Phil Shadlyn
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,6 +65,8 @@
<string name="prefs_summary_donate">Внесите пожертвование, чтобы поддержать развитие программы</string>
<string name="prefs_title_open_issue">Нашли ошибку?</string>
<string name="prefs_summary_open_issue">Сообщите о ней на GitHub</string>
<string name="prefs_title_privacy_policy">политика конфиденциальности</string>
<string name="prefs_summary_privacy_policy">Ваша конфиденциальность важна.</string>

<string name="dialog_btn_got_it">Закрыть</string>
<string name="dialog_title_help">Помощь</string>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values-tr/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2017 Phil Shadlyn
~ Copyright 2018 Phil Shadlyn
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,6 +65,8 @@
<string name="prefs_summary_donate">Geliştirmeyi destekle ve beni gülümset :)</string>
<string name="prefs_title_open_issue">Bir Hata Mı Buldun?</string>
<string name="prefs_summary_open_issue">Github\'dan sorunu bildir.</string>
<string name="prefs_title_privacy_policy">Gizlilik Politikası</string>
<string name="prefs_summary_privacy_policy">Gizliliğiniz önemlidir.</string>

<string name="dialog_btn_got_it">Anladım</string>
<string name="dialog_title_help">Yardım</string>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2017 Phil Shadlyn
~ Copyright 2018 Phil Shadlyn
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,6 +65,8 @@
<string name="prefs_summary_donate">Support development and make me smile :)</string>
<string name="prefs_title_open_issue">Found a Bug?</string>
<string name="prefs_summary_open_issue">Open an issue on GitHub.</string>
<string name="prefs_title_privacy_policy">Privacy Policy</string>
<string name="prefs_summary_privacy_policy">Because your privacy is important to me.</string>

<string name="dialog_btn_got_it">Got It</string>
<string name="dialog_title_help">Help</string>
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2017 Phil Shadlyn
~ Copyright 2018 Phil Shadlyn
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -91,6 +91,11 @@
android:title="@string/prefs_title_source_code"
android:summary="@string/pref_summary_source_code"/>

<Preference
android:key="privacy_policy"
android:title="@string/prefs_title_privacy_policy"
android:summary="@string/prefs_summary_privacy_policy"/>

</PreferenceCategory>

</PreferenceScreen>

0 comments on commit 99ffc4b

Please sign in to comment.