package hotchemi.android.rate;

import android.view.View;

import java.lang.ref.WeakReference;

final class DialogOptions {

    private boolean showNeutralButton = true;

    private boolean showTitle = true;

    private int titleResId = R.string.rate_dialog_title;

    private int messageResId = R.string.rate_dialog_message;

    private int textPositiveResId = R.string.rate_dialog_ok;

    private int textNeutralResId = R.string.rate_dialog_cancel;

    private int textNegativeResId = R.string.rate_dialog_no;

    private WeakReference<View> view;

    private WeakReference<OnClickButtonListener> listener;

    public boolean shouldShowNeutralButton() {
        return showNeutralButton;
    }

    public void setShowNeutralButton(boolean showNeutralButton) {
        this.showNeutralButton = showNeutralButton;
    }

    public boolean shouldShowTitle() {
        return showTitle;
    }

    public void setShowTitle(boolean showTitle) {
        this.showTitle = showTitle;
    }

    public int getTitleResId() {
        return titleResId;
    }

    public void setTitleResId(int titleResId) {
        this.titleResId = titleResId;
    }

    public int getMessageResId() {
        return messageResId;
    }

    public void setMessageResId(int messageResId) {
        this.messageResId = messageResId;
    }

    public int getTextPositiveResId() {
        return textPositiveResId;
    }

    public void setTextPositiveResId(int textPositiveResId) {
        this.textPositiveResId = textPositiveResId;
    }

    public int getTextNeutralResId() {
        return textNeutralResId;
    }

    public void setTextNeutralResId(int textNeutralResId) {
        this.textNeutralResId = textNeutralResId;
    }

    public int getTextNegativeResId() {
        return textNegativeResId;
    }

    public void setTextNegativeResId(int textNegativeResId) {
        this.textNegativeResId = textNegativeResId;
    }

    public View getView() {
        return view.get();
    }

    public void setView(View view) {
        this.view = new WeakReference<>(view);
    }

    public OnClickButtonListener getListener() {
        return listener.get();
    }

    public void setListener(OnClickButtonListener listener) {
        this.listener = new WeakReference<>(listener);
    }

}

package hotchemi.android.rate;

import android.view.View;

import java.lang.ref.WeakReference;

final class DialogOptions {

    private boolean showNeutralButton = true;

    private boolean showTitle = true;

    private int titleResId = R.string.rate_dialog_title;

    private int messageResId = R.string.rate_dialog_message;

    private int textPositiveResId = R.string.rate_dialog_ok;

    private int textNeutralResId = R.string.rate_dialog_cancel;

    private int textNegativeResId = R.string.rate_dialog_no;

    private WeakReference<View> view;

    private WeakReference<OnClickButtonListener> listener;

    public boolean shouldShowNeutralButton() {
        return showNeutralButton;
    }

    public void setShowNeutralButton(boolean showNeutralButton) {
        this.showNeutralButton = showNeutralButton;
    }

    public boolean shouldShowTitle() {
        return showTitle;
    }

    public void setShowTitle(boolean showTitle) {
        this.showTitle = showTitle;
    }

    public int getTitleResId() {
        return titleResId;
    }

    public void setTitleResId(int titleResId) {
        this.titleResId = titleResId;
    }

    public int getMessageResId() {
        return messageResId;
    }

    public void setMessageResId(int messageResId) {
        this.messageResId = messageResId;
    }

    public int getTextPositiveResId() {
        return textPositiveResId;
    }

    public void setTextPositiveResId(int textPositiveResId) {
        this.textPositiveResId = textPositiveResId;
    }

    public int getTextNeutralResId() {
        return textNeutralResId;
    }

    public void setTextNeutralResId(int textNeutralResId) {
        this.textNeutralResId = textNeutralResId;
    }

    public int getTextNegativeResId() {
        return textNegativeResId;
    }

    public void setTextNegativeResId(int textNegativeResId) {
        this.textNegativeResId = textNegativeResId;
    }

    public View getView() {
        if (view == null) {
            return null;
        }
        return view.get();
    }

    public void setView(View view) {
        this.view = new WeakReference<>(view);
    }

    public OnClickButtonListener getListener() {
        if (listener == null) {
            return null;
        }
        return listener.get();
    }

    public void setListener(OnClickButtonListener listener) {
        this.listener = new WeakReference<>(listener);
    }

}

Fix to avoid null references.