package com.gingersoft.supply_chain.mvp.ui.widget;

import android.content.Context;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.gingersoft.supply_chain.R;
import com.lxj.xpopup.core.CenterPopupView;

/**
 * @author 宇航.
 * User: admin
 * Date: 2021/3/9
 * Time: 17:39
 * Use:
 */
public class TextPopup extends CenterPopupView {

    private String title;
    private String content;

    public TextPopup(@NonNull Context context, String title, String content) {
        super(context);
        this.title = title;
        this.content = content;
    }

    @Override
    protected int getPopupLayoutId() {
        return R.layout.popup_text;
    }

    @Override
    protected void onCreate() {
        super.onCreate();
        TextView tvTitle = findViewById(R.id.tv_title);

        tvTitle.setText(title);
        TextView tvContent = findViewById(R.id.tv_content);
        tvContent.setText(content.replace("\\n", "\n"));
    }
}
