yesButton.setIcon(Imgs.CHECKMARK.get());
yesButton.setIconOrientation("left");
yesButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
GoogleAnalyticsEvent consentEvent = new GoogleAnalyticsEvent("consent", "yes");
GoogleAnalytics.trackEvent(consentEvent);
consentWindow.destroy();
view.getSettings().setTrackingConsent(true);
view.getSettings().setTrackingQueryConsent(true);
LocalStorageHelper.storeSettings(view.getSettings());
}});
yesButton.setShowDownIcon(false);
LayoutSpacer spacer1 = new LayoutSpacer();
spacer1.setWidth(10);
buttons.setAlign(Alignment.CENTER);
IButton noQueriesButton = new IButton("Yes, track site usage, but not <br>the queries/endpoints I use");
noQueriesButton.setWidth(CONSENT_BUTTON_WIDTH);
noQueriesButton.setHeight(CONSENT_BUTTON_HEIGHT);
noQueriesButton.setShowRollOver(false);
noQueriesButton.setIcon(Imgs.CHECK_CROSS.get());
noQueriesButton.setIconOrientation("left");
noQueriesButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
GoogleAnalyticsEvent consentEvent = new GoogleAnalyticsEvent("consent", "yes/no");
GoogleAnalytics.trackEvent(consentEvent);
consentWindow.destroy();
view.getSettings().setTrackingConsent(true);
view.getSettings().setTrackingQueryConsent(false);
LocalStorageHelper.storeSettings(view.getSettings());
}});
noQueriesButton.setShowDownIcon(false);
LayoutSpacer spacer2 = new LayoutSpacer();
spacer2.setWidth(10);
IButton noButton = new IButton("No, disable tracking");
noButton.setShowRollOver(false);
noButton.setWidth(CONSENT_BUTTON_WIDTH);
noButton.setHeight(CONSENT_BUTTON_HEIGHT);
noButton.setIcon(Imgs.CROSS.get());
noButton.setIconOrientation("left");
noButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
GoogleAnalyticsEvent consentEvent = new GoogleAnalyticsEvent("consent", "no");
GoogleAnalytics.trackEvent(consentEvent);
consentWindow.destroy();
view.getSettings().setTrackingConsent(false);
view.getSettings().setTrackingQueryConsent(false);
LocalStorageHelper.storeSettings(view.getSettings());