package com.ytpm.hydtw.loading;

import android.app.Dialog;
import android.content.Context;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.ytpm.hydtw.R;

public class LoadingDialog extends Dialog {
    private TextView tvMessage;
    private ProgressBar progressBar;

    public LoadingDialog(Context context) {
        this(context, R.style.LoadingDialogStyle);
    }

    public LoadingDialog(Context context, int themeResId) {
        super(context, themeResId);
        initView(context);
    }

    private void initView(Context context) {
        setContentView(R.layout.dialog_loading);
        setCancelable(false);
        setCanceledOnTouchOutside(false);

        tvMessage = findViewById(R.id.tv_loading_message);
        progressBar = findViewById(R.id.progress_bar);
    }

    public void setMessage(String message) {
        tvMessage.setText(message);
    }
}
