package com.swiftcleaner.chovey.view.dialog;

import android.app.Activity;
import android.app.Dialog;
import android.graphics.Color;
import android.widget.ImageView;

import androidx.appcompat.widget.AppCompatButton;
import androidx.cardview.widget.CardView;

import com.swiftcleaner.chovey.R;
import com.swiftcleaner.chovey.business.admob.AdmobManager;
import com.swiftcleaner.chovey.business.admob.NativeView;

public class NoticeDialog extends Dialog {

    private Activity activity;
    private OnDialogClickListener listener;

    public interface OnDialogClickListener {
        void onCancel();

        void onSubmit();
    }


    public NoticeDialog(Activity activity) {
        super(activity, R.style.TransparentDialogTheme);
        this.activity = activity;
        setContentView(R.layout.dialog_notice_item);

        ImageView dialog_cancel = findViewById(R.id.dialog_close);
        AppCompatButton dialog_ok = findViewById(R.id.dialog_submit_button);
        CardView cardView = findViewById(R.id.cardview);
        cardView.setCardBackgroundColor(Color.TRANSPARENT);

        dialog_cancel.setOnClickListener(v -> {
            if (listener != null) {
                listener.onCancel();
            }
            dismiss();
        });

        dialog_ok.setOnClickListener(v -> {
            if (listener != null) {
                listener.onSubmit();
            }
            dismiss();
        });

        setCanceledOnTouchOutside(false);
    }

    public void show() {
        super.show();

    }

    public void setOnDialogClickListener(OnDialogClickListener listener) {
        this.listener = listener;
    }
}