package com.cooleshow.student.widgets.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.cooleshow.student.R;

import androidx.annotation.NonNull;

/**
 * Author by pq, Date on 2022/4/7.
 */
public class LiveRoomCloseMicTipDialog extends Dialog implements View.OnClickListener {

    private TextView mTvSure;
    private TextView mTvCancel;
    private View.OnClickListener confirmClickListener;
    private TextView mTvTip;

    public LiveRoomCloseMicTipDialog(@NonNull Context context) {
        super(context, R.style.DialogStyle);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_live_room_close_mic_layout);
        mTvSure = findViewById(R.id.tv_sure);
        mTvCancel = findViewById(R.id.tv_cancel);
        mTvTip = findViewById(R.id.tv_tip);
        mTvCancel.setOnClickListener(this);
        if (confirmClickListener != null) {
            mTvSure.setOnClickListener(confirmClickListener);
        }
    }

    public void setContent(String content) {
        if (mTvTip != null) {
            mTvTip.setText(content);
        }
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_cancel:
                dismiss();
                break;
        }
    }

    public void setConfirmClickListener(View.OnClickListener confirmClickListener) {
        this.confirmClickListener = confirmClickListener;
    }
}
