package com.datarecovery.master.dialog;

import static com.datarecovery.master.dialog.BaseDialog.*;

import android.content.Context;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.StringRes;

import com.datarecovery.master.dialog.BaseDialog;
import com.datarecovery.master.R;
import com.datarecovery.master.databinding.DialogCommonLoadingBinding;

@FullScreen(height = false)
public class CommonLoadingDialog extends BaseDialog<DialogCommonLoadingBinding> {

    public CommonLoadingDialog(@NonNull Context context) {
        super(context, R.style.Theme_Common_Dialog);
        setCancelable(false);
    }

    public CommonLoadingDialog setMessage(@StringRes int message) {
        binding.commonLoadingText.setText(message);
        return this;
    }

    @Override
    protected boolean useQueue() {
        return false;
    }

    public CommonLoadingDialog setMessageGone() {
        binding.commonLoadingText.setVisibility(View.GONE);
        return this;
    }
}