package it.integry.integrywmsnative.view.dialogs.base;

import android.app.Dialog;

public class DialogSimpleInputViewModel {


    private Dialog mDialog;
    private Runnable onPositive;
    private Runnable onNegative;


    public DialogSimpleInputViewModel(Dialog dialog) {
        mDialog = dialog;
    }

    public DialogSimpleInputViewModel setOnPositive(Runnable onPositive) {
        this.onPositive = onPositive;
        return this;
    }



    public DialogSimpleInputViewModel setOnNegative(Runnable onNegative) {
        this.onNegative = onNegative;
        return this;
    }



    public boolean isPositiveVisible() {
        return onPositive != null;
    }


    public boolean isNegativeVisible() {
        return onNegative != null;
    }


    public void onPositiveClick() {
        mDialog.dismiss();
        if(onPositive != null) onPositive.run();
    }
    public void onNegativeClick() {
        mDialog.dismiss();
        if(onNegative != null) onNegative.run();
    }
}
