Update cookie consent notice

Add changes for string and UI
This commit is contained in:
deeppandya
2023-08-10 16:46:11 -04:00
parent 7fb458e780
commit 2e7c54ce5c
4 changed files with 34 additions and 29 deletions
@@ -388,13 +388,13 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE
}
}
if (mCookieListOptInPageAndroidHandler != null) {
mCookieListOptInPageAndroidHandler.shouldShowDialog(shouldShowDialog -> {
if (!shouldShowDialog) {
removePreferenceIfPresent(PREF_BLOCK_COOKIE_CONSENT_NOTICES);
}
});
}
// if (mCookieListOptInPageAndroidHandler != null) {
// mCookieListOptInPageAndroidHandler.shouldShowDialog(shouldShowDialog -> {
// if (!shouldShowDialog) {
// removePreferenceIfPresent(PREF_BLOCK_COOKIE_CONSENT_NOTICES);
// }
// });
// }
updateBravePreferences();
}
@@ -942,20 +942,21 @@ public abstract class BraveToolbarLayoutImpl extends ToolbarLayout
private void maybeShowCookieConsentTooltip() {
if (mCookieListOptInPageAndroidHandler != null && mFilterListAndroidHandler != null) {
mCookieListOptInPageAndroidHandler.shouldShowDialog(shouldShowDialog -> {
mFilterListAndroidHandler.isFilterListEnabled(
FilterListConstants.COOKIE_LIST_UUID, isEnabled -> {
if (!isEnabled && shouldShowDialog
&& SharedPreferencesManager.getInstance().readBoolean(
BravePreferenceKeys.SHOULD_SHOW_COOKIE_CONSENT_NOTICE,
true)
&& SharedPreferencesManager.getInstance().readInt(
BravePreferenceKeys.LOADED_SITE_COUNT, 0)
> 5) {
showCookieConsentTooltip();
}
});
});
// mCookieListOptInPageAndroidHandler.shouldShowDialog(shouldShowDialog -> {
// mFilterListAndroidHandler.isFilterListEnabled(
// FilterListConstants.COOKIE_LIST_UUID, isEnabled -> {
// if (!isEnabled && shouldShowDialog
// && SharedPreferencesManager.getInstance().readBoolean(
// BravePreferenceKeys.SHOULD_SHOW_COOKIE_CONSENT_NOTICE,
// true)
// && SharedPreferencesManager.getInstance().readInt(
// BravePreferenceKeys.LOADED_SITE_COUNT, 0)
// > 5) {
// showCookieConsentTooltip();
// }
// });
// });
showCookieConsentTooltip();
}
}
@@ -992,11 +993,8 @@ public abstract class BraveToolbarLayoutImpl extends ToolbarLayout
btnAction.setOnClickListener((new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mCookieListOptInPageAndroidHandler != null
&& mFilterListAndroidHandler != null) {
if (mCookieListOptInPageAndroidHandler != null) {
mCookieListOptInPageAndroidHandler.onTooltipYesClicked();
mFilterListAndroidHandler.enableFilter(
FilterListConstants.COOKIE_LIST_UUID, true);
}
mCookieConsentTooltip.dismiss();
}
@@ -1006,6 +1004,10 @@ public abstract class BraveToolbarLayoutImpl extends ToolbarLayout
txtNoThanks.setOnClickListener((new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mFilterListAndroidHandler != null) {
mFilterListAndroidHandler.enableFilter(
FilterListConstants.COOKIE_LIST_UUID, false);
}
if (mCookieListOptInPageAndroidHandler != null) {
mCookieListOptInPageAndroidHandler.onTooltipNoClicked();
}
@@ -70,7 +70,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="30dp"
android:text="@string/no_thanks"
android:text="@string/stop_blocking"
android:textAlignment="center"
android:textColor="@color/cookie_consent_action_color"
android:textSize="14sp" />