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 LiveRoomInviteSeatMicTipDialog extends Dialog {

    private TextView mTvSure;
    private TextView mTvCancel;
    private View.OnClickListener viewClickListener;
    private TextView mTvContent;

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

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_live_room_invite_mic_layout);
        mTvSure = findViewById(R.id.tv_sure);
        mTvCancel = findViewById(R.id.tv_cancel);
        mTvContent = findViewById(R.id.tv_content);
        if (viewClickListener != null) {
            mTvSure.setOnClickListener(viewClickListener);
            mTvCancel.setOnClickListener(viewClickListener);
        }
    }

    public void setContent(String nickName) {
        if (mTvContent != null) {
            String content = getContext().getString(R.string.invite_seat_content_tip, nickName);
            mTvContent.setText(content);
        }
    }

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