From 41762fe140e482072fbb172b5e510c3a0d165953 Mon Sep 17 00:00:00 2001 From: MFlisar Date: Tue, 22 May 2018 19:12:15 +0200 Subject: [PATCH] * fixed strings * improved explicitConsentForEachService handling --- .../michaelflisar/gdprdialog/helper/GDPRViewManager.java | 8 ++++---- library/src/main/res/values/strings.xml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library/src/main/java/com/michaelflisar/gdprdialog/helper/GDPRViewManager.java b/library/src/main/java/com/michaelflisar/gdprdialog/helper/GDPRViewManager.java index 0ae1d86..5ef753d 100644 --- a/library/src/main/java/com/michaelflisar/gdprdialog/helper/GDPRViewManager.java +++ b/library/src/main/java/com/michaelflisar/gdprdialog/helper/GDPRViewManager.java @@ -173,7 +173,7 @@ public void init(Activity activity, View view, IOnFinishView onFinishViewListene // ------------------ view.findViewById(R.id.btAgree).setOnClickListener(v -> { - if (!isAgeValid(v.getContext(), true) || !isAllConsentGiven(v.getContext())) { + if (!isAgeValid(v.getContext(), true) || !isAllConsentGiven(v.getContext(), true)) { return; } mSelectedConsent = GDPRConsent.PERSONAL_CONSENT; @@ -182,7 +182,7 @@ public void init(Activity activity, View view, IOnFinishView onFinishViewListene }); view.findViewById(R.id.btDisagree).setOnClickListener(v -> { - if (!isAgeValid(v.getContext(), false) || !isAllConsentGiven(v.getContext())) { + if (!isAgeValid(v.getContext(), false) || !isAllConsentGiven(v.getContext(), false)) { return; } if (mSetup.hasPaidVersion()) { @@ -253,8 +253,8 @@ private boolean isAgeValid(Context context, boolean agree) { return true; } - private boolean isAllConsentGiven(Context context) { - if (mSetup.explicitConsentForEachService()) { + private boolean isAllConsentGiven(Context context, boolean agree) { + if (mSetup.explicitConsentForEachService() && agree) { int consentsGiven = 0; for (int i = 0; i < mExplicitlyConfirmedServices.size(); i++) { if (mExplicitlyConfirmedServices.get(i) == 1) { diff --git a/library/src/main/res/values/strings.xml b/library/src/main/res/values/strings.xml index 475f810..eb5885d 100644 --- a/library/src/main/res/values/strings.xml +++ b/library/src/main/res/values/strings.xml @@ -16,8 +16,8 @@ This app uses following services: Depending on your privacy settings, those services (including partners) may collect and process personal data such as device identifieres, location data and other demographic and interest data about you to provide you a personalized experience.<br/><br/>%1$s - By agreeing, you are confirming that you are over the age of 16 and would like this personalized experience. - By agreeing, you are confirming that you would like this personalized experience. + By agreeing, you are confirming that you are over the age of 16 and would like this personalized experience. + By agreeing, you are confirming that you would like this personalized experience. Great.<br/><br/>%1$s