package com.javiersantos.adblockeradvise;

import android.content.Context;

public class AdBlockerAdviseDialog {
    private LibraryPreferences libraryPreferences;
    private Context context;
    private boolean onlyOnce = false;
    private String title;
    private String text;

    /**
     * Shows an Alert Dialog if an Ad blocker is activated with default title and content
     * @param context
     * @param onlyOnce Alert Dialog will be showed only one time
     */
    public AdBlockerAdviseDialog(Context context, boolean onlyOnce) {
        this.libraryPreferences = new LibraryPreferences(context);
        this.context = context;
        this.title = context.getResources().getString(R.string.dialog_title);
        this.text = String.format(context.getResources().getString(R.string.dialog_text), UtilsLibrary.getAppName(context));
        this.onlyOnce = onlyOnce;
    }

    /**
     * Shows an Alert Dialog if an Ad blocker is activated with custom title and content
     * @param context
     * @param title Title of the Alert Dialog
     * @param text Content of the Alert Dialog
     * @param onlyOnce Alert Dialog will be showed only one time
     */
    public AdBlockerAdviseDialog(Context context, String title, String text, boolean onlyOnce) {
        this.libraryPreferences = new LibraryPreferences(context);
        this.context = context;
        this.title = title;
        this.text = text;
        this.onlyOnce = onlyOnce;
    }

    public void show() {
        Boolean res = false;
        if (onlyOnce) {
            if (!libraryPreferences.getAdBlockerAdvise()) {
                res = UtilsLibrary.isAdBlockerActivated();
                libraryPreferences.setAdBlockerAdvise(true);
            }
        } else {
            res = UtilsLibrary.isAdBlockerActivated();
        }

        if (res) {
            UtilsUI.showTitleContent(context, title, text);
        }
    }

}

@@ -214,24 +214,16 @@
 onlyOnce
- = false
 ;%0A    pr
@@ -398,478 +398,1488 @@
    *
- @param onlyOnce Alert Dialog will be showed only one time%0A     */%0A    public AdBlockerAdviseDialog(Context context, boolean onlyOnce) %7B%0A        this.libraryPreferences = new LibraryPreferences(context);%0A        this.context = context;%0A        this.title = context.getResources().getString(R.string.dialog_title);%0A        this.text = String.format(context.getResources().getString(R.string.dialog_text), UtilsLibrary.getAppName(context));%0A        this.onlyOnce = onlyOnc
+/%0A    public AdBlockerAdviseDialog(Context context) %7B%0A        this.libraryPreferences = new LibraryPreferences(context);%0A        this.context = context;%0A        this.title = context.getResources().getString(R.string.dialog_title);%0A        this.text = String.format(context.getResources().getString(R.string.dialog_text), UtilsLibrary.getAppName(context));%0A        this.onlyOnce = false;%0A    %7D%0A%0A    /**%0A     * Shows an Alert Dialog if an Ad blocker is activated with default title and content%0A     * @param context%0A     * @param onlyOnce Alert Dialog will be showed only one time%0A     */%0A    public AdBlockerAdviseDialog(Context context, boolean onlyOnce) %7B%0A        this.libraryPreferences = new LibraryPreferences(context);%0A        this.context = context;%0A        this.title = context.getResources().getString(R.string.dialog_title);%0A        this.text = String.format(context.getResources().getString(R.string.dialog_text), UtilsLibrary.getAppName(context));%0A        this.onlyOnce = onlyOnce;%0A    %7D%0A%0A    /**%0A     * Shows an Alert Dialog if an Ad blocker is activated with custom title and content%0A     * @param context%0A     * @param title Title of the Alert Dialog%0A     * @param text Content of the Alert Dialog%0A     */%0A    public AdBlockerAdviseDialog(Context context, String title, String text) %7B%0A        this.libraryPreferences = new LibraryPreferences(context);%0A        this.context = context;%0A        this.title = title;%0A        this.text = text;%0A        this.onlyOnce = fals
 e;%0A 

Add Basic constructor without onlyOnce