package com.atmob.voiceai.dialog;

import android.content.Context;

import androidx.annotation.NonNull;

import com.atmob.app.lib.base.BaseDialog;
import com.atmob.voiceai.R;
import com.atmob.voiceai.databinding.DialogSubRetentionBinding;

@BaseDialog.FullScreen
public class SubRetentionDialog extends BaseDialog<DialogSubRetentionBinding> {


    private ActionHandler actionHandler;

    public SubRetentionDialog(@NonNull Context context) {
        super(context, R.style.Theme_Common_Dialog);
        setCancelable(false);
        binding.setOnSubClick(v -> {
            dismiss();
            if (actionHandler != null) {
                actionHandler.onSubRetentionClick();
            }
        });
        binding.setOnCancelClick(v -> {
            dismiss();
            if (actionHandler != null) {
                actionHandler.onCancelClick();
            }
        });
    }

    public void setActionHandler(ActionHandler actionHandler) {
        this.actionHandler = actionHandler;
    }

    public interface ActionHandler {

        void onSubRetentionClick();

        void onCancelClick();
    }
}
